- Timestamp:
- 05/07/12 11:25:28 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/calendar/interceptors/DBMapping.php
r6111 r6114 117 117 } 118 118 119 $sql = ' SELECT calendar_object.id as id ,calendar_object.cal_uid as "uid", calendar_object.type_id as "type", calendar_object.dtstart as "startTime", calendar_object.summary as "summary", calendar_object.description as "description", calendar_object.dtend as "endTime" , calendar_object.location as "location", calendar_object.allday as "allDay", calendar_object.transp as "transparent", calendar_object.class_id as "class", calendar_object.repeat as "repeat", calendar_object.range_start as "rangeStart",calendar_object.range_end as "rangeEnd", calendar_object.last_update as "lastUpdate", calendar_object.dtstamp as "dtstamp", calendar_object.sequence as "sequence", calendar_object.tzid as "timezone" ,calendar_to_calendar_object.calendar_id as calendar FROM calendar_to_calendar_object , calendar_object WHERE (range_start >= \'' . $start . '\' AND range_end <= \'' . $end . '\' AND calendar_to_calendar_object.calendar_id IN (\'' . implode('\',\'', $criteria['filter'][3][2]) . '\')) AND calendar_to_calendar_ 120 object.calendar_object_id = calendar_object.id' . (!empty($ids) ? ' AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\')' : ''); 119 $sql = ' SELECT calendar_object.id as id ,calendar_object.cal_uid as "uid", calendar_object.type_id as "type", calendar_object.dtstart as "startTime", calendar_object.summary as "summary", calendar_object.description as "description", calendar_object.dtend as "endTime" , calendar_object.location as "location", calendar_object.allday as "allDay", calendar_object.transp as "transparent", calendar_object.class_id as "class", calendar_object.repeat as "repeat", calendar_object.range_start as "rangeStart",calendar_object.range_end as "rangeEnd", calendar_object.last_update as "lastUpdate", calendar_object.dtstamp as "dtstamp", calendar_object.sequence as "sequence", calendar_object.tzid as "timezone" ,calendar_to_calendar_object.calendar_id as calendar FROM calendar_to_calendar_object , calendar_object WHERE (range_start >= \'' . $start . '\' AND range_end <= \'' . $end . '\' AND calendar_to_calendar_object.calendar_id IN (\'' . implode('\',\'', $criteria['filter'][3][2]) . '\')) AND calendar_to_calendar_object.calendar_object_id = calendar_object.id' . (!empty($ids) ? ' AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\')' : ''); 121 120 122 121 $params = Controller::service('PostgreSQL')->execResultSql($sql); … … 530 529 } 531 530 532 //TODO: Remover apos suporte a deepness na api 533 public function deepnessReadEvent(&$uri, &$result, &$criteria, $original) { 534 535 if (isset($original['criteria']['deepness']) && $original['criteria']['deepness'] != 0) { 536 if (isset($result['id'])) { 537 $participants = Controller::find(array('concept' => 'participant'), false, array('filter' => array('=', 'schedulable', $result['id']))); 538 if (is_array($participants)) 539 foreach ($participants as $ii => $vv) { 540 if ($vv['isExternal'] == 1) 541 $participants[$ii]['user'] = Controller::read(array('concept' => 'user', 'id' => $vv['user'], 'service' => 'PostgreSQL')); 542 else 543 $participants[$ii]['user'] = Controller::read(array('concept' => 'user', 'id' => $vv['user'])); 544 545 if ($participants[$ii]['user']['id'] == Config::me('uidNumber')) 546 $participants[$ii]['alarms'] = Controller::find(array('concept' => 'alarm'), null, array('filter' => array('AND', array('=', 'participant', $vv['id']), array('=', 'schedulable', $result['id'])))); 547 } 548 $repeat = Controller::find(array('concept' => 'repeat'), false, array('filter' => array('=', 'schedulable', $result['id']))); 549 if (is_array($repeat)) 550 $result['repeat'] = $repeat[0]; 551 552 $result['participants'] = $participants; 553 } 554 } 555 } 531 //TODO: Remover apos suporte a deepness na api 532 public function deepnessReadParticipant( &$uri , &$result , &$criteria , $original ){ 533 534 if(isset($original['criteria']['deepness']) && $original['criteria']['deepness'] != 0) 535 { 536 if(isset($result['id'])) 537 { 538 $result['user'] = Controller::read( array( 'concept' => 'user' , 'id' => $result['user'] , 'service' => ( $result['isExternal'] == 1 ? 'PostgreSQL' : 'OpenLDAP' ) ) ); 539 540 if($result['user']['id'] == Config::me('uidNumber')) 541 $result['alarms'] = Controller::find( array( 'concept' => 'alarm' ) , null , array('filter' => array('=', 'participant' ,$result['id'] ) ) ); 542 } 543 } 544 545 } 556 546 557 547 //TODO: Remover apos suporte a deepness na api
Note: See TracChangeset
for help on using the changeset viewer.