Add option to suppress iTip reply when handling iTip invitation (#3160)

This commit is contained in:
Aleksander Machniak 2014-07-08 13:47:50 +02:00
parent 7affe524f1
commit f57791fb17
4 changed files with 18 additions and 7 deletions

View file

@ -2282,6 +2282,7 @@ class calendar extends rcube_plugin
$mime_id = get_input_value('_part', RCUBE_INPUT_POST);
$status = get_input_value('_status', RCUBE_INPUT_POST);
$delete = intval(get_input_value('_del', RCUBE_INPUT_POST));
$noreply = intval(get_input_value('_noreply', RCUBE_INPUT_POST));
$error_msg = $this->gettext('errorimportingevent');
$success = false;
@ -2428,7 +2429,7 @@ class calendar extends rcube_plugin
// send iTip reply
if ($this->ical->method == 'REQUEST' && $organizer && !in_array(strtolower($organizer['email']), $emails) && !$error_msg) {
if ($this->ical->method == 'REQUEST' && $organizer && !$noreply && !in_array(strtolower($organizer['email']), $emails) && !$error_msg) {
$event['comment'] = get_input_value('_comment', RCUBE_INPUT_POST);
$itip = $this->load_itip();
$itip->set_sender_email($reply_sender);

View file

@ -443,6 +443,12 @@ class libcalendaring_itip
html::tag('textarea', array('id' => 'reply-comment-'.$dom_id, 'cols' => 40, 'rows' => 6, 'style' => 'display:none', 'placeholder' => $this->gettext('itipcomment')), '')
);
// add checkbox to suppress itip reply message
$rsvp_buttons .= html::label(array('class' => 'noreply-toggle'),
html::tag('input', array('type' => 'checkbox', 'id' => 'noreply-'.$dom_id, 'value' => 1))
. ' ' . $this->gettext('itipsuppressreply')
);
$buttons[] = html::div(array('id' => 'rsvp-'.$dom_id, 'class' => 'rsvp-buttons', 'style' => 'display:none'), $rsvp_buttons);
}
// for CANCEL messages, we can:

View file

@ -744,8 +744,10 @@ rcube_libcalendaring.add_from_itip_mail = function(mime_id, task, status, dom_id
del = confirm(rcmail.gettext('itip.declinedeleteconfirm'));
}
var comment = '';
var noreply = 0, comment = '';
if (dom_id) {
noreply = $('#noreply-'+dom_id).prop('checked') ? 1 : 0;
if (!noreply)
comment = $('#reply-comment-'+dom_id).val();
}
@ -756,6 +758,7 @@ rcube_libcalendaring.add_from_itip_mail = function(mime_id, task, status, dom_id
_folder: $('#itip-saveto').val(),
_status: status,
_del: del?1:0,
_noreply: noreply,
_comment: comment
}, rcmail.set_busy(true, 'itip.savingdata'));

View file

@ -79,6 +79,7 @@ $labels['itipneeds-action'] = 'Postpone';
$labels['itipcomment'] = 'Your response';
$labels['itipeditresponse'] = 'Enter a response text';
$labels['itipsendercomment'] = 'Sender\'s comment: ';
$labels['itipsuppressreply'] = 'Don\'t send reply message';
$labels['itipobjectnotfound'] = 'The object referred by this message was not found in your account.';
$labels['itipsubjectaccepted'] = '"$title" has been accepted by $name';