Changeset 5133 for trunk/expressoAdmin1_2/inc/class.uisectors.inc.php
- Timestamp:
- 11/03/11 13:24:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/inc/class.uisectors.inc.php
r3887 r5133 20 20 'validate_data_sectors_edit' => True, 21 21 'delete_sector' => True, 22 'css' => True, 23 'view_cota' => True 22 'css' => True 24 23 ); 25 24 … … 47 46 48 47 // Verifica se o administrador tem acesso. 49 48 if (!$this->functions->check_acl($manager_lid,'list_sectors')) 49 { 50 $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/expressoAdmin1_2/inc/access_denied.php')); 51 } 50 52 51 53 unset($GLOBALS['phpgw_info']['flags']['noheader']); … … 61 63 $p->set_block('sectors','row_empty','row_empty'); 62 64 63 //$sectors_info = $this->functions->get_sectors_list($contexts); 64 $sectors_info = $this->functions->get_organizations2($contexts); 65 $sectors_info = $this->functions->get_sectors_list($contexts); 65 66 66 67 $var = Array( … … 68 69 'back_url' => $GLOBALS['phpgw']->link('/expressoAdmin1_2/index.php'), 69 70 'context_display' => $context_display, 70 'lang_inactives' => lang('list inactives') ,71 'lang_ver_cota' => lang('view cota')72 ); 71 'lang_inactives' => lang('list inactives') 72 ); 73 73 74 $p->set_var($var); 74 75 $p->set_var($this->functions->make_dinamic_lang($p, 'list')); … … 97 98 $var = Array( 98 99 'tr_color' => $tr_color, 99 'sector_name' => $sector ['display'],100 ' cota_link' => $this->row_action('view','cota',$sector['dn']),100 'sector_name' => $sector, 101 'add_link' => $this->row_action('add','sector',$context) 101 102 ); 102 103 103 if ($this->functions->check_acl($manager_lid,'create_sectors')) 104 $p->set_var('add_link',$this->row_action('add','sector',$sector['dn'])); 105 else 106 $p->set_var('add_link',' '); 104 $var['sector_name'] = utf8_decode($var['sector_name']); 105 107 106 108 107 if(isset($GLOBALS['phpgw_info']['server']['time_to_account_expires'])) 109 $var['inactives_link'] = $this->row_action('list_inactive','users',$ sector['dn'],'uiaccounts');108 $var['inactives_link'] = $this->row_action('list_inactive','users',$context,'uiaccounts'); 110 109 else 111 110 $var['inactives_link'] = lang('disabled'); … … 115 114 if ($can_edit) 116 115 { 117 $p->set_var('edit_link',$this->row_action('edit','sector', $sector['dn']));116 $p->set_var('edit_link',$this->row_action('edit','sector',utf8_decode($context))); 118 117 } 119 118 else … … 124 123 if ($can_delete) 125 124 { 126 $p->set_var('delete_link',$this->row_action('delete','sector', $sector['dn']));125 $p->set_var('delete_link',$this->row_action('delete','sector',utf8_decode($context))); 127 126 } 128 127 else … … 139 138 $p->set_var($var); 140 139 141 if ($this->functions->check_acl($manager_lid,'create_sectors')) {142 140 $p->set_var('input_add','<input type="submit" value="' . lang('Add Sectors') . '">'); 143 }144 else {145 $p->set_var('input_add',' ');146 }147 141 148 142 $p->parse('rows','row_empty',True); … … 163 157 $context = $_GET['context']; 164 158 $combo_manager_org = $this->functions->get_organizations( $context, '', true, true, true ); 159 $combo_manager_org = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''",$combo_manager_org); 160 $combo_manager_org = utf8_decode($combo_manager_org); 165 161 } 166 162 else … … 193 189 'context' => $context == '' ? $GLOBALS['phpgw_info']['server']['ldap_context'] : $context, 194 190 'sector' => $_POST['sector'], 195 'associated_domain' => $_POST['associated_domain'],196 'disk_quota' => $_POST['disk_quota'],197 'users_quota' => $_POST['users_quota'],198 'file_manager_quota'=> $_POST['file_manager_quota'],199 191 'manager_org' => $combo_manager_org, 200 192 'sector_visible_checked'=> $_POST['sector_visible'] ? 'checked' : '', … … 202 194 ); 203 195 204 if($this->functions->db_functions->use_cota_control()) { 205 $var["open_comment_cotas"] = ""; 206 $var["close_comment_cotas"] =""; 207 } 208 else { 209 $var["open_comment_cotas"] = "<!--"; 210 $var["close_comment_cotas"] ="-->"; 211 } 196 $var['sector'] = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''",$var['sector']); 197 $var['sector'] = utf8_decode($var['sector']); 212 198 213 199 $p->set_var($var); … … 225 211 $context = $_GET['context']; 226 212 227 $combo_manager_org = $this->functions->get_organizations($_GET['context'], '', true, true, true); 213 $context = utf8_encode($context); 214 $context = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''",$context); 215 216 $combo_manager_org = $this->functions->get_organizations($context, '', true, true, true); 217 218 $combo_manager_org = utf8_decode(preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''",$combo_manager_org)); 219 228 220 $combo_manager_org = substr( $combo_manager_org, 0, ( strpos($combo_manager_org, '</option>') + 9 ) ); 229 221 … … 250 242 { 251 243 $sector_info = $this->so->get_info($context); 252 $sector_disk_quota = $sector_info[0]['diskquota'][0];253 $sector_users_quota = $sector_info[0]['usersquota'][0];254 $sector_file_manager_quota = $sector_info[0]['filemanagerquota'][0];255 $sector_associated_domain = $sector_info[0]['associateddomain'][0];256 244 $_POST['sector_visible'] = $sector_info[0]['phpgwaccountvisible'][0]; 257 245 } … … 266 254 'manager_org' => $combo_manager_org, 267 255 'sector_visible_checked'=> $_POST['sector_visible'] ? 'checked' : '', 268 'associated_domain' => $_POST['associated_domain'] == '' ? $sector_associated_domain : $_POST['associated_domain'], 269 'disk_quota' => $_POST['disk_quota'] == '' ? $sector_disk_quota : $_POST['disk_quota'], 270 'users_quota' => $_POST['users_quota'] == '' ? $sector_users_quota : $_POST['users_quota'], 271 'file_manager_quota'=> $_POST['file_manager_quota'] == '' ? $sector_file_manager_quota : $_POST['file_manager_quota'], 256 272 257 'lang_add' => lang('Add'), 273 258 'disable' => 'disabled', 274 259 'error_messages' => $_POST['error_messages'] == '' ? '' : "<script type='text/javascript'>alert('".$_POST['error_messages']."')</script>", 275 'lang_disk_quota' => lang('disk quota'), 276 'lang_users_quota' => lang('users quota') 277 ); 278 if($this->functions->db_functions->use_cota_control()) { 279 $var["open_comment_cotas"] = ""; 280 $var["close_comment_cotas"] =""; 281 } 282 else { 283 $var["open_comment_cotas"] = "<!--"; 284 $var["close_comment_cotas"] ="-->"; 285 } 260 ); 261 262 $var['sector'] = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''",$var['sector']); 263 $var['sector'] = utf8_decode($var['sector']); 264 286 265 $p->set_var($var); 287 266 $p->set_var($this->functions->make_dinamic_lang($p, 'list')); 288 267 289 268 $p->pfp('out','edit_sector'); 290 }291 292 function view_cota()293 {294 $context = $_GET['context'];295 $a_tmp = explode(",", ldap_dn2ufn($context));296 297 $sector_name = $a_tmp[0];298 if($this->functions->db_functions->use_cota_control()) {299 $sector_info = $this->so->get_info($context);300 $sector_disk_cota = $sector_info[0]['diskquota'][0];301 $sector_users_cota = $sector_info[0]['usersquota'][0];302 }303 else {304 $sector_disk_cota = lang('cotas control disabled');305 $sector_users_cota = lang('cotas control disabled');306 }307 308 309 unset($GLOBALS['phpgw_info']['flags']['noheader']);310 unset($GLOBALS['phpgw_info']['flags']['nonavbar']);311 $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['expressoAdmin1_2']['title'].' - '.lang('Edit Sector');312 $GLOBALS['phpgw']->common->phpgw_header();313 314 // Set o template315 $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);316 $p->set_file(Array('ver_cota' => 'sectors_cota.tpl'));317 318 319 // Seta variaveis utilizadas pelo tpl.320 $var = Array(321 'back_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uisectors.list_sectors'),322 'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'],323 'context' => $context,324 'sector' => $sector_name,325 'disk_cota' => $sector_disk_cota,326 'users_cota' => $sector_users_cota,327 'actual_users' => $this->functions->get_num_users($context),328 'actual_disk' => round($this->functions->get_actual_disk_usage($context),2),329 330 'lang_back' => lang('Back'),331 'lang_context' => lang('Context'),332 'lang_sector_name' => lang('Sector name'),333 'lang_disk_cota' => lang('disk usage cota'),334 'lang_users_cota' => lang('user number cota'),335 'lang_user_number' => lang('user number'),336 'lang_disk_used' => lang('disk usage'),337 'error_messages' => $_POST['error_messages'] == '' ? '' : "<script type='text/javascript'>alert('".$_POST['error_messages']."')</script>",338 );339 $p->set_var($var);340 341 $p->pfp('out','ver_cota');342 269 } 343 270 … … 371 298 $acl = $this->functions->read_acl($account_lid); 372 299 $manager_context = $acl[0]['context']; 300 301 $manager_context = utf8_encode($manager_context); 302 $manager_context = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''",$manager_context); 373 303 374 304 // Verifica se tem acesso a este modulo … … 394 324 $sector_name = $tmp_sector_name[1]; 395 325 326 396 327 // Get users of sector 397 $sector_users = $this->so->get_sector_users( $_GET['context']);398 $sector_groups = $this->so->get_sector_groups( $_GET['context']);399 $sector_subsectors = $this->so->get_sector_subsectors( $_GET['context']);328 $sector_users = $this->so->get_sector_users(utf8_encode($_GET['context'])); 329 $sector_groups = $this->so->get_sector_groups(utf8_encode($_GET['context'])); 330 $sector_subsectors = $this->so->get_sector_subsectors(utf8_encode($_GET['context'])); 400 331 401 332 $users_list = ''; … … 415 346 { 416 347 if ($subsector['dn'] != $_GET['context']) 417 $subsectors_list .= $subsector['ou'][0] . '<br>';348 $subsectors_list .= utf8_decode($subsector['ou'][0] . '<br>'); 418 349 } 419 350 … … 431 362 'sectors_list' => $subsectors_list 432 363 ); 364 $var['sector_name'] = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''",$var['sector_name']); 365 433 366 $p->set_var($var); 434 367 $p->set_var($this->functions->make_dinamic_lang($p, 'list'));
Note: See TracChangeset
for help on using the changeset viewer.