diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2022-09-28 12:32:56 +0000 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2022-09-28 12:32:56 +0000 |
| commit | 9e13d2f5fa4726b54efe8ad046d0b53aadb543bf (patch) | |
| tree | b8fc0583b685de64575feca2cd4efe2663586d74 /templates/sidebar | |
| parent | 0d56653e17a283d918c6e4cb41468de1990e0331 (diff) | |
fix for BIESt #1104
Merge request studip/studip!674
Diffstat (limited to 'templates/sidebar')
| -rw-r--r-- | templates/sidebar/room-clipboard-item.php | 6 | ||||
| -rw-r--r-- | templates/sidebar/room-search-widget.php | 30 |
2 files changed, 20 insertions, 16 deletions
diff --git a/templates/sidebar/room-clipboard-item.php b/templates/sidebar/room-clipboard-item.php index a433c9d..da848f7 100644 --- a/templates/sidebar/room-clipboard-item.php +++ b/templates/sidebar/room-clipboard-item.php @@ -29,10 +29,10 @@ if (!$item) { } ?> <tr class="<?= htmlReady($classes) ?>" - data-range_id="<?= htmlReady($item['range_id']) ?>"> + data-range_id="<?= htmlReady($item['range_id'] ?? '') ?>"> <td class="item-name"><?= htmlReady($item['name']) ?></td> <td class="actions"> - <a href="<?= Room::getLinkForAction('show', ($item ? $item['range_id'] : 'RANGE_ID')) ?>" data-dialog> + <a href="<?= Room::getLinkForAction('show', (!empty($item) ? $item['range_id'] : 'RANGE_ID')) ?>" data-dialog> <?= Icon::create( 'info-circle', Icon::ROLE_CLICKABLE, @@ -41,7 +41,7 @@ if (!$item) { 'class' => 'text-bottom' ])?> </a> - <a href="<?= Room::getLinkForAction('semester_plan', ($item ? $item['range_id'] : 'RANGE_ID')) ?>" target="_blank"> + <a href="<?= Room::getLinkForAction('semester_plan', (!empty($item) ? $item['range_id'] : 'RANGE_ID')) ?>" target="_blank"> <?= Icon::create( 'timetable', Icon::ROLE_CLICKABLE, diff --git a/templates/sidebar/room-search-widget.php b/templates/sidebar/room-search-widget.php index f0b22c8..ac679b4 100644 --- a/templates/sidebar/room-search-widget.php +++ b/templates/sidebar/room-search-widget.php @@ -8,7 +8,7 @@ [ 'criteria' => ( $selected_criteria['special__room_name'] - ?: $criteria['special__room_name'] + ?? $criteria['special__room_name'] ), 'removable' => false ] @@ -30,7 +30,8 @@ [ 'criteria' => ( $selected_criteria['room_category_id'] - ?: $criteria['room_category_id'] + ?? $criteria['room_category_id'] + ?? [] ), 'removable' => false ] @@ -40,18 +41,19 @@ [ 'criteria' => ( $selected_criteria['special__building_location'] - ?: $criteria['special__building_location'] + ?? $criteria['special__building_location'] + ?? [] ), 'removable' => false ] ) ?> - <? if ($selected_criteria['special__building_location_label'] || $criteria['special__building_location_label']): ?> + <? if (!empty($selected_criteria['special__building_location_label']) || !empty($criteria['special__building_location_label'])): ?> <?= $this->render_partial( 'sidebar/room-search-criteria.php', [ 'criteria' => ( $selected_criteria['special__building_location_label'] - ?: $criteria['special__building_location_label'] + ?? $criteria['special__building_location_label'] ), 'removable' => false ] @@ -60,16 +62,15 @@ <?= $this->render_partial( 'sidebar/room-search-criteria-seats.php', [ - 'criteria' => - $selected_criteria['special__seats'] - ?: $criteria['special__seats'] + 'criteria' => $selected_criteria['special__seats'] ?? $criteria['special__seats'], + 'removable' => false ] ) ?> <?= $this->render_partial( 'sidebar/room-search-criteria-available-range.php', [ 'criteria' => $selected_criteria['special__time_range'] - ?: $criteria['special__time_range'] + ?? $criteria['special__time_range'] ] ) ?> @@ -108,10 +109,13 @@ data-type="<?= htmlReady($c['type']) ?>" data-range-search="<?= htmlReady($c['range_search']) ?>" data-select_options="<?= htmlReady( - is_array($c['options']) - ? implode(';;', $c['options']) - : $c['options'] - ) ?>" + !empty($c['options']) + ? (is_array($c['options']) + ? implode(';;', $c['options']) + : $c['options'] + ) + : '' + ) ?>" <?= in_array($c['name'], array_keys($selected_criteria)) ? 'class="invisible"' : ''?>> |
