Fix wrong/missing delegated ATTENDEE in event iTip REPLY (#5365)
Summary: Fixes #5365 and unifies COMMENT handling code Reviewers: #roundcube_kolab_plugins_developers, vanmeeuwen Reviewed By: #roundcube_kolab_plugins_developers, vanmeeuwen Differential Revision: https://git.kolab.org/D111
This commit is contained in:
parent
55816351cb
commit
8f9aa9d41e
2 changed files with 19 additions and 15 deletions
|
@ -2819,17 +2819,17 @@ class calendar extends rcube_plugin
|
|||
$noreply = $noreply || $status == 'needs-action' || $itip_sending === 0;
|
||||
$instance = rcube_utils::get_input_value('_instance', rcube_utils::INPUT_POST);
|
||||
$savemode = rcube_utils::get_input_value('_savemode', rcube_utils::INPUT_POST);
|
||||
$comment = rcube_utils::get_input_value('_comment', rcube_utils::INPUT_POST);
|
||||
|
||||
$error_msg = $this->gettext('errorimportingevent');
|
||||
$success = false;
|
||||
$delegate = null;
|
||||
$success = false;
|
||||
|
||||
if ($status == 'delegated') {
|
||||
$delegates = rcube_mime::decode_address_list(rcube_utils::get_input_value('_to', rcube_utils::INPUT_POST, true), 1, false);
|
||||
$delegate = reset($delegates);
|
||||
|
||||
if (empty($delegate) || empty($delegate['mailto'])) {
|
||||
$this->rc->output->command('display_message', $this->gettext('libcalendaring.delegateinvalidaddress'), 'error');
|
||||
$this->rc->output->command('display_message', $this->rc->gettext('libcalendaring.delegateinvalidaddress'), 'error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2838,19 +2838,20 @@ class calendar extends rcube_plugin
|
|||
if ($event = $this->lib->mail_get_itip_object($mbox, $uid, $mime_id, 'event')) {
|
||||
// forward iTip request to delegatee
|
||||
if ($delegate) {
|
||||
$rsvpme = (bool) intval(rcube_utils::get_input_value('_rsvp', rcube_utils::INPUT_POST));
|
||||
$comment = rcube_utils::get_input_value('_comment', rcube_utils::INPUT_POST);
|
||||
$rsvpme = rcube_utils::get_input_value('_rsvp', rcube_utils::INPUT_POST);
|
||||
$itip = $this->load_itip();
|
||||
|
||||
$d_event = $comment ? array_merge($event, array('comment' => $comment)) : $event;
|
||||
$itip = $this->load_itip();
|
||||
$event['comment'] = $comment;
|
||||
|
||||
if ($itip->delegate_to($d_event, $delegate, $rsvpme)) {
|
||||
if ($itip->delegate_to($event, $delegate, !empty($rsvpme))) {
|
||||
$this->rc->output->show_message('calendar.itipsendsuccess', 'confirmation');
|
||||
}
|
||||
else {
|
||||
$this->rc->output->command('display_message', $this->gettext('itipresponseerror'), 'error');
|
||||
}
|
||||
|
||||
unset($event['comment']);
|
||||
|
||||
// the delegator is set to non-participant, thus save as non-blocking
|
||||
$event['free_busy'] = 'free';
|
||||
}
|
||||
|
@ -3086,7 +3087,7 @@ class calendar extends rcube_plugin
|
|||
|
||||
// send iTip reply
|
||||
if ($event['_method'] == 'REQUEST' && $organizer && !$noreply && !in_array(strtolower($organizer['email']), $emails) && !$error_msg) {
|
||||
$event['comment'] = rcube_utils::get_input_value('_comment', rcube_utils::INPUT_POST);
|
||||
$event['comment'] = $comment;
|
||||
$itip = $this->load_itip();
|
||||
$itip->set_sender_email($reply_sender);
|
||||
if ($itip->send_itip_message($event, 'REPLY', $organizer, 'itipsubject' . $status, 'itipmailbody' . $status))
|
||||
|
@ -3098,7 +3099,6 @@ class calendar extends rcube_plugin
|
|||
$this->rc->output->send();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handler for calendar/itip-remove requests
|
||||
*/
|
||||
|
|
|
@ -1906,12 +1906,12 @@ class tasklist extends rcube_plugin
|
|||
$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST);
|
||||
$mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_POST);
|
||||
$status = rcube_utils::get_input_value('_status', rcube_utils::INPUT_POST);
|
||||
$comment = rcube_utils::get_input_value('_comment', rcube_utils::INPUT_POST);
|
||||
$delete = intval(rcube_utils::get_input_value('_del', rcube_utils::INPUT_POST));
|
||||
$noreply = intval(rcube_utils::get_input_value('_noreply', rcube_utils::INPUT_POST)) || $status == 'needs-action';
|
||||
|
||||
$error_msg = $this->gettext('errorimportingtask');
|
||||
$success = false;
|
||||
$delegate = null;
|
||||
|
||||
if ($status == 'delegated') {
|
||||
$delegates = rcube_mime::decode_address_list(rcube_utils::get_input_value('_to', rcube_utils::INPUT_POST, true), 1, false);
|
||||
|
@ -1929,15 +1929,19 @@ class tasklist extends rcube_plugin
|
|||
|
||||
// forward iTip request to delegatee
|
||||
if ($delegate) {
|
||||
$rsvpme = intval(rcube_utils::get_input_value('_rsvp', rcube_utils::INPUT_POST));
|
||||
$rsvpme = rcube_utils::get_input_value('_rsvp', rcube_utils::INPUT_POST);
|
||||
$itip = $this->load_itip();
|
||||
|
||||
$itip = $this->load_itip();
|
||||
if ($itip->delegate_to($task, $delegate, $rsvpme ? true : false)) {
|
||||
$task['comment'] = $comment;
|
||||
|
||||
if ($itip->delegate_to($task, $delegate, !empty($rsvpme))) {
|
||||
$this->rc->output->show_message('tasklist.itipsendsuccess', 'confirmation');
|
||||
}
|
||||
else {
|
||||
$this->rc->output->command('display_message', $this->gettext('itipresponseerror'), 'error');
|
||||
}
|
||||
|
||||
unset($task['comment']);
|
||||
}
|
||||
|
||||
// find writeable list to store the task
|
||||
|
@ -2134,7 +2138,7 @@ class tasklist extends rcube_plugin
|
|||
|
||||
// send iTip reply
|
||||
if ($task['_method'] == 'REQUEST' && $organizer && !$noreply && !in_array(strtolower($organizer['email']), $emails) && !$error_msg) {
|
||||
$task['comment'] = rcube_utils::get_input_value('_comment', rcube_utils::INPUT_POST);
|
||||
$task['comment'] = $comment;
|
||||
$itip = $this->load_itip();
|
||||
$itip->set_sender_email($reply_sender);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue