diff --git a/lib/classes/sidebar/RoomSearchWidget.class.php b/lib/classes/sidebar/RoomSearchWidget.class.php index 652edfb84cab74cf0db19425bf1ba83171eade93..8f2aec6129c376ca3eb3f5548221b10e37bff564 100644 --- a/lib/classes/sidebar/RoomSearchWidget.class.php +++ b/lib/classes/sidebar/RoomSearchWidget.class.php @@ -120,15 +120,13 @@ class RoomSearchWidget extends SidebarWidget } } - + $current_semester = Semester::findCurrent(); + $all_semesters = Semester::getAll(); $begin = new DateTime(); - $begin = $begin->add(new DateInterval('P1D')); + $begin = $begin->setTimestamp($current_semester->beginn); $begin->setTime(intval(date('H')), 0, 0); $end = clone $begin; - $end = $end->add(new DateInterval('PT30M')); - - $current_semester = Semester::findCurrent(); - $all_semesters = Semester::getAll(); + $end = $end->setTimestamp($current_semester->ende); $this->criteria['special__time_range'] = [ 'name' => 'special__time_range', @@ -164,7 +162,7 @@ class RoomSearchWidget extends SidebarWidget 'type' => 'num', 'range_search' => true, 'switch' => true, - 'value' => '0', + 'value' => [10, 100], 'optional' => false ]; } diff --git a/resources/assets/javascripts/lib/resources.js b/resources/assets/javascripts/lib/resources.js index 4189e927d87fb783cd74f4d0e7a1a70fcdff7a8f..45b9ebe3e7dae0f857ddfa2c52e72627fc7a7950 100644 --- a/resources/assets/javascripts/lib/resources.js +++ b/resources/assets/javascripts/lib/resources.js @@ -353,12 +353,8 @@ class Resources jQuery(new_criteria_inputs[0]).attr('name', option_value); let min_input = new_criteria_inputs[1]; let max_input = new_criteria_inputs[2]; - jQuery(min_input).attr('name', option_value + '_min'); - jQuery(min_input).attr('type', 'number'); - jQuery(max_input).attr('name', option_value + '_max'); - jQuery(max_input).attr('type', 'number'); - jQuery(min_input).val(Math.round(parseInt(min_input) * 1.25)); - jQuery(max_input).val(Math.round(parseInt(max_input) * 0.75)); + jQuery(min_input).attr({name: option_value + '_min', type: 'number'}); + jQuery(max_input).attr({name: option_value + '_max', type: 'number'}); } else { let new_criteria_input = jQuery(new_criteria).find('input')[0]; jQuery(new_criteria_input).attr('name', option_value); diff --git a/templates/sidebar/room-search-criteria-available-range.php b/templates/sidebar/room-search-criteria-available-range.php index 1a07f65b3c115acc134f0bb07c58182b0f26843c..4157e352bd25e70cb0d837f2615a4268ed1eca86 100644 --- a/templates/sidebar/room-search-criteria-available-range.php +++ b/templates/sidebar/room-search-criteria-available-range.php @@ -99,7 +99,7 @@ <option value=""><?= _('Bitte wählen') ?></option> <? foreach ($criteria['day_of_week']['options'] as $value => $title): ?> <option value="<?= htmlReady($value) ?>" - <?= ($value == $day_of_week['value'] + <?= ($value === (int)$criteria['day_of_week']['value'] ? 'selected="selected"' : '') ?>> <?= htmlReady($title) ?> diff --git a/templates/sidebar/room-search-criteria-templates.php b/templates/sidebar/room-search-criteria-templates.php index 33eb2f53714b2773e9a48ec8c6c693e151494f1a..1713982e6ee4563a297ce40c965f7b5821779e44 100644 --- a/templates/sidebar/room-search-criteria-templates.php +++ b/templates/sidebar/room-search-criteria-templates.php @@ -1,7 +1,6 @@ <li class="template invisible" data-template-type="bool"> - <?= Icon::create('trash', 'clickable')->asImg( - '16px', + <?= Icon::create('trash')->asImg( [ 'class' => 'text-bottom remove-icon' ] @@ -15,8 +14,7 @@ </li> <li class="template invisible" data-template-type="range"> - <?= Icon::create('trash', 'clickable')->asImg( - '16px', + <?= Icon::create('trash')->asImg( [ 'class' => 'text-bottom remove-icon' ] @@ -26,18 +24,17 @@ <span></span> <div class="range-input-container"> <?= _('von') ?> - <input type="number" + <input type="number" value="10" class="room-search-widget_criteria-list_input"> <?= _('bis') ?> - <input type="number" + <input type="number" value="100" class="room-search-widget_criteria-list_input"> </div> </label> </li> <li class="template invisible" data-template-type="num"> - <?= Icon::create('trash', 'clickable')->asImg( - '16px', + <?= Icon::create('trash')->asImg( [ 'class' => 'text-bottom remove-icon' ] @@ -50,8 +47,7 @@ </li> <li class="template invisible" data-template-type="select"> - <?= Icon::create('trash', 'clickable')->asImg( - '16px', + <?= Icon::create('trash')->asImg( [ 'class' => 'text-bottom remove-icon' ] @@ -64,8 +60,7 @@ </li> <li class="template invisible" data-template-type="date"> - <?= Icon::create('trash', 'clickable')->asImg( - '16px', + <?= Icon::create('trash')->asImg( [ 'class' => 'text-bottom remove-icon' ] @@ -83,8 +78,7 @@ </li> <li class="template invisible" data-template-type="date_range"> - <?= Icon::create('trash', 'clickable')->asImg( - '16px', + <?= Icon::create('trash')->asImg( [ 'class' => 'text-bottom remove-icon' ] @@ -103,8 +97,7 @@ </li> <li class="template invisible" data-template-type="other"> - <?= Icon::create('trash', 'clickable')->asImg( - '16px', + <?= Icon::create('trash')->asImg( [ 'class' => 'text-bottom remove-icon' ]