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

prevent php-warnings in waitinglist, fixes #4603

Closes #4603

Merge request studip/studip!3415
parent a9ae4040
No related branches found
No related tags found
No related merge requests found
<?php
/***
* @var array $waiting_list
* @var MyCoursesController $controller
*/
?>
<? if (empty($waiting_list)) : ?>
<table class="default collapsable" id="my_waitlists"> <table class="default collapsable" id="my_waitlists">
<caption> <caption>
<?= _("Anmelde- und Wartelisteneinträge") ?> <?= _('Anmelde- und Wartelisteneinträge') ?>
</caption> </caption>
<colgroup class="hidden-small-down"> <colgroup class="hidden-small-down">
<col width="1px"> <col style="width: 1px">
<col width="65%"> <col style="width: 65%">
<col width="7%"> <col style="width: 7%">
<col width="10%"> <col style="width: 10%">
<col width="10%"> <col style="width: 10%">
<col width="15%"> <col style="width: 15%">
<col width="3%"> <col style="width: 3%">
</colgroup> </colgroup>
<colgroup class="hidden-medium-up"> <colgroup class="hidden-medium-up">
<col width="1px"> <col style="width: 1px">
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th style="text-align: left"><?= _("Name") ?></th> <th style="text-align: left"><?= _('Name') ?></th>
<th class="hidden-small-down"><?= _('Inhalt') ?></th> <th class="hidden-small-down"><?= _('Inhalt') ?></th>
<th style="text-align: center"><?= _("Datum") ?></th> <th style="text-align: center"><?= _('Datum') ?></th>
<th class="hidden-small-down" style="text-wrap: none; white-space: nowrap"><b><?= _("Position/Chance") ?></th> <th class="hidden-small-down"
<th class="hidden-small-down"><?= _("Art") ?></th> style="text-wrap: nowrap; white-space: nowrap"><?= _('Position/Chance') ?></th>
<th class="hidden-small-down"><?= _('Art') ?></th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<? foreach ($waiting_list as $wait) { <? foreach ($waiting_list as $wait) : ?>
<?php
// wir sind in einer Anmeldeliste und brauchen Prozentangaben // wir sind in einer Anmeldeliste und brauchen Prozentangaben
if ($wait["status"] == "claiming") { if ($wait['status'] === 'claiming') {
// Grün der Farbe nimmt mit Wahrscheinlichkeit ab // Grün der Farbe nimmt mit Wahrscheinlichkeit ab
$chance_color = dechex(55 + $wait['admission_chance'] * 2); $chance_color = dechex(55 + $wait['admission_chance'] * 2);
} // wir sind in einer Warteliste } // wir sind in einer Warteliste
else { else {
$chance_color = $wait["position"] < 30 $chance_color = $wait['position'] < 30 ? dechex(255 - $wait['position'] * 6) : 44;
? dechex(255 - $wait["position"] * 6)
: 44;
} }
$seminar_name = $wait["Name"]; $seminar_name = $wait["Name"];
if (SeminarCategories::GetByTypeId($wait['sem_status'])->studygroup_mode) { if (!empty($wait['sem_status']) && SeminarCategories::GetByTypeId($wait['sem_status'])->studygroup_mode) {
$seminar_name .= ' (' . _("Studiengruppe") . ', ' . _("geschlossen") . ')'; $seminar_name .= ' (' . _('Studiengruppe') . ', ' . _('geschlossen') . ')';
} }
?> ?>
<tr> <tr>
<td title="<?=_("Position oder Wahrscheinlichkeit")?>" style="background:#44<?= $chance_color ?>44"> <td title="<?= _('Position oder Wahrscheinlichkeit') ?>" style="background:#44<?= $chance_color ?>44">
</td> </td>
<td> <td>
<a href="<?= URLHelper::getLink('dispatch.php/course/details/', ['sem_id' => $wait['seminar_id'], 'send_from_search_page' => 'dispatch.php/my_courses/index', 'send_from_search' => 'TRUE']) ?>"> <a href="<?= URLHelper::getLink('dispatch.php/course/details/', [
'sem_id' => $wait['seminar_id'],
'send_from_search_page' => 'dispatch.php/my_courses/index',
'send_from_search' => 'TRUE'
]) ?>">
<?= htmlReady($seminar_name) ?> <?= htmlReady($seminar_name) ?>
</a> </a>
<?php if ($wait['status'] === 'claiming') : ?> <?php if ($wait['status'] === 'claiming') : ?>
...@@ -59,9 +72,11 @@ ...@@ -59,9 +72,11 @@
<?php endif ?> <?php endif ?>
</td> </td>
<td class="hidden-small-down"> <td class="hidden-small-down">
<a data-dialog="size=auto" href="<?= $controller->link_for('course/details/index', $wait['seminar_id']) ?>"> <a data-dialog="size=auto"
<? $params = tooltip2(_("Veranstaltungsdetails anzeigen")); ?> href="<?= $controller->link_for('course/details/index', $wait['seminar_id']) ?>"
<?= Icon::create('info-circle', Icon::ROLE_INACTIVE)->asImg(20, ['style' => 'cursor: pointer']) ?> >
<? $params = tooltip2(_('Veranstaltungsdetails anzeigen')) ?>
<?= Icon::create('info-circle', Icon::ROLE_INACTIVE)->asImg(['style' => 'cursor: pointer']) ?>
</a> </a>
</td> </td>
<td style="text-align: center"> <td style="text-align: center">
...@@ -74,7 +89,7 @@ ...@@ -74,7 +89,7 @@
<td class="hidden-small-down" style="text-align: center"> <td class="hidden-small-down" style="text-align: center">
<? if ($wait['status'] === 'claiming') : ?> <? if ($wait['status'] === 'claiming') : ?>
<?= _("Autom.") ?> <?= _('Autom.') ?>
<? elseif ($wait['status'] === 'accepted') : ?> <? elseif ($wait['status'] === 'accepted') : ?>
<?= _('Vorl.') ?> <?= _('Vorl.') ?>
<? else: ?> <? else: ?>
...@@ -83,19 +98,20 @@ ...@@ -83,19 +98,20 @@
</td> </td>
<td style="text-align: right"> <td style="text-align: right">
<? if ($wait["status"] == "accepted" && $wait['admission_binding']) : ?> <? if ($wait['status'] === 'accepted' && $wait['admission_binding']) : ?>
<a href="<?= $controller->url_for('my_courses/decline_binding') ?>"> <a href="<?= $controller->url_for('my_courses/decline_binding') ?>">
<?= Icon::create('door-leave', 'inactive', ['title' => _("Die Teilnahme ist bindend. Bitte wenden Sie sich an die Lehrenden.")])->asImg(20) ?> <?= Icon::create('door-leave', Icon::ROLE_INACTIVE)->asImg(['title' => _('Die Teilnahme ist bindend. Bitte wenden Sie sich an die Lehrenden.')]) ?>
</a> </a>
<? else : ?> <? else : ?>
<a href="<?= $controller->link_for('my_courses/decline', $wait['seminar_id'], ['cmd' => 'suppose_to_kill_admission']) ?>"> <a href="<?= $controller->link_for('my_courses/decline', $wait['seminar_id'], ['cmd' => 'suppose_to_kill_admission']) ?>">
<?= Icon::create('door-leave', Icon::ROLE_INACTIVE)->asImg(20, ['title' => _("aus der Veranstaltung abmelden")]) ?> <?= Icon::create('door-leave', Icon::ROLE_INACTIVE)->asImg(['title' => _('aus der Veranstaltung abmelden')]) ?>
</a> </a>
<? endif ?> <? endif ?>
</td> </td>
</tr> </tr>
<? } ?> <? endforeach ?>
</tbody> </tbody>
</table> </table>
<br> <br>
<br> <br>
<? endif ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment