Some fixes to the iTip delegation functions

This commit is contained in:
Thomas Bruederli 2014-11-06 12:06:51 +01:00
parent 4a150a2139
commit c26f9d25cb
4 changed files with 7 additions and 4 deletions

View file

@ -2638,7 +2638,7 @@ class calendar extends rcube_plugin
} }
else if ($attendee['email'] && in_array(strtolower($attendee['email']), $emails)) { else if ($attendee['email'] && in_array(strtolower($attendee['email']), $emails)) {
$event['attendees'][$i]['status'] = strtoupper($status); $event['attendees'][$i]['status'] = strtoupper($status);
if ($event['attendees'][$i]['status'] != 'NEEDS-ACTION') if (!in_array($event['attendees'][$i]['status'], array('NEEDS-ACTION','DELEGATED')))
unset($event['attendees'][$i]['rsvp']); // remove RSVP attribute unset($event['attendees'][$i]['rsvp']); // remove RSVP attribute
$metadata['attendee'] = $attendee['email']; $metadata['attendee'] = $attendee['email'];
$metadata['rsvp'] = $attendee['role'] != 'NON-PARTICIPANT'; $metadata['rsvp'] = $attendee['role'] != 'NON-PARTICIPANT';

View file

@ -2349,7 +2349,7 @@ function rcube_calendar_ui(settings)
if (data['delegated-to']) { if (data['delegated-to']) {
delete data['delegated-to']; delete data['delegated-to'];
if (data.role == 'NON-PARTICIPANT' && status != 'DECLINED') if (data.role == 'NON-PARTICIPANT' && data.status != 'DECLINED')
data.role = 'REQ-PARTICIPANT'; data.role = 'REQ-PARTICIPANT';
} }
} }

View file

@ -262,6 +262,7 @@ class libcalendaring_itip
* *
* @param array Event object to delegate * @param array Event object to delegate
* @param mixed Delegatee as string or hash array with keys 'name' and 'mailto' * @param mixed Delegatee as string or hash array with keys 'name' and 'mailto'
* @param boolean The delegator's RSVP flag
* @return boolean True on success, False on failure * @return boolean True on success, False on failure
*/ */
public function delegate_to(&$event, $delegate, $rsvp = false) public function delegate_to(&$event, $delegate, $rsvp = false)
@ -301,6 +302,7 @@ class libcalendaring_itip
$delegate_index = $i; $delegate_index = $i;
break; break;
} }
// TODO: remove previous delegatee (i.e. attendee that has DELEGATED-FROM == $me)
} }
// set/add delegate attendee with RSVP=TRUE and DELEGATED-FROM parameter // set/add delegate attendee with RSVP=TRUE and DELEGATED-FROM parameter
@ -635,7 +637,7 @@ class libcalendaring_itip
// add localized texts for the delegation dialog // add localized texts for the delegation dialog
if (in_array('delegated', $actions)) { if (in_array('delegated', $actions)) {
foreach (array('itipdelegated','itipcomment','delegateinvitation', foreach (array('itipdelegated','itipcomment','delegateinvitation',
'delegateto','delegatersvpme','delegateinvalidaddress') as $label) { 'delegateto','delegatersvpme','delegateinvalidaddress','cancel') as $label) {
$this->rc->output->command('add_label', "itip.$label", $this->gettext($label)); $this->rc->output->command('add_label', "itip.$label", $this->gettext($label));
} }
} }

View file

@ -916,7 +916,8 @@ rcube_libcalendaring.itip_delegate_dialog = function(callback, selector)
rcm.env.recipients_delimiter = ''; rcm.env.recipients_delimiter = '';
}, },
close: function(event, ui) { close: function(event, ui) {
rcmail.ksearch_blur(); rcm = rcmail.is_framed() ? parent.rcmail : rcmail;
rcm.ksearch_blur();
$(this).remove(); $(this).remove();
} }
}); });