Skip to content
Snippets Groups Projects
Commit 1872a8ee authored by David Siegfried's avatar David Siegfried
Browse files

prevent php-warnings, closes #2297

Closes #2297

Merge request studip/studip!1519
parent f3a49e4b
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
...@@ -10,7 +10,7 @@ $courseIds = $courseset ? $courseset->getCourses() : []; ...@@ -10,7 +10,7 @@ $courseIds = $courseset ? $courseset->getCourses() : [];
// Load assigned user list IDs. // Load assigned user list IDs.
$userlistIds = $courseset ? $courseset->getUserlists() : []; $userlistIds = $courseset ? $courseset->getUserlists() : [];
if ($flash['error']) { if (isset($flash['error'])) {
echo MessageBox::error($flash['error']); echo MessageBox::error($flash['error']);
} }
?> ?>
...@@ -62,9 +62,9 @@ if ($flash['error']) { ...@@ -62,9 +62,9 @@ if ($flash['error']) {
<?= $instTpl ?> <?= $instTpl ?>
<?php } else { ?> <?php } else { ?>
<?php foreach ($myInstitutes as $institute) { ?> <?php foreach ($myInstitutes as $institute) { ?>
<?php if (sizeof($myInstitutes) != 1) { ?> <?php if (count($myInstitutes) !== 1) { ?>
<input type="checkbox" name="institutes[]" value="<?= $institute['Institut_id'] ?>" <input type="checkbox" name="institutes[]" value="<?= $institute['Institut_id'] ?>"
<?= $selectedInstitutes[$institute['Institut_id']] ? 'checked="checked"' : '' ?> <?= !empty($selectedInstitutes[$institute['Institut_id']]) ? 'checked' : '' ?>
class="institute" onclick="STUDIP.Admission.getCourses( class="institute" onclick="STUDIP.Admission.getCourses(
'<?= $controller->url_for('admission/courseset/instcourses', $courseset ? $courseset->getId() : '') ?>')"/> '<?= $controller->url_for('admission/courseset/instcourses', $courseset ? $courseset->getId() : '') ?>')"/>
<?php } else { ?> <?php } else { ?>
...@@ -77,9 +77,13 @@ if ($flash['error']) { ...@@ -77,9 +77,13 @@ if ($flash['error']) {
<?php } else { ?> <?php } else { ?>
<?php if ($instSearch) { ?> <?php if ($instSearch) { ?>
<div id="institutes"> <div id="institutes">
<?= Icon::create('arr_2down', 'sort', ['title' => _('Einrichtung hinzufügen')])->asImg(16, ["alt" => _('Einrichtung hinzufügen'), "onclick" => "STUDIP.Admission.updateInstitutes($('input[name=\"institute_id\"]').val(), '".$controller->url_for('admission/courseset/institutes',$courseset?$courseset->getId():'')."', '".$controller->url_for('admission/courseset/instcourses',$courseset?$courseset->getId():'')."', 'add')"]) ?> <?= Icon::create('arr_2down', Icon::ROLE_SORT)->asImg([
'title' => _('Einrichtung hinzufügen'),
'alt' => _('Einrichtung hinzufügen'),
'onclick' => "STUDIP.Admission.updateInstitutes($('input[name=\"institute_id\"]').val(), '" .$controller->url_for('admission/courseset/institutes',$courseset?$courseset->getId() : '') . "', '" . $controller->url_for('admission/courseset/instcourses',$courseset?$courseset->getId() : '') . "', 'add')"
]) ?>
<?= $instSearch ?> <?= $instSearch ?>
<?= Icon::create('search', 'clickable', ['title' => _("Suche starten")])->asImg()?> <?= Icon::create('search')->asImg(['title' => _("Suche starten")])?>
</div> </div>
<i><?= _('Sie haben noch keine Einrichtung ausgewählt. Benutzen Sie obige Suche, um dies zu tun.') ?></i> <i><?= _('Sie haben noch keine Einrichtung ausgewählt. Benutzen Sie obige Suche, um dies zu tun.') ?></i>
<?php } else { ?> <?php } else { ?>
...@@ -101,7 +105,7 @@ if ($flash['error']) { ...@@ -101,7 +105,7 @@ if ($flash['error']) {
<?= _('Semester') ?> <?= _('Semester') ?>
<select name="semester" onchange="STUDIP.Admission.getCourses('<?= $controller->url_for('admission/courseset/instcourses', $courseset ? $courseset->getId() : '') ?>')"> <select name="semester" onchange="STUDIP.Admission.getCourses('<?= $controller->url_for('admission/courseset/instcourses', $courseset ? $courseset->getId() : '') ?>')">
<?php foreach(array_reverse(Semester::getAll(), true) as $id => $semester) { ?> <?php foreach(array_reverse(Semester::getAll(), true) as $id => $semester) { ?>
<option value="<?= $id ?>"<?= $id == $selectedSemester ? ' selected="selected"' : '' ?>> <option value="<?= $id ?>"<?= $id === $selectedSemester ? ' selected' : '' ?>>
<?= htmlReady($semester->name) ?> <?= htmlReady($semester->name) ?>
</option> </option>
<?php } ?> <?php } ?>
...@@ -203,14 +207,12 @@ if ($flash['error']) { ...@@ -203,14 +207,12 @@ if ($flash['error']) {
<i><?= _('Sie haben noch keine Personenlisten angelegt.') ?></i> <i><?= _('Sie haben noch keine Personenlisten angelegt.') ?></i>
<?php <?php
}?> }?>
<? if ($courseset) : ?>
<div> <div>
<?= LinkButton::create(_('Liste der Nutzer'), <?= LinkButton::create(_('Liste der Nutzer'),
$controller->url_for('admission/courseset/factored_users/' . $courseset->getId()), $controller->url_for('admission/courseset/factored_users/' . $courseset->getId()),
['data-dialog' => ''] ['data-dialog' => '']
); ?> ); ?>
</div> </div>
<? endif ?>
<?php <?php
// Keep lists that were assigned by other users. // Keep lists that were assigned by other users.
foreach ($userlistIds as $list) { foreach ($userlistIds as $list) {
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
<?= tooltipIcon(_('vorläufige Teilnahme: ') . $course['count_prelim']) ?> <?= tooltipIcon(_('vorläufige Teilnahme: ') . $course['count_prelim']) ?>
<? endif ?> <? endif ?>
</td> </td>
<td data-value="<?= $course['count_claiming'] ?: 0 ?>"> <td data-value="<?= $course['count_claiming'] ?? 0 ?>">
<?= htmlReady(isset($course['count_claiming']) ? $course['count_claiming'] : '-') ?> <?= htmlReady(isset($course['count_claiming']) ? $course['count_claiming'] : '-') ?>
</td> </td>
<td data-sort-value="<?= $course['count_waiting'] ?: 0 ?>"> <td data-sort-value="<?= $course['count_waiting'] ?? 0 ?>">
<?= htmlReady(isset($course['count_waiting']) ? $course['count_waiting'] : '-') ?> <?= htmlReady(isset($course['count_waiting']) ? $course['count_waiting'] : '-') ?>
</td> </td>
<td style="white-space:nowrap" data-sort-value="<?= (int) $course['distribution_time']?>"> <td style="white-space:nowrap" data-sort-value="<?= (int) $course['distribution_time']?>">
......
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