Changeset 5694
- Timestamp:
- 03/09/12 17:26:41 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/webservice/api/json-rpc/Catalog.php
r5691 r5694 10 10 $query_contact = 'A.id_contact='.$params['contactID'].' and'; 11 11 12 $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, '.12 $query = 'select B.id_typeof_contact_connection, A.photo, 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, '. 13 13 'phpgw_cc_contact_conns B, phpgw_cc_connections C where A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 14 ' and B.id_typeof_contact_connection = 1and '.$query_contact.' A.id_owner='.$this -> getUserId().' group by '.15 ' 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)';14 ' and '.$query_contact.' A.id_owner='.$this -> getUserId().' group by '. 15 ' B.id_typeof_contact_connection, A.photo, 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)'; 16 16 17 17 if (!$this->getDb()->query($query)) … … 22 22 $row = $this->getDb()->row(); 23 23 $id = $row['id_contact']; 24 $contactType = ($row['id_typeof_contact_connection'] == 1 ? 'contactPhones' : 'contactMails'); 24 25 25 26 if($contacts[$id] != null){ 26 $contacts[$id][ 'MailAddress'][] = $row['connection_value'];27 $contacts[$id][$contactType][] = $row['connection_value']; 27 28 } 28 29 else{ 29 30 $contacts[$id] = array( 30 31 'contactID' => $row['id_contact'], 31 'MailAddress' => array($row['connection_value']), 32 'AliasName' => ($row['alias'] != null ? mb_convert_encoding($row['alias'],"UTF8", "ISO_8859-1") : ""), 33 'FirstName' => ($row['given_names'] != null ? mb_convert_encoding($row['given_names'],"UTF8", "ISO_8859-1") : ""), 34 'LastName' => ($row['family_names'] != null ? mb_convert_encoding($row['family_names'],"UTF8", "ISO_8859-1") : ""), 35 'FullName' => ($row['names_ordered'] != null ? mb_convert_encoding($row['names_ordered'],"UTF8", "ISO_8859-1") : ""), 36 'BirthDate' => ($row['birthdate'] != null ? $row['birthdate'] : ""), 37 'Notes' => ($row['notes'] != null ? mb_convert_encoding($row['notes'],"UTF8", "ISO_8859-1") : "") 32 $contactType => array($row['connection_value']), 33 'contactAlias' => ($row['alias'] != null ? mb_convert_encoding($row['alias'],"UTF8", "ISO_8859-1") : ""), 34 'contactFirstName' => ($row['given_names'] != null ? mb_convert_encoding($row['given_names'],"UTF8", "ISO_8859-1") : ""), 35 'contactLastName' => ($row['family_names'] != null ? mb_convert_encoding($row['family_names'],"UTF8", "ISO_8859-1") : ""), 36 'contactFullName' => ($row['names_ordered'] != null ? mb_convert_encoding($row['names_ordered'],"UTF8", "ISO_8859-1") : ""), 37 'contactBirthDate' => ($row['birthdate'] != null ? $row['birthdate'] : ""), 38 'contactNotes' => ($row['notes'] != null ? mb_convert_encoding($row['notes'],"UTF8", "ISO_8859-1") : ""), 39 'contactHasImagePicture' => ($row['photo'] != null ? 1 : 0), 38 40 ); 39 41 } … … 56 58 $contact[] = array( 57 59 'contactID' => $row['id_contact'], 58 ' ImagePicture' => ($row['photo'] != null ? base64_encode($row['photo']) : "")60 'contactImagePicture' => ($row['photo'] != null ? base64_encode($row['photo']) : "") 59 61 ); 60 62 }
Note: See TracChangeset
for help on using the changeset viewer.