Changeset 23 for trunk/expressoAdmin1_2/inc/class.uimaillists.inc.php
- Timestamp:
- 05/07/07 15:06:04 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.uimaillists.inc.php
r2 r23 14 14 var $public_functions = array 15 15 ( 16 'list_maillists' => True, 17 'add_maillists' => True, 18 'edit_maillists' => True, 19 'css' => True 16 'list_maillists' => True, 17 'add_maillists' => True, 18 'edit_maillists' => True, 19 'scl_maillists' => True, 20 'css' => True 20 21 ); 21 22 … … 28 29 $this->functions = CreateObject('expressoAdmin1_2.functions'); 29 30 $this->nextmatchs = CreateObject('phpgwapi.nextmatchs'); 31 32 $c = CreateObject('phpgwapi.config','expressoAdmin1_2'); 33 $c->read_repository(); 34 $this->current_config = $c->config_data; 30 35 31 36 if(!@is_object($GLOBALS['phpgw']->js)) … … 82 87 'lang_add_email_lists' => lang('Add Email Lists'), 83 88 'lang_edit' => lang('Edit'), 89 'lang_scl' => 'SCL', 84 90 'lang_delete' => 'Excluir', 85 91 'lang_view' => lang('View'), … … 131 137 { 132 138 $p->set_var('edit_link',$this->row_action('edit','maillists',$maillist['uidnumber'],$maillist['uid'])); 139 $p->set_var('scl_link',$this->row_action('scl','maillists',$maillist['uidnumber'],$maillist['uid'])); 133 140 } 134 141 else 135 142 { 136 143 $p->set_var('edit_link',' '); 144 $p->set_var('scl_link',' '); 137 145 } 138 146 … … 186 194 'uid' => 'lista-', 187 195 'accountStatus_checked' => 'CHECKED', 196 'restrictionsOnEmailLists' => $this->current_config['expressoAdmin_restrictionsOnEmailLists'], 188 197 'lang_back' => lang('Back'), 189 198 'lang_save' => lang('save'), … … 195 204 'lang_add_user' => lang('Add User'), 196 205 'lang_rem_user' => lang('Remove User'), 197 'lang_all_users' => lang('S electusers from all sub-organizations'),206 'lang_all_users' => lang('Show users from all sub-organizations'), 198 207 'back_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uimaillists.list_maillists'), 199 208 'combo_org' => $org, … … 242 251 $array_users[$uidnumber] = $userinfo['cn']; 243 252 $array_users_uid[$uidnumber] = $userinfo['uid']; 253 $array_users_type[$uidnumber] = $userinfo['type']; 244 254 } 245 255 natcasesort($array_users); 246 256 foreach ($array_users as $uidnumber=>$cn) 247 257 { 248 $ea_select_usersInMaillist .= "<option value=" . $uidnumber . ">" . $cn . " [" . $array_users_uid[$uidnumber] . "]</option>"; 249 } 258 if ($array_users_type[$uidnumber] == 'u') 259 { 260 $users .= "<option value=" . $uidnumber . ">" . $cn . " [" . $array_users_uid[$uidnumber] . "]</option>"; 261 } 262 else 263 { 264 $lists .= "<option value=" . $uidnumber . ">" . $cn . " [" . $array_users_uid[$uidnumber] . "]</option>"; 265 } 266 } 267 $opt_tmp_lists = '<option value="-1" disabled>------------------------------ Listas ------------------------------ </option>'."\n"; 268 $opt_tmp_users = '<option value="-1" disabled>----------------------------- Usuários ---------------------------- </option>'."\n"; 269 270 $ea_select_usersInMaillist = $opt_tmp_lists . $lists . $opt_tmp_users . $users; 250 271 } 251 272 … … 255 276 'color_bg2' => "#D3DCE3", 256 277 'type' => 'edit_maillist', 257 'ldap_context' => $GLOBALS['phpgw_info']['server']['ldap_context'],278 'ldap_context' => $GLOBALS['phpgw_info']['server']['ldap_context'], 258 279 'lang_back' => lang('Back'), 259 280 'lang_save' => lang('save'), … … 281 302 $p->pfp('out','edit_maillist'); 282 303 } 283 304 305 function scl_maillists() 306 { 307 $GLOBALS['phpgw']->js->set_onload('get_available_users(document.forms[0].org_context.value, document.forms[0].ea_check_allUsers.checked);'); 308 309 $account_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 310 $acl = $this->functions->read_acl($account_lid); 311 $manager_context = $acl[0]['context']; 312 313 // Verifica se tem acesso a este modulo 314 if (!$this->functions->check_acl($account_lid,'edit_maillists')) 315 { 316 $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); 317 } 318 319 // GET all infomations about the group. 320 $maillist_info = $this->maillist->get_scl_info($_GET['uidnumber'], $manager_context); 321 //_debug_array($maillist_info); 322 323 unset($GLOBALS['phpgw_info']['flags']['noheader']); 324 unset($GLOBALS['phpgw_info']['flags']['nonavbar']); 325 $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['expressoAdmin1_2']['title'].' - '.lang('Edit Sending Control List'); 326 $GLOBALS['phpgw']->common->phpgw_header(); 327 328 // Set o template 329 $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); 330 $p->set_file(Array('sql_maillist' => 'maillists_scl.tpl')); 331 332 // Pega combo das organizações e seleciona a org da lista. 333 $org = $this->functions->get_organizations($manager_context, trim(strtolower($maillist_info['context']))); 334 335 // Usuarios de senders. 336 if (count($maillist_info['senders_info']) > 0) 337 { 338 foreach ($maillist_info['senders_info'] as $uidnumber=>$senderinfo) 339 { 340 $array_senders[$uidnumber] = $senderinfo['cn']; 341 } 342 natcasesort($array_senders); 343 foreach ($array_senders as $uidnumber=>$cn) 344 { 345 $ea_select_users_SCL_Maillist .= "<option value=" . $uidnumber . ">" . $cn . " [" . $maillist_info['senders_info'][$uidnumber]['mail'] . "]</option>"; 346 } 347 } 348 349 // Seta variaveis utilizadas pelo tpl. 350 $var = Array( 351 'color_bg1' => "#E8F0F0", 352 'color_bg2' => "#D3DCE3", 353 'type' => 'edit_maillist', 354 'ldap_context' => $GLOBALS['phpgw_info']['server']['ldap_context'], 355 'dn' => $maillist_info['dn'], 356 'lang_back' => lang('Back'), 357 'lang_save' => lang('save'), 358 'lang_org' => lang('Organizations'), 359 'lang_maillist_uid' => lang('Maillist login'), 360 'lang_maillist_mail' => lang('Maillist Mail'), 361 'lang_maillist_name' => lang('Maillist name'), 362 'lang_maillist_users' => lang('Maillist users'), 363 'lang_add_user' => lang('Add User'), 364 'lang_rem_user' => lang('Remove User'), 365 'lang_all_users' => lang('Show users from all sub-organizations'), 366 'back_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uimaillists.list_maillists'), 367 'combo_org' => $org, 368 'manager_context' => $manager_context, 369 'uidnumber' => $_GET['uidnumber'], 370 'uid' => $maillist_info['uid'], 371 'mail' => $maillist_info['mail'], 372 'cn' => $maillist_info['cn'], 373 'accountRestrictive_checked' => $maillist_info['accountRestrictive'] == 'mailListRestriction' ? 'CHECKED' : '', 374 'participantCanSendMail_checked'=> $maillist_info['participantCanSendMail'] == 'TRUE' ? 'CHECKED' : '', 375 'ea_select_users_SCL_Maillist' => $ea_select_users_SCL_Maillist 376 ); 377 $p->set_var($var); 378 379 $p->pfp('out','sql_maillist'); 380 } 381 284 382 function row_action($action,$type,$uidnumber,$maillist_uid) 285 383 {
Note: See TracChangeset
for help on using the changeset viewer.