Ignore:
Timestamp:
02/05/13 15:03:49 (11 years ago)
Author:
alexandrecorreia
Message:

Ticket #2507 - Correções dentro da API do webservice do expresso

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/webservice/api/rest/catalog/ContactPictureResource.php

    r6274 r7855  
    1010                        $contact = array(); 
    1111                        $contactID = $this->getParam('contactID'); 
     12 
    1213                        // User Contact 
    13                         if($this->getParam('contactType') == 1 && $contactID != null){ 
    14                                 $query = 'select A.id_contact, A.photo from phpgw_cc_contact A where A.id_contact='.$contactID.' and A.id_owner='.$this -> getUserId(); 
    15                                 if (!$this->getDb()->query($query)) 
    16                                         return false; 
    17                                 if($this->getDb()->next_record()) { 
    18                                         $row = $this->getDb()->row(); 
    19                                         if($row['photo'] != null) { 
    20                                                 $contact[] = array( 
    21                                                                 'contactID'             => $row['id_contact'], 
    22                                                                 'contactImagePicture'   => ($row['photo'] != null ? base64_encode($row['photo']) : "") 
    23                                                 ); 
    24                                         } 
    25                                 } 
    26                         } 
     14            if($this->getParam('contactType') == 1 && $contactID != null){ 
     15 
     16                $query = "select A.id_contact, A.photo from phpgw_cc_contact A where A.id_contact= ? and A.id_owner = ? "; 
     17 
     18                $result = $this->getDb()->Link_ID->query($query, array($contactID,$this->getUserId())); 
     19 
     20                if ($result) { 
     21 
     22                    while($row = $result->fetchRow()) { 
     23                        if($row['photo'] != null) { 
     24                            $contact[] = array( 
     25                                'contactID'     => $row['id_contact'], 
     26                                'contactImagePicture'   => ($row['photo'] != null ? base64_encode($row['photo']) : "") 
     27                            ); 
     28                        } 
     29                    } 
     30    
     31                } 
     32            } 
     33 
    2734                        // Global Catalog 
    2835                        elseif($this->getParam('contactType') == 2){ 
Note: See TracChangeset for help on using the changeset viewer.