Changeset 6191
- Timestamp:
- 05/15/12 14:52:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/webservice/api/rest/catalog/ContactsResource.php
r6165 r6191 8 8 if($this-> isLoggedIn()) 9 9 { 10 $search = "";11 10 12 11 if($this->getParams()) { 13 12 $search = trim($this->getParam('search')); 13 $search = ($search ? mb_convert_encoding($search,"ISO_8859-1", "UTF8") : ""); 14 14 15 if($search != "") { 16 $search = mb_convert_encoding($search,"ISO_8859-1", "UTF8"); 17 } 18 19 if($this->getParam('contactID') > 0 && $this->getParam('contactType') == 1){ 20 $query_contact = 'A.id_contact='.$this->getParam('contactID').' and'; 15 if($this->getParam('contactType') == 1) { 16 if($search != "") { 17 $query_contact = "(A.alias ilike '%$search%' or A.names_ordered ilike '%$search%' or C.connection_value ilike '%$search%') and"; 18 } 19 elseif($this->getParam('contactID') > 0){ 20 $query_contact = 'A.id_contact='.$this->getParam('contactID').' and'; 21 } 21 22 } 22 23 elseif($this->getParam('contactType') == 2){ … … 58 59 'contactHasImagePicture' => ($row['photo'] != null ? 1 : 0), 59 60 ); 60 if($search != null &&61 stristr($contacts[$id]['contactAlias'], $search) == null &&62 stristr($contacts[$id]['contactFirstName'], $search) == null &&63 stristr($contacts[$id]['contactLastName'], $search) == null &&64 stristr($contacts[$id]['contactFullName'], $search) == null &&65 stristr($contacts[$id]['contactBirthDate'], $search) == null &&66 stristr($contacts[$id]['contactNotes'], $search) == null){67 unset($contacts[$id]);68 }69 61 } 70 62 }
Note: See TracChangeset
for help on using the changeset viewer.