Changeset 5889 for sandbox/webservice/api/json-rpc/Catalog.php
- Timestamp:
- 04/05/12 17:22:21 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/webservice/api/json-rpc/Catalog.php
r5722 r5889 4 4 5 5 class Catalog extends Expresso { 6 var $userPrefs; 7 var $userId; 8 9 public function __construct(){ 10 $this->userPrefs = $this->getUserPreferences(); 11 } 12 13 private function getUserId(){ 14 $userProfile = $this->getUserProfile(); 15 return $userProfile['account_id']; 16 } 6 17 7 18 public function getUserContacts($params){ … … 9 20 $search = ""; 10 21 if($params) { 11 12 22 $search = trim($params['search']); 13 if($params['contactID'] > 0){ 14 $query_contact = 'A.id_contact='.$params['contactID'].' and'; 15 } 16 elseif($search != "") { 23 if($search != "") { 17 24 $search = mb_convert_encoding($search,"ISO_8859-1", "UTF8"); 18 25 } 19 26 20 if(($search || $params['contactID']) && $params['contactType'] == 2){ 21 return $this->getGlobalContacts($search, $params['contactID']); 27 if($params['contactID'] > 0 && $params['contactType'] == 1){ 28 $query_contact = 'A.id_contact='.$params['contactID'].' and'; 29 } 30 elseif($params['contactType'] == 2){ 31 if($this->userPrefs['search_characters_number'] <= strlen($search)) 32 return $this->getGlobalContacts($search, $params['contactID']); 33 else{ 34 $this-> error = str_replace("%1",$this->userPrefs['search_characters_number'],"Your search argument must be longer than %1 characters."); 35 return $this->getResponse(); 36 } 22 37 } 23 38 }
Note: See TracChangeset
for help on using the changeset viewer.