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

prevent warnings in multiperson-search, fixes #4812

Closes #4812

Merge request studip/studip!3601
parent 660b1d5f
No related branches found
No related tags found
No related merge requests found
<?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): ?>
......
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