'" 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));
}
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;
}
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) {
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);
break;
case 'recur_enddate[year]':
- if ($this->isInitialized()) {
+ if ($this->end) {
$end = ($this->recurs() && $this->recurrence->hasRecurEnd())
? $this->recurrence->recurEnd->year
: $this->end->year;
'" 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;
break;
case 'recur_enddate[day]':
- if ($this->isInitialized()) {
+ if ($this->end) {
$sel = ($this->recurs() && $this->recurrence->hasRecurEnd())
? $this->recurrence->recurEnd->mday
: $this->end->mday;
}
}
$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 {