Changeset 7465 for sandbox


Ignore:
Timestamp:
10/25/12 13:53:50 (11 years ago)
Author:
alexandrecorreia
Message:

Ticket #2507 - Melhorias dos resources REST, servidor e calendar.

Location:
sandbox/webservice/api/adapters
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sandbox/webservice/api/adapters/CalendarAdapter.php

    r6423 r7465  
    1616        protected function getTimezoneOffset(){ 
    1717                return $GLOBALS['phpgw']->datetime->tz_offset; 
     18         
     19        } 
     20 
     21        protected function getEvents( $month, $year ) 
     22        { 
     23                $bo = CreateObject('calendar.bocalendar',1); 
     24                 
     25                $events = $bo->store_to_cache( 
     26                                        Array( 
     27                                                'syear' => $year, 
     28                                                'smonth'=> $month, 
     29                                                'sday'  => 1 
     30                                        ) 
     31                                ); 
     32                 
     33                return $events; 
     34        } 
     35         
     36        protected function makeTime($event) 
     37        { 
     38                $bo = CreateObject('calendar.bocalendar',1); 
     39                 
     40                return $bo->maketime($event); 
    1841        } 
    1942} 
  • sandbox/webservice/api/adapters/CatalogAdapter.php

    r6241 r7465  
    113113                // Force ldap close 
    114114                ldap_close($this->getLdapCatalog()->ds);                 
    115                 $result = array ('contacts' => $contacts); 
    116                 $this->setResult($result); 
    117                 return $this->getResponse(); 
     115                if( count($contacts) ) 
     116                { 
     117                        $result = array ('contacts' => $contacts); 
     118                        $this->setResult($result); 
     119                        return $this->getResponse(); 
     120                } 
     121                else 
     122                { 
     123                        Errors::runException("CATALOG_NO_RESULTS"); 
     124                } 
    118125        } 
    119126} 
Note: See TracChangeset for help on using the changeset viewer.