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

prevent warnings in admin-va, fixes #4809

Closes #4809

Merge request studip/studip!3600
parent 1b6f5184
No related branches found
No related tags found
No related merge requests found
......@@ -429,7 +429,6 @@ class Admin_CoursesController extends AuthenticatedController
break;
case 8: //Sperrebenen
$template = $tf->open('admin/courses/lock_preselect');
$template->course = $course;
$template->all_lock_rules = new SimpleCollection(array_merge(
[[
'name' => '--' . _('keine Sperrebene') . '--',
......@@ -446,7 +445,6 @@ class Admin_CoursesController extends AuthenticatedController
break;
case 10: //Zusatzangaben
$template = $tf->open('admin/courses/aux_preselect');
$template->course = $course;
$template->aux_lock_rules = AuxLockRule::findBySQL('1 ORDER BY name ASC');
$data['buttons_top'] = $template->render();
$data['buttons_bottom'] = (string) \Studip\Button::createAccept(_('Zusatzangaben'), 'aux_button', ['formaction' => URLHelper::getURL('dispatch.php/admin/courses/set_aux_lockrule')]);
......
<?php
/**
* @var string $colspan
* @var string $selected_action
* @var string $selected_action
* @var array $values
*/
?>
<tr>
<th colspan="<?= $colspan ?>" style="text-align: right">
<? switch ($selected_action) {
case 8 :
echo $this->render_partial('admin/courses/lock_preselect.php', compact('values', 'semid'));
break;
default:
case 9:
echo '<label>', _('Alle auswählen'), '<input title="', _('Alle auswählen'), '"
type="checkbox" name="all" value="1" data-proxyfor=".course-admin td:last-child :checkbox" aria-label="',
_('Alle auswählen'), '"/></label>';
break;
case 10:
echo $this->render_partial('admin/courses/aux_preselect.php', compact('values', 'semid'));
break;
case 16:
echo '<label>', _('Alle auswählen'), '<input title="', _('Alle auswählen'), '"
type="checkbox" name="all" value="1" data-proxyfor=":checkbox[name^=archiv_sem]" aria-label="',
_('Alle auswählen'), '"/></label>';
break;
case 17:
echo '<label>', _('Alle auswählen'), '<input title="', _('Alle auswählen'), '"
type="checkbox" name="all" value="1" data-proxyfor=":checkbox[name^=admission_locked]" aria-label="',
_('Alle auswählen'), '"/></label>';
break;
}?>
</th>
</tr>
<?php
/**
* @var array $values
* @var AuxLockRule[] $aux_lock_rules
*/
?>
<label><?= _('Für alle Veranstaltungen') ?>
<select name="lock_sem_all" style="max-width: 200px">
<option value="none">
--<?= _('keine Zusatzangaben') ?>--
</option>
<? foreach ($aux_lock_rules as $rule) : ?>
<option value="<?= htmlReady($rule->id) ?>"
<? if ($values['aux_lock_rule'] === $rule->id) echo 'selected'; ?>>
<option value="<?= htmlReady($rule->id) ?>">
<?= htmlReady($rule->name) ?>
</option>
<? endforeach ?>
......
<?php
/**
* @var Course $course
* @var SimpleCollection $all_lock_rules
*/
?>
<label><?= _('Für alle Veranstaltungen') ?>
<select name="lock_sem_all" style="max-width: 200px">
<? for ($i = 0; $i < count($all_lock_rules); $i++) : ?>
<option value="<?= $all_lock_rules[$i]["lock_id"] ?>"
<?= $all_lock_rules[$i]['lock_id'] === $course->lock_rule ? 'selected' : '' ?>>
<?= htmlReady($all_lock_rules[$i]["name"]) ?>
<? foreach ($all_lock_rules as $lock_rule): ?>
<option value="<?= htmlReady($lock_rule->id) ?>">
<?= htmlReady($lock_rule->name) ?>
</option>
<? endfor ?>
<? endforeach ?>
</select>
</label>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment