source: sandbox/webservice/api/adapters/CalendarAdapter.php @ 7489

Revision 7489, 752 bytes checked in by alexandrecorreia, 11 years ago (diff)

Ticket #2507 - Emparelhando os codigos do servidor de produção com o sandbox.

  • Property svn:executable set to *
RevLine 
[6423]1<?php
2
3class CalendarAdapter extends ExpressoAdapter {
4        public function __construct($id){
5                parent::__construct($id);
6        }
7
8        protected function getUserId(){
9                return $GLOBALS['phpgw_info']['user']['account_id'];
10        }
11
12        protected function getDb(){
13                return $GLOBALS['phpgw']->db;
14        }
15
16        protected function getTimezoneOffset(){
17                return $GLOBALS['phpgw']->datetime->tz_offset;
[7465]18       
[6423]19        }
[7465]20
[7489]21        protected function getEvents($month, $year)
[7465]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);
41        }
[6423]42}
Note: See TracBrowser for help on using the repository browser.