fix of major todo synchronization issue if $c->hide_older_than option is set

todo without start date was never synced
This commit is contained in:
Ján Máté 2013-09-20 23:09:43 +12:00 committed by Andrew Ruthven
parent c2f309981d
commit 26275a5fab
2 changed files with 2 additions and 2 deletions

View File

@ -192,7 +192,7 @@ function get_collection_contents( $depth, $collection, $parent_path = null ) {
}
if ( isset($c->hide_older_than) && intval($c->hide_older_than > 0) ) {
$time_limit_clause = " AND calendar_item.dtstart > (now() - interval '".intval($c->hide_older_than)." days') ";
$time_limit_clause = " AND (CASE WHEN caldav_data.caldav_type<>'VEVENT' OR calendar_item.dtstart IS NULL THEN true ELSE calendar_item.dtstart > (now() - interval '".intval($c->hide_older_than)." days') END) ";
}
}

View File

@ -339,7 +339,7 @@ if ( isset($c->hide_TODO) && $c->hide_TODO && ! $target_collection->HavePrivileg
}
if ( isset($c->hide_older_than) && intval($c->hide_older_than > 0) ) {
$where .= " AND calendar_item.dtstart > (now() - interval '".intval($c->hide_older_than)." days') ";
$where .= " AND (CASE WHEN caldav_data.caldav_type<>'VEVENT' OR calendar_item.dtstart IS NULL THEN true ELSE calendar_item.dtstart > (now() - interval '".intval($c->hide_older_than)." days') END) ";
}
$sql = 'SELECT '.$distinct.' caldav_data.*,calendar_item.* FROM collection INNER JOIN caldav_data USING(collection_id) INNER JOIN calendar_item USING(dav_id) '. $where;