- Timestamp:
- 06/22/12 17:32:11 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4/prototype/modules/calendar/interceptors/DBMapping.php
r6584 r6588 147 147 .'(range_start >= \'' . $start[1] . '\' AND range_start <= \'' . $end[1] . '\') OR ' 148 148 .'(range_start <= \'' . $start[2] . '\' AND range_end >= \'' . $end[2] . '\')) ' 149 .(!empty($ids) ? ' ' .'AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\') ' : ' '); 150 149 .(!empty($ids) ? ' ' .'AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\') ' : ' ') 150 .'AND calendar_object.dtstart NOT IN (SELECT calendar_repeat_occurrence.occurrence from calendar_repeat_occurrence, ' 151 .'calendar_repeat where (calendar_repeat_occurrence.repeat_id = calendar_repeat.id) ' 152 .'AND (calendar_repeat.object_id = calendar_object.id))'; 151 153 152 154 $params = Controller::service('PostgreSQL')->execResultSql($sql.$where); … … 204 206 //Recurepa as execeções anteriores caso exista 205 207 if (isset($lastExceptions) && count($lastExceptions) && $lastExceptions) 206 foreach ($lastExceptions as $ key => $value)207 array_push($exceptions, $lastExceptions[$key]['occurrence']);208 foreach ($lastExceptions as $value) 209 array_push($exceptions, $value['occurrence']); 208 210 209 211 $params = array_diff(self::decodeRepeat($repeat, $ranges[0]['rangeStart'], $ranges[0]['rangeEnd']), $exceptions); … … 213 215 if (!empty($params)) 214 216 Controller::service('PostgreSQL')->execResultSql("INSERT INTO calendar_repeat_occurrence(repeat_id,exception,occurrence)VALUES('" . $id . "','0','" . implode("'),('" . $id . "','0','", $params) . "')" . ( empty($exceptions) ? "" : ",('" . $id . "','1','" . implode("'),('" . $id . "','1','", $exceptions) . "')" )); 215 } 217 else if(!empty($exceptions)) 218 Controller::service('PostgreSQL')->execResultSql("INSERT INTO calendar_repeat_occurrence(repeat_id,exception,occurrence)VALUES ('" . $id . "','1','" . implode("'),('" . $id . "','1','", $exceptions) . "')" ); 219 } 216 220 217 221 public function checkOccurrences($start, $end, $calendarIds) {
Note: See TracChangeset
for help on using the changeset viewer.