give a response to the user on how many occurrences have been changed. Display the correct participant status depending if a single occurrence or a whole event series is displayed.

This commit is contained in:
Christian Binder 2009-08-17 14:38:18 +00:00
parent 35626a6593
commit 1793a546e3

View File

@ -351,7 +351,14 @@ class calendar_uiforms extends calendar_ui
if ($this->bo->set_status($event['id'],$uid,$status,isset($content['edit_single']) ? $content['participants']['status_date'] : 0)) if ($this->bo->set_status($event['id'],$uid,$status,isset($content['edit_single']) ? $content['participants']['status_date'] : 0))
{ {
// refreshing the calendar-view with the changed participant-status // refreshing the calendar-view with the changed participant-status
$msg = lang('Status changed'); if($event['recur_type'] != MCAL_RECUR_NONE)
{
$msg = lang('Status of all occurrences changed');
}
else
{
$msg = isset($content['edit_single']) ? lang('Status of this occurrence changed') : lang('Status changed');
}
if (!$preserv['no_popup']) if (!$preserv['no_popup'])
{ {
$js = 'opener.location.href=\''.addslashes($GLOBALS['egw']->link('/index.php',array( $js = 'opener.location.href=\''.addslashes($GLOBALS['egw']->link('/index.php',array(
@ -645,7 +652,7 @@ class calendar_uiforms extends calendar_ui
{ {
return lang('Exception created - you can now edit or delete it'); return lang('Exception created - you can now edit or delete it');
} }
return lang('You can now edit your participation status on this single recurrence'); return lang('You can now edit your participation status on this single occurrence');
} }
/** /**
@ -791,13 +798,18 @@ class calendar_uiforms extends calendar_ui
$preserv['actual_date'] = $event['start']; // remember the date clicked $preserv['actual_date'] = $event['start']; // remember the date clicked
if ($event['recur_type'] != MCAL_RECUR_NONE) if ($event['recur_type'] != MCAL_RECUR_NONE)
{ {
$participants = array('participants' => $event['participants'], 'participant_types' => $event['participant_types']); // preserv participants of this event
$event = array_merge($this->bo->read($cal_id,0,true), $participants); // recuring event --> read the series + concatenate with participants of the selected recurrence
// check if we should create an exception // check if we should create an exception
if ($_GET['exception']) if ($_GET['exception'])
{ {
// exception: preserv participants of this event and merge it with the 0-recurrence
$participants = array('participants' => $event['participants'],'participant_types' => $event['participant_types']);
$event = array_merge($this->bo->read($cal_id,0,true),$participants);
$msg = $this->_create_exception($event,$preserv); $msg = $this->_create_exception($event,$preserv);
} }
else
{
$event = $this->bo->read($cal_id,0,true); // read the 0-recurrence
}
} }
} }
// set new start and end if given by $_GET // set new start and end if given by $_GET
@ -912,7 +924,7 @@ class calendar_uiforms extends calendar_ui
'uid' => $member, 'uid' => $member,
'status' => 'G', 'status' => 'G',
); );
// read access is enought to invite participants, but you edit rights to change status // read access is enough to invite participants, but you need edit rights to change status
if (!$this->bo->check_perms(EGW_ACL_EDIT,0,$member)) if (!$this->bo->check_perms(EGW_ACL_EDIT,0,$member))
{ {
$readonlys[$row.'[quantity]'] = $readonlys["delete[$member]"] =$readonlys[$row]['status']= true; $readonlys[$row.'[quantity]'] = $readonlys["delete[$member]"] =$readonlys[$row]['status']= true;