Changeset 880 for trunk/contactcenter/inc/class.ui_data.inc.php
- Timestamp:
- 05/20/09 16:08:06 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/inc/class.ui_data.inc.php
r752 r880 296 296 case 'get_catalog_participants_list': 297 297 echo serialize($this->get_catalog_participants_list($_POST['id'])); 298 return; 299 300 case 'get_catalog_participants_group': 301 echo serialize($this->get_catalog_participants_group($_POST['id'])); 298 302 return; 299 303 … … 701 705 * Restrict the returned contacts in a "first letter" search 702 706 * to objectClass = phpgwAccount, must have attibute phpgwAccountStatus, 703 * phpgwAccountVisible != -1 and objectClass = inetOrgPerson707 * phpgwAccountVisible != -1 704 708 */ 705 709 1 => array( … … 717 721 'type' => '!=', 718 722 'value' => '-1' 719 ), 720 4 => array( 721 'field' => 'contact.object_class', 722 'type' => '=', 723 'value' => 'inetOrgPerson' 724 ), 723 ) 725 724 ); 726 725 // If not external catalog get only phpgwAccountType = u ou l … … 745 744 'type' => '=', 746 745 'value' => 'l' 746 ), 747 3 => array( 748 'field' => 'contact.account_type', 749 'type' => '=', 750 'value' => 'g' 747 751 ) 748 752 ) … … 756 760 * Restrict the returned contacts in a "first number" search 757 761 * to objectClass = phpgwAccount, must have attibute phpgwAccountStatus, 758 * phpgwAccountVisible != -1 and objectClass = inetOrgPerson762 * phpgwAccountVisible != -1 759 763 */ 760 764 0 => array( … … 774 778 ), 775 779 3 => array( 776 'field' => 'contact.object_class',777 'type' => '=',778 'value' => 'inetOrgPerson'779 ),780 4 => array(781 780 'type' => 'branch', 782 781 'value' => 'OR', … … 852 851 'value' => 'i' 853 852 ), 854 /*1 => array(855 'field' => 'contact.account_type',856 'type' => '=',857 'value' => 'g'858 ),*/859 853 2 => array( 860 854 'field' => 'contact.account_type', 861 855 'type' => '=', 862 856 'value' => 'l' 857 ), 858 3 => array( 859 'field' => 'contact.account_type', 860 'type' => '=', 861 'value' => 'g' 863 862 ) 863 864 864 ) 865 865 ); … … 1257 1257 $final[3][$i][6] = $ids[$i]; 1258 1258 1259 // If contact is a public list , then load the forwarding addresses.1260 if($contact['account_type'][0] == 'l' )1261 $final[3][$i][7] = array();1259 // If contact is a public list or a group, then load the forwarding addresses. 1260 if($contact['account_type'][0] == 'l' || $contact['account_type'][0] == 'g') 1261 $final[3][$i][7] = ($contact['account_type'][0] == 'l' ? 'list' : 'group'); 1262 1262 1263 1263 if($this->page_info['actual_catalog']['class']=='bo_shared_people_manager') { … … 2317 2317 /* 2318 2318 * Restrict the returned contacts search to objectClass = phpgwAccount, 2319 * must have attibute phpgwAccountStatus, phpgwAccountVisible != -1 and 2320 * objectClass = inetOrgPerson 2319 * must have attibute phpgwAccountStatus, phpgwAccountVisible != -1 2321 2320 */ 2322 2321 $rules = array( … … 2336 2335 'value' => '-1' 2337 2336 ), 2338 3 => array(2339 'field' => 'contact.object_class',2340 'type' => '=',2341 'value' => 'inetOrgPerson'2342 )2343 2337 ); 2344 2338 } … … 2762 2756 } 2763 2757 2758 function get_catalog_participants_group($id) 2759 { 2760 if(!$this->bo->catalog->src_info) { 2761 $ldap = CreateObject('contactcenter.bo_ldap_manager'); 2762 $this->bo->catalog->src_info = $ldap->srcs[1]; 2763 } 2764 $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true); 2765 $justThese = array("description","memberuid"); 2766 $sr = ldap_read($ds,$id, "objectClass=*",$justThese); 2767 $info = ldap_get_entries($ds, $sr); 2768 $member_uids = $info[0]['memberuid']; 2769 $contact['names_ordered'] = $info[0]['description']; 2770 $filter = ""; 2771 for($z = 0; $z < count($member_uids); $z++) { 2772 if($member_uids[$z]) 2773 $filter.="(uid=".$member_uids[$z].")"; 2774 } 2775 $array_participants = array(); 2776 if($filter) { 2777 $filter = "(|".$filter.")"; 2778 $dn=$this->bo->catalog->src_info['dn']; 2779 $justThese = array("cn","mail"); 2780 $sr = ldap_search($ds,$dn, $filter,$justThese); 2781 $info = ldap_get_entries($ds, $sr); 2782 for($z = 0; $z < $info['count']; $z++) { 2783 $participant = '<font color=\'DARKBLUE\'> "'.$info[$z]['cn'][0].'" <'.$info[$z]['mail'][0].'></font><br>'; 2784 $array_emails[$info[$z]['mail'][0]] = null; 2785 array_push($array_participants, $participant); 2786 } 2787 ldap_close($ds); 2788 } 2789 sort($array_participants); 2790 $innerHTML = ''; 2791 foreach($array_participants as $index => $participant){ 2792 $innerHTML .= $participant; 2793 } 2794 $return = array('size' => count($array_participants), 'names_ordered'=> $contact['names_ordered'], 'inner_html' => $innerHTML); 2795 echo serialize($return); 2796 } 2797 2764 2798 function get_catalog_participants_list($id) 2765 2799 { … … 2772 2806 $array_participants = array(); 2773 2807 $array_emails = array(); 2774 2808 2775 2809 $filter = null; 2776 2810 for($z = 0; $z < $contact['mail_forwarding_address']['count']; $z++) { … … 2789 2823 $this->bo->catalog->src_info = $ldap->srcs[1]; 2790 2824 } 2791 $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true); 2825 $ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true); 2826 2792 2827 $dn=$this->bo->catalog->src_info['dn']; 2793 2828 $justThese = array("cn","mail");
Note: See TracChangeset
for help on using the changeset viewer.