mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-29 18:26:05 +00:00
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:
parent
c2f309981d
commit
26275a5fab
@ -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) ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user