MFB: Correctly create all-day events if using the all-day link in the day view (stpie...
authorJan Schneider <jan@horde.org>
Wed, 29 Apr 2009 15:05:10 +0000 (17:05 +0200)
committerJan Schneider <jan@horde.org>
Thu, 30 Apr 2009 09:27:00 +0000 (11:27 +0200)
kronolith/docs/CHANGES
kronolith/lib/Event.php
kronolith/lib/Kronolith.php
kronolith/new.php

index e63b9ab..0c0dd84 100644 (file)
@@ -18,7 +18,9 @@ v3.0-git
 v2.3.2-cvs
 ----------
 
-
+[jan] Correctly create all-day events if using the all-day link in the day
+      view (stpierre@nebrwesleyan.edu, Bug #8220).
+[jan] Fix rendering of all-day events (Bug #8176).
 
 
 ------
index 6af1cdf..2679c7e 100644 (file)
@@ -1870,7 +1870,7 @@ abstract class Kronolith_Event
                 '" id="' . $this->_formIDEncode($property) . '" size="4" maxlength="4" />';
 
         case 'end[month]':
-            $sel = $this->isInitialized() ? $this->end->month : $this->start->month;
+            $sel = $this->end ? $this->end->month : $this->start->month;
             for ($i = 1; $i < 13; ++$i) {
                 $options[$i] = strftime('%b', mktime(1, 1, 1, $i, 1));
             }
@@ -1879,7 +1879,7 @@ abstract class Kronolith_Event
             break;
 
         case 'end[day]':
-            $sel = $this->isInitialized() ? $this->end->mday : $this->start->mday;
+            $sel = $this->end ? $this->end->mday : $this->start->mday;
             for ($i = 1; $i < 32; ++$i) {
                 $options[$i] = $i;
             }
@@ -1888,9 +1888,9 @@ abstract class Kronolith_Event
             break;
 
         case 'end_hour':
-            $sel = $this->isInitialized() ?
-                $this->end->format($prefs->getValue('twentyFour') ? 'G' : 'g') :
-                $this->start->format($prefs->getValue('twentyFour') ? 'G' : 'g') + 1;
+            $sel = $this->end
+                ? $this->end->format($prefs->getValue('twentyFour') ? 'G' : 'g')
+                $this->start->format($prefs->getValue('twentyFour') ? 'G' : 'g') + 1;
             $hour_min = $prefs->getValue('twentyFour') ? 0 : 1;
             $hour_max = $prefs->getValue('twentyFour') ? 24 : 13;
             for ($i = $hour_min; $i < $hour_max; ++$i) {
@@ -1901,7 +1901,7 @@ abstract class Kronolith_Event
             break;
 
         case 'end_min':
-            $sel = $this->isInitialized() ? $this->end->min : $this->start->min;
+            $sel = $this->end ? $this->end->min : $this->start->min;
             $sel = sprintf('%02d', $sel);
             for ($i = 0; $i < 12; ++$i) {
                 $min = sprintf('%02d', $i * 5);
@@ -1940,7 +1940,7 @@ abstract class Kronolith_Event
             break;
 
         case 'recur_enddate[year]':
-            if ($this->isInitialized()) {
+            if ($this->end) {
                 $end = ($this->recurs() && $this->recurrence->hasRecurEnd())
                         ? $this->recurrence->recurEnd->year
                         : $this->end->year;
@@ -1953,7 +1953,7 @@ abstract class Kronolith_Event
                 '" id="' . $this->_formIDEncode($property) . '" size="4" maxlength="4" />';
 
         case 'recur_enddate[month]':
-            if ($this->isInitialized()) {
+            if ($this->end) {
                 $sel = ($this->recurs() && $this->recurrence->hasRecurEnd())
                     ? $this->recurrence->recurEnd->month
                     : $this->end->month;
@@ -1968,7 +1968,7 @@ abstract class Kronolith_Event
             break;
 
         case 'recur_enddate[day]':
-            if ($this->isInitialized()) {
+            if ($this->end) {
                 $sel = ($this->recurs() && $this->recurrence->hasRecurEnd())
                     ? $this->recurrence->recurEnd->mday
                     : $this->end->mday;
index a77197a..4a6e064 100644 (file)
@@ -1504,8 +1504,8 @@ class Kronolith
      *                                    recurring event, the date of this
      *                                    intance.
      */
-    public static function sendITipNotifications(&$event, &$notification, $action,
-                                   $instance = null)
+    public static function sendITipNotifications(&$event, &$notification,
+                                                 $action, $instance = null)
     {
         global $conf;
 
index 61585a6..45b6b8d 100644 (file)
@@ -43,24 +43,18 @@ if (!$date) {
     }
 }
 $event->start = new Horde_Date($date);
-
-$url = Util::getFormData('url');
-
-// Default to a 1 hour duration.
 $event->end = new Horde_Date($event->start);
 if (Util::getFormData('allday')) {
     $event->end->mday++;
-    /*
-    $event->end->hour = 23;
-    $event->end->min = $event->end->sec = 59;
-    */
 } else {
+    // Default to a 1 hour duration.
     $event->end->hour++;
 }
 $month = $event->start->month;
 $year = $event->start->year;
 
 $buttons = array('<input type="submit" class="button" name="save" value="' . _("Save Event") . '" />');
+$url = Util::getFormData('url');
 if (isset($url)) {
     $cancelurl = $url;
 } else {