Exclude cancelled events from count query on invitations calendar
This commit is contained in:
parent
724ecc44bf
commit
03dd4b60b3
2 changed files with 10 additions and 1 deletions
|
@ -284,6 +284,11 @@ class kolab_invitation_calendar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$filter = array(
|
||||||
|
array('tags','!=','x-status:cancelled'),
|
||||||
|
array($subquery, 'OR')
|
||||||
|
);
|
||||||
|
|
||||||
// aggregate counts from all calendar folders
|
// aggregate counts from all calendar folders
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach (kolab_storage::list_folders('', '*', 'event', null) as $foldername) {
|
foreach (kolab_storage::list_folders('', '*', 'event', null) as $foldername) {
|
||||||
|
@ -291,7 +296,7 @@ class kolab_invitation_calendar
|
||||||
if ($cal->get_namespace() == 'other')
|
if ($cal->get_namespace() == 'other')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$count += $cal->count_events($start, $end, array(array($subquery, 'OR')));
|
$count += $cal->count_events($start, $end, $filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $count;
|
return $count;
|
||||||
|
|
|
@ -635,6 +635,10 @@ abstract class kolab_format_xcal extends kolab_format
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($object['status'])) {
|
||||||
|
$tags[] = 'x-status:' . strtolower($object['status']);
|
||||||
|
}
|
||||||
|
|
||||||
return array_unique($tags);
|
return array_unique($tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue