Changeset 503 for trunk/contactcenter/inc/class.ui_data.inc.php
- Timestamp:
- 10/01/08 16:46:55 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/inc/class.ui_data.inc.php
r418 r503 70 70 if($this->page_info['actual_catalog']['class'] == 'bo_group_manager') 71 71 $this -> typeContact = 'groups'; 72 else if($this->page_info['actual_catalog']['class'] == 'bo_shared_catalog_manager') 73 $this -> typeContact = 'shared'; 72 74 else 73 75 $this -> typeContact = 'contacts'; … … 147 149 148 150 /* Messages */ 151 $GLOBALS['phpgw']->template->set_var('cc_msg_not_allowed',lang('Not Allowed')); 149 152 $GLOBALS['phpgw']->template->set_var('cc_msg_no_cards',lang('No Cards')); 150 153 $GLOBALS['phpgw']->template->set_var('cc_msg_err_no_room',lang('No Room for Cards! Increase your browser area.')); … … 299 302 /* Full Add Methods */ 300 303 case 'get_full_data': 301 return $this->get_full_data($_GET['id'] );304 return $this->get_full_data($_GET['id'],$_GET['catalog']); 302 305 303 306 case 'get_group': … … 577 580 unset($ids); 578 581 $this->page_info['changed'] = false; 579 582 580 583 switch ($this->page_info['actual_catalog']['class']) 581 584 { 585 case 'bo_shared_catalog_manager': 586 $field_name = 'id_contact'; 587 588 if ($letter !== 'number') 589 { 590 $find_restric[0] = array( 591 0 => array( 592 'field' => 'contact.names_ordered', 593 'type' => 'iLIKE', 594 'value' => $letter !== 'all' ? $letter.'%' : '%' 595 ) 596 ); 597 } 598 else 599 { 600 $find_restric[0] = array( 601 0 => array( 602 'type' => 'branch', 603 'value' => 'OR', 604 'sub_branch' => array( 605 0 => array( 606 'field' => 'contact.names_ordered', 607 'type' => 'LIKE', 608 'value' => '0%' 609 ), 610 1 => array( 611 'field' => 'contact.names_ordered', 612 'type' => 'LIKE', 613 'value' => '1%' 614 ), 615 2 => array( 616 'field' => 'contact.names_ordered', 617 'type' => 'LIKE', 618 'value' => '2%' 619 ), 620 3 => array( 621 'field' => 'contact.names_ordered', 622 'type' => 'LIKE', 623 'value' => '3%' 624 ), 625 4 => array( 626 'field' => 'contact.names_ordered', 627 'type' => 'LIKE', 628 'value' => '4%' 629 ), 630 5 => array( 631 'field' => 'contact.names_ordered', 632 'type' => 'LIKE', 633 'value' => '5%' 634 ), 635 6 => array( 636 'field' => 'contact.names_ordered', 637 'type' => 'LIKE', 638 'value' => '6%' 639 ), 640 7 => array( 641 'field' => 'contact.names_ordered', 642 'type' => 'LIKE', 643 'value' => '7%' 644 ), 645 8 => array( 646 'field' => 'contact.names_ordered', 647 'type' => 'LIKE', 648 'value' => '8%' 649 ), 650 9 => array( 651 'field' => 'contact.names_ordered', 652 'type' => 'LIKE', 653 'value' => '9%' 654 ) 655 ) 656 ) 657 ); 658 } 659 660 $find_field[0] = array('contact.id_contact','contact.names_ordered'); 661 662 $find_other[0] = array( 663 'order' => 'contact.names_ordered' 664 ); 665 666 break; 582 667 case 'bo_people_catalog': 583 668 $field_name = 'id_contact'; … … 983 1068 foreach ($result as $id => $value) 984 1069 { 985 $this->page_info['actual_entries'][] = $value[$field_name]; 1070 if($this->page_info['actual_catalog']['class'] != 'bo_shared_catalog_manager') 1071 $this->page_info['actual_entries'][] = $value[$field_name]; 1072 else 1073 $this->page_info['actual_entries'][] = array(0=>$value[$field_name],1=>$value['perms']); 986 1074 } 987 1075 //print_r($this->page_info['actual_entries']); … … 1061 1149 ///---------------- Correção Temporária PHP5 -----------------------/// 1062 1150 $ids = array(); 1151 $perms = array(); 1063 1152 $array_temp = array(); 1064 1153 1065 1154 foreach($this->page_info['actual_entries'] as $key=>$tmp){ 1066 $array_temp[] = $tmp;1155 $array_temp[] = $tmp; 1067 1156 } 1068 1157 1069 1158 for($i = $id_i; $i < $id_f and $i < $n_entries; $i++) 1070 1159 { 1071 $ids[] = $array_temp[$i]; 1160 if($this->page_info['actual_catalog']['class'] != 'bo_shared_catalog_manager') 1161 $ids[] = $array_temp[$i]; 1162 else { 1163 $ids[] = $array_temp[$i][0]; 1164 $perms[] = $array_temp[$i][1]; 1165 } 1166 //$perms[] = $array_temp[$i]; 1072 1167 } 1073 1168 … … 1121 1216 return; 1122 1217 } 1218 $final[10] = $this -> typeContact; 1123 1219 1124 1220 $fields['photo'] = true; … … 1202 1298 1203 1299 // If contact is a public list, then load the forwarding addresses. 1204 if($contact['account_type'][0] == 'l' || $contact['account_type'][0] == 'i')1300 if($contact['account_type'][0] == 'l') 1205 1301 $final[3][$i][7] = array(); 1302 1303 if($this->page_info['actual_catalog']['class']=='bo_shared_catalog_manager') { 1304 $final[3][$i][8] = $perms[$i]; 1305 } 1206 1306 1207 1307 $final[4][$i] = $contact['photo'] ? 1 : 0; … … 1287 1387 1288 1388 */ 1289 function get_full_data($id )1389 function get_full_data($id,$catalog='bo_people_catalog') 1290 1390 { 1291 1391 $dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; 1292 $this->bo->catalog = CreateObject('contactcenter. bo_people_catalog');1392 $this->bo->catalog = CreateObject('contactcenter.'.$catalog); 1293 1393 $fields = $this->bo->catalog->get_fields(true); 1294 1394 $fields['photo'] = false; … … 2214 2314 // Support search parameters with accentuation 2215 2315 if ($this->page_info['actual_catalog']['class'] != 'bo_people_catalog' && 2216 $this->page_info['actual_catalog']['class'] != 'bo_group_manager') 2316 $this->page_info['actual_catalog']['class'] != 'bo_group_manager' && 2317 $this->page_info['actual_catalog']['class'] != 'bo_shared_catalog_manager') 2217 2318 { 2218 2319 … … 2247 2348 2248 2349 if (!$external && $this->page_info['actual_catalog']['class'] != 'bo_people_catalog' && 2249 $this->page_info['actual_catalog']['class'] != 'bo_group_manager') 2350 $this->page_info['actual_catalog']['class'] != 'bo_group_manager' && 2351 $this->page_info['actual_catalog']['class'] != 'bo_shared_catalog_manager') 2250 2352 { 2251 2353 /* … … 2292 2394 2293 2395 if ($external || $this->page_info['actual_catalog']['class'] == 'bo_people_catalog' || 2294 $this->page_info['actual_catalog']['class'] == 'bo_group_manager') 2396 $this->page_info['actual_catalog']['class'] == 'bo_group_manager' || 2397 $this->page_info['actual_catalog']['class'] == 'bo_shared_catalog_manager') 2295 2398 { 2296 2399 // Get only this attributes: dn, cn for external catalogs, … … 2324 2427 foreach ($ids as $e_info) 2325 2428 { 2326 $ids_f[] = $e_info[$id_field]; 2429 if($this->page_info['actual_catalog']['class'] != 'bo_shared_catalog_manager') 2430 $ids_f[] = $e_info[$id_field]; 2431 else 2432 $ids_f[] = array(0=>$e_info[$id_field],1=>$e_info['perms']); 2327 2433 } 2328 2434
Note: See TracChangeset
for help on using the changeset viewer.