mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-04-19 14:10:14 +00:00
Use first_instance_start / last_instance_end to filter freebusy queries
This commit is contained in:
parent
a2b393317d
commit
4f06aeec10
@ -20,7 +20,10 @@ function get_freebusy( $path_match, $range_start, $range_end, $bin_privs = null
|
||||
}
|
||||
$params = array( ':path_match' => $path_match, ':start' => $range_start->UTC(), ':end' => $range_end->UTC() );
|
||||
$where = ' WHERE caldav_data.dav_name ~ :path_match ';
|
||||
$where .= 'AND rrule_event_overlaps( dtstart, dtend, rrule, :start, :end) ';
|
||||
$where .= "AND (";
|
||||
$where .= " (calendar_item.first_instance_start <= :end AND (:start <= calendar_item.last_instance_end OR calendar_item.last_instance_end IS NULL)) ";
|
||||
$where .= " OR (calendar_item.first_instance_start IS NULL AND rrule_event_overlaps( dtstart, dtend, rrule, :start, :end)) ";
|
||||
$where .= ") ";
|
||||
$where .= "AND caldav_data.caldav_type IN ( 'VEVENT', 'VTODO' ) ";
|
||||
$where .= "AND (calendar_item.transp != 'TRANSPARENT' OR calendar_item.transp IS NULL) ";
|
||||
$where .= "AND (calendar_item.status != 'CANCELLED' OR calendar_item.status IS NULL) ";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user