plugins/libcalendaring

Thomas Brüderli bruederli at kolabsys.com
Tue Jul 8 17:49:09 CEST 2014


 plugins/libcalendaring/lib/libcalendaring_itip.php |   18 ++++++++++++------
 plugins/libcalendaring/localization/en_US.inc      |    5 +++--
 2 files changed, 15 insertions(+), 8 deletions(-)

New commits:
commit 6f6eb810529925e75b56adfff8bb77afd976ad73
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Tue Jul 8 17:49:02 2014 +0200

    Small fix for iTip RSVP display in mail view

diff --git a/plugins/libcalendaring/lib/libcalendaring_itip.php b/plugins/libcalendaring/lib/libcalendaring_itip.php
index 63284c2..2e122c2 100644
--- a/plugins/libcalendaring/lib/libcalendaring_itip.php
+++ b/plugins/libcalendaring/lib/libcalendaring_itip.php
@@ -57,7 +57,7 @@ class libcalendaring_itip
     public function set_rsvp_actions($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);
         }
 
-        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'));
           $action = 'import';
         }
-        else if (in_array(strtolower($status), $this->rsvp_status)) {
-          $html = html::div('rsvp-status ' . strtolower($status), $this->gettext(($latest ? 'youhave' : 'youhavepreviously') . strtolower($status)));
+        else if (in_array($status_lc, $this->rsvp_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
+            if ($status_lc == 'needs-action')
+              $status_text = $this->gettext('outdatedinvitation');
           }
           else if (!$existing && !$rsvp) {
             $action = 'import';
           }
-          else if ($latest) {
+          else if ($latest && $status_lc != 'needs-action') {
             $action = 'update';
           }
+
+          $html = html::div('rsvp-status ' . $status_lc, $status_text);
         }
       }
       // determine action for REPLY
diff --git a/plugins/libcalendaring/localization/en_US.inc b/plugins/libcalendaring/localization/en_US.inc
index 3d30c11..fe31a94 100644
--- a/plugins/libcalendaring/localization/en_US.inc
+++ b/plugins/libcalendaring/localization/en_US.inc
@@ -98,19 +98,20 @@ $labels['youhaveaccepted'] = 'You have accepted this invitation';
 $labels['youhavetentative'] = 'You have tentatively accepted this invitation';
 $labels['youhavedeclined'] = 'You have declined 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['youhavepreviouslytentative'] = 'You have previously accepted this invitation tentatively';
 $labels['youhavepreviouslydeclined'] = 'You have previously declined 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['attendeetentative'] = 'Participant has tentatively accepted';
 $labels['attendeedeclined'] = 'Participant has declined';
 $labels['attendeedelegated'] = 'Participant has delegated to $delegatedto';
 $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['removefromcalendar'] = 'Remove from my calendar';




More information about the commits mailing list