From 6fde93d15bba3bc0fd950b08de9f94d63fad16fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lehrke?= Date: Sun, 12 Sep 2010 12:44:22 +0000 Subject: [PATCH] Improved ctag for CalDAV --- calendar/inc/class.calendar_groupdav.inc.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/calendar/inc/class.calendar_groupdav.inc.php b/calendar/inc/class.calendar_groupdav.inc.php index f2c46a5904..f063b69da1 100644 --- a/calendar/inc/class.calendar_groupdav.inc.php +++ b/calendar/inc/class.calendar_groupdav.inc.php @@ -763,9 +763,7 @@ error_log(__METHOD__."($path,,".array2string($start).") filter=".array2string($f 'enum_recuring' => false, 'daywise' => false, 'date_format' => 'server', - 'cols' => array('cal_modified'), - 'order' => 'cal_modified DESC', - 'num_rows' => 1, + 'cols' => array('egw_cal.cal_id', 'cal_start', 'cal_modified'), ); if ($path == '/calendar/') @@ -777,18 +775,17 @@ error_log(__METHOD__."($path,,".array2string($start).") filter=".array2string($f $filter['filter'] = 'default'; // not rejected } + $ctag = 0; + if (($events =& $this->bo->search($filter))) { foreach ($events as $event) { - $ctag = $event['cal_modified']; + $modified = max($this->bo->so->max_user_modified($event['cal_id']), $event['cal_modified']); + if ($ctag < $modified) $ctag = $modified; break; } } - else - { - $ctag = '0'; - } if ($this->debug > 1) error_log(__FILE__.'['.__LINE__.'] '.__METHOD__. "($path)[$user] = $ctag");