diff --git a/app/controllers/settings/calendar.php b/app/controllers/settings/calendar.php index b2f4f1c55af12a359cd431fd4689e49f09efeac1..50c556be53862049b2a6bef9bffa2aee7d1c5301 100644 --- a/app/controllers/settings/calendar.php +++ b/app/controllers/settings/calendar.php @@ -56,10 +56,23 @@ class Settings_CalendarController extends Settings_SettingsController { $this->check_ticket(); + $start = Request::option('cal_start'); + $end = Request::option('cal_end'); + if ($start >= $end) { + PageLayout::postError(_('Die Startuhrzeit muss vor der Enduhrzeit liegen.')); + $calendar_user_control_data = (array) UserConfig::get($GLOBALS['user']->id)->getValue('CALENDAR_SETTINGS'); + foreach ($calendar_user_control_data as $key => $value) { + $this->$key = $value; + } + $this->start = $start; + $this->end = $end; + return; + } + $this->config->store('CALENDAR_SETTINGS', [ 'view' => Request::option('cal_view'), - 'start' => Request::option('cal_start'), - 'end' => Request::option('cal_end'), + 'start' => $start, + 'end' => $end, 'step_day' => Request::option('cal_step_day'), 'step_week' => Request::option('cal_step_week'), 'type_week' => Request::option('cal_type_week'), diff --git a/app/views/settings/calendar.php b/app/views/settings/calendar.php index 889120ad72af01ec907c516095630ba012ebbff2..aecc23463ee4b5e081e412c4d525ed5b0bd8868c 100644 --- a/app/views/settings/calendar.php +++ b/app/views/settings/calendar.php @@ -78,7 +78,7 @@ $cal_step_weeks = [ <label> <?= _('Enduhrzeit') ?> <select name="cal_end" aria-label="<?= _('Endzeit der Tages- und Wochenansicht') ?>" class="size-s"> - <? for ($i = 0; $i < 24; $i += 1): ?> + <? for ($i = 1; $i < 25; $i += 1): ?> <option value="<?= $i ?>" <? if ($end == $i) echo 'selected'; ?>> <?= sprintf(_('%02u:00 Uhr'), $i) ?> </option>