Changeset 5681 for sandbox/webservice/api/json-rpc/Catalog.php
- Timestamp:
- 03/08/12 18:44:26 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/webservice/api/json-rpc/Catalog.php
r5595 r5681 4 4 5 5 class Catalog extends Expresso { 6 var $ldap;7 var $db;8 9 private function getLdap(){10 if($this->ldap == null) {11 12 }13 14 return $this->ldap;15 }16 17 private function getDb(){18 if($this->ldap == null) {19 20 }21 return $this->db;22 }23 24 6 25 7 public function getUserContacts($params){ 26 8 if($this->isLoggedIn($params)) { 9 $query = 'select A.id_contact, A.alias, A.given_names, A.family_names, A.names_ordered, A.birthdate, A.notes, C.connection_value from phpgw_cc_contact A, '. 10 'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 11 'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 12 'and B.id_typeof_contact_connection = 1 and A.id_owner='.$this -> getUserId().' group by '. 13 ' A.id_contact, A.alias, A.given_names, A.family_names,A.names_ordered,A.birthdate, A.notes,C.connection_value order by lower(A.names_ordered)'; 27 14 15 if (!$this->getDb()->query($query)) 16 return false; 17 18 $contacts = array(); 19 while($this->getDb()->next_record()) { 20 $row = $this->getDb()->row(); 21 $contacts[] = array( 22 'contactID' => $row['id_contact'], 23 'MailAddress' => $row['connection_value'], 24 'AliasName' => $row['alias'], 25 'FirstName' => $row['given_names'], 26 'LastName' => $row['family_names'], 27 'FullName' => $row['names_ordered'], 28 'BirthDate' => $row['birthdate'], 29 'Notes' => $row['notes'], 30 // 'ImagePicture' => null 31 ); 32 33 } 34 $this->result = array ('contacts' => $contacts); 28 35 } 29 30 $this->result = array ( 31 'contacts' => $contacts 32 ); 33 36 34 37 return $this->getResponse(); 35 38 } … … 38 41 39 42 if($this->isLoggedIn($params)) { 40 43 $this->result = array ('contacts' => $contacts); 41 44 } 42 43 $this->result = array (44 'contacts' => $contacts45 );46 47 45 return $this->getResponse(); 48 46 }
Note: See TracChangeset
for help on using the changeset viewer.