Only set the default alarm value on the Sql and Kolab Event objects.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 21 Sep 2009 04:57:19 +0000 (00:57 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 21 Sep 2009 04:57:19 +0000 (00:57 -0400)
Bug: 8588

kronolith/lib/Event.php
kronolith/lib/Event/Kolab.php
kronolith/lib/Event/Sql.php

index 2c89d96..a39ba10 100644 (file)
@@ -218,14 +218,6 @@ abstract class Kronolith_Event
      */
     public function __construct($driver, $eventObject = null)
     {
-        static $alarm;
-
-        /* Set default alarm value. */
-        if (!isset($alarm) && isset($GLOBALS['prefs'])) {
-            $alarm = $GLOBALS['prefs']->getValue('default_alarm');
-        }
-        $this->alarm = $alarm;
-
         $this->_calendar = $driver->getCalendar();
         // FIXME: Move color definitions anywhere else.
         if (!empty($this->_calendar) &&
index f64bd3c..6e5a35f 100644 (file)
@@ -19,6 +19,28 @@ class Kronolith_Event_Kolab extends Kronolith_Event
      */
     protected $_calendarType = 'internal';
 
+    /**
+     * Const'r
+     *
+     * @param Kronolith_Driver $driver  The backend driver that this event is
+     *                                  stored in.
+     * @param mixed $eventObject        Backend specific event object
+     *                                  that this will represent.
+     */
+    public function __construct($driver, $eventObject = null)
+    {
+        static $alarm;
+
+        /* Set default alarm value. */
+        if (!isset($alarm) && isset($GLOBALS['prefs'])) {
+            $alarm = $GLOBALS['prefs']->getValue('default_alarm');
+        }
+
+        $this->alarm = $alarm;
+
+        parent::__construct($driver, $eventObject);
+    }
+
     public function fromDriver($event)
     {
         $this->eventID = $event['uid'];
index 7edc9cd..05161eb 100644 (file)
@@ -24,6 +24,28 @@ class Kronolith_Event_Sql extends Kronolith_Event
      */
     private $_properties = array();
 
+    /**
+     * Const'r
+     *
+     * @param Kronolith_Driver $driver  The backend driver that this event is
+     *                                  stored in.
+     * @param mixed $eventObject        Backend specific event object
+     *                                  that this will represent.
+     */
+    public function __construct($driver, $eventObject = null)
+    {
+        static $alarm;
+
+        /* Set default alarm value. */
+        if (!isset($alarm) && isset($GLOBALS['prefs'])) {
+            $alarm = $GLOBALS['prefs']->getValue('default_alarm');
+        }
+
+        $this->alarm = $alarm;
+
+        parent::__construct($driver, $eventObject);
+    }
+
     public function fromDriver($SQLEvent)
     {
         $driver = $this->getDriver();