Small fix for iTip RSVP display in mail view

This commit is contained in:
Thomas Bruederli 2014-07-08 17:49:02 +02:00
parent afb64c3948
commit 6f6eb81052
2 changed files with 15 additions and 8 deletions

View file

@ -57,7 +57,7 @@ class libcalendaring_itip
public function set_rsvp_actions($actions) public function set_rsvp_actions($actions)
{ {
$this->rsvp_actions = (array)$actions; $this->rsvp_actions = (array)$actions;
// $this->rsvp_status = array_merge($this->rsvp_actions, array('delegated')); $this->rsvp_status = array_merge($this->rsvp_actions, array('delegated'));
} }
/** /**
@ -280,22 +280,28 @@ class libcalendaring_itip
$rsvp = $event['rsvp'] && $this->rc->config->get('calendar_allow_itip_uninvited', true); $rsvp = $event['rsvp'] && $this->rc->config->get('calendar_allow_itip_uninvited', true);
} }
if ($status == 'unknown' && !$this->rc->config->get('calendar_allow_itip_uninvited', true)) { $status_lc = strtolower($status);
if ($status_lc == 'unknown' && !$this->rc->config->get('calendar_allow_itip_uninvited', true)) {
$html = html::div('rsvp-status', $this->gettext('notanattendee')); $html = html::div('rsvp-status', $this->gettext('notanattendee'));
$action = 'import'; $action = 'import';
} }
else if (in_array(strtolower($status), $this->rsvp_status)) { else if (in_array($status_lc, $this->rsvp_status)) {
$html = html::div('rsvp-status ' . strtolower($status), $this->gettext(($latest ? 'youhave' : 'youhavepreviously') . strtolower($status))); $status_text = $this->gettext(($latest ? 'youhave' : 'youhavepreviously') . $status_lc);
if ($existing && ($existing['sequence'] > $event['sequence'] || (!$event['sequence'] && $existing['changed'] && $existing['changed'] > $event['changed']))) { if ($existing && ($existing['sequence'] > $event['sequence'] || (!isset($event['sequence']) && $existing['changed'] && $existing['changed'] > $event['changed']))) {
$action = ''; // nothing to do here, outdated invitation $action = ''; // nothing to do here, outdated invitation
if ($status_lc == 'needs-action')
$status_text = $this->gettext('outdatedinvitation');
} }
else if (!$existing && !$rsvp) { else if (!$existing && !$rsvp) {
$action = 'import'; $action = 'import';
} }
else if ($latest) { else if ($latest && $status_lc != 'needs-action') {
$action = 'update'; $action = 'update';
} }
$html = html::div('rsvp-status ' . $status_lc, $status_text);
} }
} }
// determine action for REPLY // determine action for REPLY

View file

@ -98,19 +98,20 @@ $labels['youhaveaccepted'] = 'You have accepted this invitation';
$labels['youhavetentative'] = 'You have tentatively accepted this invitation'; $labels['youhavetentative'] = 'You have tentatively accepted this invitation';
$labels['youhavedeclined'] = 'You have declined this invitation'; $labels['youhavedeclined'] = 'You have declined this invitation';
$labels['youhavedelegated'] = 'You have delegated this invitation'; $labels['youhavedelegated'] = 'You have delegated this invitation';
$labels['youhaveneeds-action'] = 'You have copied this invitation into your calendar'; $labels['youhaveneeds-action'] = 'Your response to this invitation is still pending';
$labels['youhavepreviouslyaccepted'] = 'You have previously accepted this invitation'; $labels['youhavepreviouslyaccepted'] = 'You have previously accepted this invitation';
$labels['youhavepreviouslytentative'] = 'You have previously accepted this invitation tentatively'; $labels['youhavepreviouslytentative'] = 'You have previously accepted this invitation tentatively';
$labels['youhavepreviouslydeclined'] = 'You have previously declined this invitation'; $labels['youhavepreviouslydeclined'] = 'You have previously declined this invitation';
$labels['youhavepreviouslydelegated'] = 'You have previously delegated this invitation'; $labels['youhavepreviouslydelegated'] = 'You have previously delegated this invitation';
$labels['youhavepreviouslyneeds-action'] = 'You have copied this invitation into your calendar'; $labels['youhavepreviouslyneeds-action'] = 'Your response to this invitation is still pending';
$labels['attendeeaccepted'] = 'Participant has accepted'; $labels['attendeeaccepted'] = 'Participant has accepted';
$labels['attendeetentative'] = 'Participant has tentatively accepted'; $labels['attendeetentative'] = 'Participant has tentatively accepted';
$labels['attendeedeclined'] = 'Participant has declined'; $labels['attendeedeclined'] = 'Participant has declined';
$labels['attendeedelegated'] = 'Participant has delegated to $delegatedto'; $labels['attendeedelegated'] = 'Participant has delegated to $delegatedto';
$labels['notanattendee'] = 'You\'re not listed as an attendee of this object'; $labels['notanattendee'] = 'You\'re not listed as an attendee of this object';
$labels['outdatedinvitation'] = 'This invitation has been replaced by a newer version';
$labels['importtocalendar'] = 'Save to my calendar'; $labels['importtocalendar'] = 'Save to my calendar';
$labels['removefromcalendar'] = 'Remove from my calendar'; $labels['removefromcalendar'] = 'Remove from my calendar';