2 commits - plugins/calendar

Thomas Brüderli bruederli at kolabsys.com
Wed Sep 19 11:24:29 CEST 2012


 plugins/calendar/calendar.php                   |    2 +-
 plugins/calendar/config.inc.php.dist            |    3 +++
 plugins/calendar/drivers/kolab/kolab_driver.php |   11 +++++++----
 3 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 3fce0577c6e56b3b3ab359fe2bb21a3b01af7670
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Sep 19 11:23:30 2012 +0200

    Use alarms texts from libcalendaring (#1027)

diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 9d46086..86a2d12 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -384,7 +384,7 @@ class calendar extends rcube_plugin
       $input_value = new html_inputfield(array('name' => '_alarm_value', 'id' => $field_id . 'value', 'size' => 3));
       $select_offset = new html_select(array('name' => '_alarm_offset', 'id' => $field_id . 'offset'));
       foreach (array('-M','-H','-D','+M','+H','+D') as $trigger)
-        $select_offset->add($this->gettext('trigger' . $trigger), $trigger);
+        $select_offset->add(rcube_label('trigger' . $trigger, 'libcalendaring'), $trigger);
       
       $p['blocks']['view']['options']['alarmtype'] = array(
         'title' => html::label($field_id, Q($this->gettext('defaultalarmtype'))),


commit c24303fe5dd22bacf4691796e45f243106c864f3
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Wed Sep 19 11:17:15 2012 +0200

    Disable free-busy trigerring by default

diff --git a/plugins/calendar/config.inc.php.dist b/plugins/calendar/config.inc.php.dist
index 0fb8bea..4ae8123 100644
--- a/plugins/calendar/config.inc.php.dist
+++ b/plugins/calendar/config.inc.php.dist
@@ -104,4 +104,7 @@ $rcmail_config['calendar_categories'] = array(
    'Holiday' => 'ff6600',
 );
 
+// enable asynchronous free-busy triggering after data changed
+$rcmail_config['calendar_freebusy_trigger'] = false;
+
 ?>
\ No newline at end of file
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 21ea4ca..5cb0dc2 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -40,6 +40,7 @@ class kolab_driver extends calendar_driver
   private $cal;
   private $calendars;
   private $has_writeable = false;
+  private $freebusy_trigger = false;
 
   /**
    * Default constructor
@@ -52,6 +53,8 @@ class kolab_driver extends calendar_driver
     
     $this->cal->register_action('push-freebusy', array($this, 'push_freebusy'));
     $this->cal->register_action('calendar-acl', array($this, 'calendar_acl'));
+    
+    $this->freebusy_trigger = $this->rc->config->get('calendar_freebusy_trigger', false);
   }
 
 
@@ -290,7 +293,7 @@ class kolab_driver extends calendar_driver
 
       $success = $storage->insert_event($event);
       
-      if ($success)
+      if ($success && $this->freebusy_trigger)
         $this->rc->output->command('plugin.ping_url', array('action' => 'calendar/push-freebusy', 'source' => $storage->id));
       
       return $success;
@@ -403,7 +406,7 @@ class kolab_driver extends calendar_driver
       }
     }
 
-    if ($success)
+    if ($success && $this->freebusy_trigger)
       $this->rc->output->command('plugin.ping_url', array('action' => 'calendar/push-freebusy', 'source' => $storage->id));
 
     return $success;
@@ -424,7 +427,7 @@ class kolab_driver extends calendar_driver
       else
         $success = $storage->restore_event($event);
       
-      if ($success)
+      if ($success && $this->freebusy_trigger)
         $this->rc->output->command('plugin.ping_url', array('action' => 'calendar/push-freebusy', 'source' => $storage->id));
       
       return $success;
@@ -605,7 +608,7 @@ class kolab_driver extends calendar_driver
         break;
     }
     
-    if ($success)
+    if ($success && $this->freebusy_trigger)
       $this->rc->output->command('plugin.ping_url', array('action' => 'calendar/push-freebusy', 'source' => $storage->id));
     
     return $success;





More information about the commits mailing list