Use get_recurrence_exceptions() to calculate the pseudo-exceptions

This commit is contained in:
Jörg Lehrke 2009-11-19 11:16:04 +00:00
parent ed326ddc69
commit 30a6a67337
2 changed files with 5 additions and 26 deletions

View File

@ -479,30 +479,7 @@ class calendar_ical extends calendar_boupdate
// dont use "virtual" exceptions created by participant status for GroupDAV or file export
if (!in_array($this->productManufacturer,array('file','groupdav')))
{
$participants = $this->so->get_participants($event['id'], 0);
// Check if the stati for all participants are identical for all recurrences
foreach ($participants as $uid => $attendee)
{
switch ($attendee['type'])
{
case 'u': // account
case 'c': // contact
case 'e': // email address
$recurrences = $this->so->get_recurrences($event['id'], $uid);
foreach ($recurrences as $rdate => $recur_status)
{
if ($rdate && $recur_status != $recurrences[0])
{
// Every distinct status results in an exception
$days[] = $rdate;
}
}
break;
default: // We don't handle the rest
break;
}
}
$days = $this->so->get_recurrence_exceptions($event);
}
if (is_array($event['recur_exception']))
{

View File

@ -1402,11 +1402,13 @@ ORDER BY cal_user_type, cal_usre_id
* Gets the exception days of a given recurring event caused by
* irregular participant stati
*
* @param array $event Recurring Event.
* @param array $event Recurring Event.
* @param int servertime=0 == 0 -> export event with UTC timestamps
* != 0 -> export with servertime timestamps
*
* @return array Array of exception days (false for non-recurring events).
*/
function get_recurrence_exceptions(&$event)
function get_recurrence_exceptions(&$event, $servertime=0)
{
$cal_id = (int) $event['id'];
if (!$cal_id || $event['recur_type'] == MCAL_RECUR_NONE) return false;