- Timestamp:
- 05/23/08 17:10:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/inc/class.bo_catalog_group_catalog.inc.php
r284 r285 20 20 21 21 include_once('class.abo_catalog.inc.php'); 22 22 23 23 class bo_catalog_group_catalog extends abo_catalog 24 24 { 25 26 25 var $external; 27 28 26 var $fields = array( 29 27 'id_contact' => true, … … 40 38 'pgp_key' => true, 41 39 'notes' => true, 42 40 43 41 /* Array fields */ 44 42 'companies' => true, … … 47 45 'connections' => true 48 46 ); 49 50 /*! 51 47 48 /*! 49 52 50 @function bo_people_catalog 53 51 @abstract Constructor 54 52 @author Raphael Derosso Pereira 55 53 56 54 */ 57 function bo_catalog_group_catalog(& $bo_contactcenter, & $catalog, $external = 0 )55 function bo_catalog_group_catalog(& $bo_contactcenter, & $catalog, $external = 0 ) 58 56 { 59 57 $this->bo_contactcenter = & $bo_contactcenter; … … 61 59 $this->external = $external; 62 60 } 63 61 64 62 65 63 /*! … … 71 69 72 70 @param SEE class bo_contactcenter for usage 73 71 74 72 */ 75 73 function find($what, $rules, $other) … … 77 75 if ($ldap_info = $this->catalog['ldap']) 78 76 { 79 80 77 $meta_catalog =& CreateObject('contactcenter.bo_global_ldap_catalog',$ldap_info['id_source'], $ldap_info['context'], $this->external); 81 78 return $meta_catalog->find($what, $rules, $other); 82 79 } 83 80 84 81 $results = array(); 85 82 86 83 reset($this->catalog); 87 84 while(list(, $new_catalog) = each($this->catalog['sub_branch'])) … … 90 87 //echo 'Setting catalog: <b>'.$new_catalog['name'].'</b><br>'; 91 88 $new_catalog = $this->bo_contactcenter->set_catalog($new_catalog); 92 89 93 90 //if($new_catalog) echo 'Setado corretamente!<br><br>'; else echo 'Erro ao setar<br><br>'; 94 91 95 92 if ($new_catalog['type'] === 'empty') 96 93 { 97 94 continue; 98 95 } 99 96 100 97 $temp_res = $this->bo_contactcenter->catalog->find($what, $rules, $other); 101 98 if (is_array($temp_res) and count($temp_res)) … … 111 108 return $result; 112 109 } 113 114 /*! 115 110 111 /*! 112 116 113 @function get_single_entry 117 114 @abstract Returns all information requested about one contact 118 115 @author Raphael Derosso Pereira 119 116 120 117 @param integer $id_contact The contact ID 121 118 @param array $fields The array returned by get_fields whith true 122 119 on the fields to be taken. 123 120 124 121 */ 125 122 function get_single_entry ( $id_contact, $fields ) 126 { 127 if (!is_array($fields)) 128 { 129 if (is_object($GLOBALS['phpgw']->log)) 123 { 124 if (!is_array($fields)) 125 { 126 if (is_object($GLOBALS['phpgw']->log)) 130 127 { 131 128 $GLOBALS['phpgw']->log->message(array( … … 133 130 'line' => __LINE__, 134 131 'file' => __FILE__)); 135 132 136 133 $GLOBALS['phpgw']->log->commit(); 137 134 } 138 else 135 else 139 136 { 140 137 exit('Argument Error on: <br>File:'.__FILE__.'<br>Line:'.__LINE__.'<br>'); 141 138 } 142 139 } 143 140 144 141 $contact_array = $this->get_multiple_entries(array($id_contact), $fields); 145 142 146 143 if (!count($contact_array)) 147 144 { … … 153 150 else 154 151 $contact_data = $contact_array[$id_contact]; 155 152 156 153 if (!is_array($contact_data)) 157 154 { 158 155 return false; 159 156 } 160 157 161 158 return $contact_data; 162 159 } 163 164 /*! 165 160 161 /*! 162 166 163 @function get_multiple_entries 167 164 @abstract Returns multiple Contacts data into one array … … 176 173 'sort' => <sort>, 177 174 'order_by' => <order by> 178 ); 179 175 ); 176 180 177 */ 181 178 function get_multiple_entries ( $id_contacts, $fields, $other_data = false ) … … 183 180 if (!is_array($id_contacts) or !is_array($fields) or ($other_data != false and !is_array($other_data))) 184 181 { 185 if (is_object($GLOBALS['phpgw']->log)) 182 if (is_object($GLOBALS['phpgw']->log)) 186 183 { 187 184 $GLOBALS['phpgw']->log->message(array( … … 189 186 'line' => __LINE__, 190 187 'file' => __FILE__)); 191 188 192 189 $GLOBALS['phpgw']->log->commit(); 193 190 } … … 196 193 } 197 194 } 198 195 199 196 $contacts = array(); 200 197 201 198 if ($other_data) 202 199 { 203 200 //TODO 204 201 } 205 206 //error_log("bo_ldap_catalog_group_catalog->get_multiple_entries \n", 3, '/var/www/teste.log'); 207 202 208 203 /* First check if this is a LDAP Catalog Group. In this case, just leave the 209 204 * subtree search for the LDAP server … … 214 209 return $meta_catalog->get_multiple_entries($id_contacts, $fields, $other_data); 215 210 } 216 211 217 212 /* Search for the catalog of the first entry and try to get all ids from that 218 213 * catalog. Repeat to the ones not found until there's none missing or no more … … 226 221 $this->bo_contactcenter->set_catalog($branch); 227 222 $contacts += $this->bo_contactcenter->catalog->get_multiple_entries($id_contacts, $fields, $other_data); 228 223 229 224 reset($contacts); 230 225 while (list($id) = each($contacts)) … … 243 238 244 239 $this->bo_contactcenter->set_catalog($this->catalog); 245 240 246 241 return $contacts; 247 242 } 248 243 249 244 function get_all_entries_ids () 250 245 { … … 252 247 return null; 253 248 } 254 249 255 250 /*********************************************************************\ 256 251 * Methods to get general fields * 257 252 \*********************************************************************/ 258 253 259 254 /*********************************************************************\ 260 255 * Methods to Include Data *
Note: See TracChangeset
for help on using the changeset viewer.