Changeset 6160 for trunk/prototype/modules
- Timestamp:
- 05/10/12 17:40:45 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/calendar/interceptors/DBMapping.php
r6151 r6160 118 118 $occ = array(); 119 119 120 if ($occurrences = self::checkOccurrences($start[0], $end[0] ))120 if ($occurrences = self::checkOccurrences($start[0], $end[0], $criteria['filter'][2][2])) 121 121 foreach ($occurrences as $id => $occurrence) { 122 122 $ids[] = $id; … … 143 143 .'AND calendar_object.id NOT IN (\'' . implode('\',\'', $ids) . '\')' : ''); 144 144 145 145 146 $params = Controller::service('PostgreSQL')->execResultSql($sql); 146 147 … … 209 210 } 210 211 211 public function checkOccurrences($start, $end ) {212 public function checkOccurrences($start, $end, $calendarIds) { 212 213 213 214 $ranges = Controller::find(array('concept' => 'repeatRange'), array('rangeStart', 'rangeEnd'), array('filter' => array('=', 'user', Config::me("uidNumber")))); … … 224 225 } 225 226 226 $repeats = self::findRepeats(); 227 227 $repeats = self::findRepeats($calendarIds); 228 228 if (!is_array($repeats) || empty($repeats)) 229 229 return( false ); … … 302 302 } 303 303 304 public static function findRepeats( ) {305 return Controller::service('PostgreSQL')->execResultSql('SELECT calendar_repeat.wkst as "wkst", calendar_repeat.byweekno as "byweekno", calendar_repeat.byminute as "byminute", calendar_repeat.bysecond as "bysecond", calendar_repeat.byyearday as "byyearday", calendar_repeat.bymonthday as "bymonthday", calendar_repeat.bysetpos as "bysetpos", calendar_repeat.byday as "byday", calendar_repeat.byhour as "byhour", calendar_repeat.interval as "interval", calendar_repeat.frequency as "frequency", calendar_repeat.until as "endTime", calendar_repeat.id as "id", calendar_repeat.count as "count", calendar_repeat.dtstart as "startTime" FROM calendar_repeat, calendar_ participant WHERE calendar_repeat.object_id = calendar_participant.object_id AND calendar_participant.user_info_id = \'' . Config::me('uidNumber') . '\'');304 public static function findRepeats($ids) { 305 return Controller::service('PostgreSQL')->execResultSql('SELECT calendar_repeat.wkst as "wkst", calendar_repeat.byweekno as "byweekno", calendar_repeat.byminute as "byminute", calendar_repeat.bysecond as "bysecond", calendar_repeat.byyearday as "byyearday", calendar_repeat.bymonthday as "bymonthday", calendar_repeat.bysetpos as "bysetpos", calendar_repeat.byday as "byday", calendar_repeat.byhour as "byhour", calendar_repeat.interval as "interval", calendar_repeat.frequency as "frequency", calendar_repeat.until as "endTime", calendar_repeat.id as "id", calendar_repeat.count as "count", calendar_repeat.dtstart as "startTime" FROM calendar_repeat, calendar_to_calendar_object WHERE calendar_repeat.object_id = calendar_to_calendar_object.calendar_object_id AND calendar_to_calendar_object.calendar_id IN (\'' . implode('\',\'', $ids) . '\')'); 306 306 } 307 307
Note: See TracChangeset
for help on using the changeset viewer.