diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-06-11 17:13:20 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-06-11 17:13:20 +0200 |
commit | 2dd84373c15cd2f696aaf1ea51028cdcb9caba56 (patch) | |
tree | cc696ee8816fc4160e507ab91cdee2ad1aeb480a /apps/calendar/lib | |
parent | 24a1ab8c159170e9837d2aa6887035381e3b10e4 (diff) | |
download | nextcloud-server-2dd84373c15cd2f696aaf1ea51028cdcb9caba56.tar.gz nextcloud-server-2dd84373c15cd2f696aaf1ea51028cdcb9caba56.zip |
fix bug in OC_Calendar_Repeat
Diffstat (limited to 'apps/calendar/lib')
-rw-r--r-- | apps/calendar/lib/repeat.php | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/apps/calendar/lib/repeat.php b/apps/calendar/lib/repeat.php index f1323a9cb5e..585fc560085 100644 --- a/apps/calendar/lib/repeat.php +++ b/apps/calendar/lib/repeat.php @@ -34,7 +34,7 @@ class OC_Calendar_Repeat{ public static function get_inperiod($id, $from, $until){ $stmt = OCP\DB::prepare( 'SELECT * FROM *PREFIX*calendar_repeat WHERE eventid = ?' .' AND ((startdate >= ? AND startdate <= ?)' - .' OR (enddate >= ? AND enddate <= ?)'); + .' OR (enddate >= ? AND enddate <= ?))'); $result = $stmt->execute(array($id, $from, $until, $from, $until)); @@ -68,7 +68,7 @@ class OC_Calendar_Repeat{ public static function getcalendar_inperiod($id, $from, $until){ $stmt = OCP\DB::prepare( 'SELECT * FROM *PREFIX*calendar_repeat WHERE calid = ?' .' AND ((startdate >= ? AND startdate <= ?)' - .' OR (enddate >= ? AND enddate <= ?)'); + .' OR (enddate >= ? AND enddate <= ?))'); $result = $stmt->execute(array($id, $from, $until, $from, $until)); @@ -155,13 +155,28 @@ class OC_Calendar_Repeat{ * @return (bool) */ public static function is_cached($id){ - if(count(self::get($id)) === 1){ + if(count(self::get($id)) != 0){ return true; }else{ return false; } } /* + * @brief checks if an event is already cached in a specific period + * @param (int) id - id of the event + * @param (string) $from - start for period in UTC + * @param (string) $until - end for period in UTC + * @return (bool) + */ + public static function is_cached_inperiod($id, $start, $end){ + if(count(self::get_inperiod($id, $start, $end)) != 0){ + return true; + }else{ + return false; + } + + } + /* * @brief checks if a whole calendar is already cached * @param (int) id - id of the calendar * @return (bool) |