aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Siegfried <david.siegfried@uni-vechta.de>2024-11-05 12:24:32 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2024-11-05 12:24:32 +0000
commit1f6cc4e50b0c544ba4cc65b772c5ccca23e6e3cc (patch)
treec96e135c244fb10fbed1cb9b7a9ea6309801e5f3
parent660b1d5fc3a9d391f92b4c037464ed83660b7d37 (diff)
prevent warnings in multiperson-search, fixes #4812
Closes #4812 Merge request studip/studip!3601
-rw-r--r--app/views/multipersonsearch/no_js_form.php55
1 files changed, 41 insertions, 14 deletions
diff --git a/app/views/multipersonsearch/no_js_form.php b/app/views/multipersonsearch/no_js_form.php
index bbca28e..84883a0 100644
--- a/app/views/multipersonsearch/no_js_form.php
+++ b/app/views/multipersonsearch/no_js_form.php
@@ -1,11 +1,26 @@
+<?php
+/**
+ * @var string $title
+ * @var MultipersonsearchController $controller
+ * @var string $name
+ * @var array $selectableUsersHidden
+ * @var array $selectedUsersHidden
+ * @var array $quickfilter
+ * @var array $selectableUsers
+ * @var array $selectedUsers
+ * @var string $search
+ * @var string $searchPreset
+ * @var string $additionHTML
+ */
+?>
<? if (isset($title)): ?>
<h1><?= htmlReady($title) ?></h1>
<? endif; ?>
-<form method="POST" action="<?= $controller->url_for("multipersonsearch/no_js_form/?name=" . $name) ?>">
+<form method="post" action="<?= $controller->link_for('multipersonsearch/no_js_form/?name=' . $name) ?>">
<input type="hidden" name="search_persons_selectable_hidden" value="<?=htmlReady(json_encode($selectableUsersHidden))?>">
<input type="hidden" name="search_persons_selected_hidden" value="<?=htmlspecialchars(json_encode($selectedUsersHidden))?>">
- <input type="hidden" name="last_search_hidden" value="<?= $search?>">
- <input type="hidden" name="last_search_preset" value="<?= $searchPreset?>">
+ <input type="hidden" name="last_search_hidden" value="<?= htmlReady($search) ?>">
+ <input type="hidden" name="last_search_preset" value="<?= htmlReady($searchPreset ?? '') ?>">
<input type="hidden" name="not_first_call" value="true">
<?= CSRFProtection::tokenTag() ?>
@@ -14,23 +29,31 @@
<label>
<input name="freesearch" type="text" placeholder="<?=_('Suchen')?>"
aria-label="<?= _('Suchbegriff') ?>" style="width: 45%" value="<?= $search ?>">
- <?= Icon::create('search', 'clickable', ['title' => _('Suche starten')])->asInput(['name'=>'submit_search','class'=>'stay_on_dialog',]) ?>
+ <?= Icon::create('search')->asInput([
+ 'name' =>'submit_search',
+ 'class' =>'stay_on_dialog',
+ 'title' => _('Suche starten')
+ ]) ?>
</label>
<br><br>
<select name="search_preset" aria-label="<?= _('Vorauswahl bestimmter Bereiche, alternativ zur Suche') ?>" style="width: 45%">
<option><?=_('--- Suchvorlagen ---')?></option>
<? foreach ($quickfilter as $title) : ?>
- <option value="<?= htmlReady($title) ?>" <?= $searchPreset == $title ? "selected" : ""; ?>>
+ <option value="<?= htmlReady($title) ?>" <?= isset($searchPreset) && $searchPreset === $title ? 'selected' : '' ?>>
<?= $title; ?>
</option>
<? endforeach; ?>
</select>
- <?= Icon::create('accept', 'clickable', ['title' => _('Vorauswahl anwenden')])->asInput(['name'=>'submit_search_preset','class'=>'stay_on_dialog']) ?>
+ <?= Icon::create('accept')->asInput([
+ 'name' =>'submit_search_preset',
+ 'class' =>'stay_on_dialog',
+ 'title' => _('Vorauswahl anwenden')
+ ]) ?>
<div id="search_persons_content">
<div style="display: inline-block; float: left; width: 44%; height: 100%">
<label><?=_('Suchergebnis')?><br>
- <select id="search_persons_selectable" name="search_persons_selectable[]" style="minWidth: 200px; width: 100%; height: 116px" style="height: 16px" multiple
+ <select id="search_persons_selectable" name="search_persons_selectable[]" style="min-width: 200px; width: 100%; height: 116px" style="height: 16px" multiple
aria-label="<?= _('Gefundene Personen, die der Gruppe hinzugefügt werden können') ?>">
<? if (count($selectableUsers) == 0) : ?>
<option disabled><?= _("Keine neuen Suchergebnisse gefunden"); ?></option>
@@ -46,31 +69,35 @@
<br>
<br>
<br>
- <?= Icon::create('arr_2right', 'clickable', ['title' => _('In den Suchergebnissen markierte Bereiche der Gruppe hinzufügen')])
+ <?= Icon::create('arr_2right')
->asInput([
'id' => 'search_persons_add',
'name' => 'search_persons_add',
- 'class' => 'stay_on_dialog']) ?>
+ 'class' => 'stay_on_dialog',
+ 'title' => _('In den Suchergebnissen markierte Bereiche der Gruppe hinzufügen')
+ ]) ?>
<br><br>
- <?= Icon::create('arr_2left', 'clickable', ['title' => _('Bei den bereits ausgewählten Personen die markierten Personen entfernen')])
+ <?= Icon::create('arr_2left')
->asInput([
'id' => 'search_persons_remove',
'name' => 'search_persons_remove',
- 'class' => 'stay_on_dialog']) ?>
+ 'class' => 'stay_on_dialog',
+ 'title' => _('Bei den bereits ausgewählten Personen die markierten Personen entfernen')
+ ]) ?>
</div>
<div style="display: inline-block; float: right; width: 44%">
<label>
<div>
<? $selectedCount = count($selectedUsers);
- if ($selectedCount == 0) : ?>
+ if ($selectedCount === 0) : ?>
<?=_('Niemand wurde ausgewählt.')?>
- <? elseif ($selectedCount == 1) : ?>
+ <? elseif ($selectedCount === 1) : ?>
<?=_('Eine Person wurde ausgewählt')?>
<? else : ?>
<?=sprintf(_('%s Personen wurden ausgewählt.'), $selectedCount)?>
<? endif ?>
</div>
- <select id="search_persons_selected" name="search_persons_selected[]" style="minWidth: 200px; width: 100%; height: 116px" size="7" multiple
+ <select id="search_persons_selected" name="search_persons_selected[]" style="min-width: 200px; width: 100%; height: 116px" size="7" multiple
aria-label="<?= _('Personen, die in die Gruppe eingetragen werden') ?>"
>
<? foreach ($selectedUsers as $user): ?>