Skip to content
Snippets Groups Projects
Commit 65865c7f authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

fix rooms search, closes #226 closes #1022, closes #227

Closes #226, #1022, and #227

Merge request studip/studip!648
parent 41994362
No related branches found
No related tags found
No related merge requests found
......@@ -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
];
}
......
......@@ -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);
......
......@@ -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) ?>
......
<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'
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment