Fix participant issue in event shifting

This commit is contained in:
Jörg Lehrke 2010-06-16 10:41:45 +00:00
parent 71b91ab69b
commit b53e7ccbcc

View File

@ -237,12 +237,13 @@ class calendar_uiforms extends calendar_ui
unset($event['alarm']['delete_alarm']);
unset($event['duration']);
if (in_array($button,array('ignore','freetime','reedit','confirm_edit_single')))
if (in_array($button,array('ignore','freetime','reedit')))
{
// no conversation necessary, event is already in the right format
}
elseif (isset($content['participants'])) // convert content => event
else
{
// convert content => event
if ($content['whole_day'])
{
$event['start'] = $this->bo->date2array($event['start']);
@ -258,6 +259,9 @@ class calendar_uiforms extends calendar_ui
{
$event['recur_data'] = 1 << (int)date('w',$event['start']);
}
if (isset($content['participants']))
{
$event['participants'] = $event['participant_types'] = array();
foreach($content['participants'] as $key => $data)
@ -411,6 +415,7 @@ class calendar_uiforms extends calendar_ui
}
}
}
}
$preserv = array(
'view' => $view,
'hide_delete' => $hide_delete,
@ -461,7 +466,8 @@ class calendar_uiforms extends calendar_ui
$event['owner'] = !(int)$this->owner || !$this->bo->check_perms(EGW_ACL_ADD,0,$this->owner) ? $this->user : $this->owner;
// Clear participant stati
foreach($event['participant_types'] as $type => &$participants) {
foreach($event['participant_types'] as $type => &$participants)
{
foreach($participants as $id => &$response)
{
if($type == 'u' && $id == $event['owner']) continue;
@ -566,19 +572,11 @@ class calendar_uiforms extends calendar_ui
if ($edit_series_confirmed)
{
$orig_event = $event;
if (!empty($event['whole_day']))
{
// Adjust start to 0:00
$time = new egw_time($event['start']);
$time->setTime(0, 0, 0);
$event['start'] = egw_time::to($time, 'ts');
$time = new egw_time($next_occurrence['start']);
$time->setTime(0, 0, 0);
$next_occurrence['start'] = egw_time::to($time, 'ts');
}
$offset = $event['start'] - $old_event['start'];
$event['start'] = $next_occurrence['start'] + $offset;
$event['end'] = $next_occurrence['end'] + $offset;
$event['participants'] = $old_event['participants'];
foreach ($old_event['recur_exception'] as $key => $exdate)
{
if ($exdate > $this->bo->now_su)