- Timestamp:
- 06/27/12 13:00:55 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4/expressoAdmin1_2/inc/class.uisectors.inc.php
r5133 r6660 20 20 'validate_data_sectors_edit' => True, 21 21 'delete_sector' => True, 22 'css' => True 22 'css' => True, 23 'view_cota' => True 23 24 ); 24 25 … … 63 64 $p->set_block('sectors','row_empty','row_empty'); 64 65 65 $sectors_info = $this->functions->get_sectors_list($contexts); 66 //$sectors_info = $this->functions->get_sectors_list($contexts); 67 $sectors_info = $this->functions->get_organizations2($contexts); 66 68 67 69 $var = Array( … … 69 71 'back_url' => $GLOBALS['phpgw']->link('/expressoAdmin1_2/index.php'), 70 72 'context_display' => $context_display, 71 'lang_inactives' => lang('list inactives') 73 'lang_inactives' => lang('list inactives'), 74 'lang_ver_cota' => lang('view cota') 72 75 ); 73 76 … … 95 98 { 96 99 $tr_color = $this->nextmatchs->alternate_row_color($tr_color); 97 98 100 $var = Array( 99 101 'tr_color' => $tr_color, 100 'sector_name' => $sector, 101 'add_link' => $this->row_action('add','sector',$context) 102 'sector_name' => $sector['display'], 103 'cota_link' => $this->row_action('view','cota',$sector['dn']), 104 'add_link' => $this->row_action('add','sector',$sector['dn']) 102 105 ); 103 106 … … 106 109 107 110 if(isset($GLOBALS['phpgw_info']['server']['time_to_account_expires'])) 108 $var['inactives_link'] = $this->row_action('list_inactive','users',$ context,'uiaccounts');111 $var['inactives_link'] = $this->row_action('list_inactive','users',$sector['dn'],'uiaccounts'); 109 112 else 110 113 $var['inactives_link'] = lang('disabled'); … … 114 117 if ($can_edit) 115 118 { 116 $p->set_var('edit_link',$this->row_action('edit','sector', utf8_decode($context)));119 $p->set_var('edit_link',$this->row_action('edit','sector',$sector['dn'])); 117 120 } 118 121 else … … 123 126 if ($can_delete) 124 127 { 125 $p->set_var('delete_link',$this->row_action('delete','sector', utf8_decode($context)));128 $p->set_var('delete_link',$this->row_action('delete','sector',$sector['dn'])); 126 129 } 127 130 else … … 189 192 'context' => $context == '' ? $GLOBALS['phpgw_info']['server']['ldap_context'] : $context, 190 193 'sector' => $_POST['sector'], 194 'disk_quota' => $_POST['disk_quota'], 195 'users_quota' => $_POST['users_quota'], 191 196 'manager_org' => $combo_manager_org, 192 197 'sector_visible_checked'=> $_POST['sector_visible'] ? 'checked' : '', 193 198 'error_messages' => $_POST['error_messages'] == '' ? '' : "<script type='text/javascript'>alert('".$_POST['error_messages']."')</script>", 194 199 ); 195 200 201 if($this->functions->db_functions->use_cota_control()) { 202 $var["open_comment_cotas"] = ""; 203 $var["close_comment_cotas"] =""; 204 } 205 else { 206 $var["open_comment_cotas"] = "<!--"; 207 $var["close_comment_cotas"] ="-->"; 208 } 209 196 210 $var['sector'] = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''",$var['sector']); 197 211 $var['sector'] = utf8_decode($var['sector']); … … 242 256 { 243 257 $sector_info = $this->so->get_info($context); 258 $sector_disk_quota = $sector_info[0]['diskquota'][0]; 259 $sector_users_quota = $sector_info[0]['usersquota'][0]; 244 260 $_POST['sector_visible'] = $sector_info[0]['phpgwaccountvisible'][0]; 245 261 } … … 254 270 'manager_org' => $combo_manager_org, 255 271 'sector_visible_checked'=> $_POST['sector_visible'] ? 'checked' : '', 272 'disk_quota' => $_POST['disk_quota'] == '' ? $sector_disk_quota : $_POST['disk_quota'], 273 'users_quota' => $_POST['users_quota'] == '' ? $sector_users_quota : $_POST['users_quota'], 256 274 257 275 'lang_add' => lang('Add'), 258 276 'disable' => 'disabled', 259 277 'error_messages' => $_POST['error_messages'] == '' ? '' : "<script type='text/javascript'>alert('".$_POST['error_messages']."')</script>", 260 ); 278 'lang_disk_quota' => lang('disk quota'), 279 'lang_users_quota' => lang('users quota') 280 ); 281 if($this->functions->db_functions->use_cota_control()) { 282 $var["open_comment_cotas"] = ""; 283 $var["close_comment_cotas"] =""; 284 } 285 else { 286 $var["open_comment_cotas"] = "<!--"; 287 $var["close_comment_cotas"] ="-->"; 288 } 261 289 262 290 $var['sector'] = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''",$var['sector']); … … 267 295 268 296 $p->pfp('out','edit_sector'); 269 } 297 } 298 299 function view_cota() 300 { 301 $context = $_GET['context']; 302 $a_tmp = explode(",", ldap_dn2ufn($context)); 303 304 $sector_name = $a_tmp[0]; 305 if($this->functions->db_functions->use_cota_control()) { 306 $sector_info = $this->so->get_info($context); 307 $sector_disk_cota = $sector_info[0]['diskquota'][0]; 308 $sector_users_cota = $sector_info[0]['usersquota'][0]; 309 } 310 else { 311 $sector_disk_cota = lang('cotas control disabled'); 312 $sector_users_cota = lang('cotas control disabled'); 313 } 314 315 316 unset($GLOBALS['phpgw_info']['flags']['noheader']); 317 unset($GLOBALS['phpgw_info']['flags']['nonavbar']); 318 $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['expressoAdmin1_2']['title'].' - '.lang('Edit Sector'); 319 $GLOBALS['phpgw']->common->phpgw_header(); 320 321 // Set o template 322 $p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); 323 $p->set_file(Array('ver_cota' => 'sectors_cota.tpl')); 324 325 326 // Seta variaveis utilizadas pelo tpl. 327 $var = Array( 328 'back_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uisectors.list_sectors'), 329 'th_bg' => $GLOBALS['phpgw_info']['theme']['th_bg'], 330 'context' => $context, 331 'sector' => $sector_name, 332 'disk_cota' => $sector_disk_cota, 333 'users_cota' => $sector_users_cota, 334 'actual_users' => $this->functions->get_num_users($context), 335 'actual_disk' => round($this->functions->get_actual_disk_usage($context),2), 336 337 'lang_back' => lang('Back'), 338 'lang_context' => lang('Context'), 339 'lang_sector_name' => lang('Sector name'), 340 'lang_disk_cota' => lang('disk usage cota'), 341 'lang_users_cota' => lang('user number cota'), 342 'lang_user_number' => lang('user number'), 343 'lang_disk_used' => lang('disk usage'), 344 'error_messages' => $_POST['error_messages'] == '' ? '' : "<script type='text/javascript'>alert('".$_POST['error_messages']."')</script>", 345 ); 346 $p->set_var($var); 347 348 $p->pfp('out','ver_cota'); 349 } 270 350 271 351 function validate_data_sectors_add()
Note: See TracChangeset
for help on using the changeset viewer.