diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-11-30 10:07:47 +0000 |
|---|---|---|
| committer | Till Glöggler <tgloeggl@uos.de> | 2022-11-30 10:07:47 +0000 |
| commit | 42c9c67e4d9b1d424129d8110bc49d02fca82ecd (patch) | |
| tree | 66813f21fc70c10ef96967aee6c15909b9f21489 /app | |
| parent | 5d86de14a9f056a39072888e4f0fe61d4647510e (diff) | |
fixes #1815
Closes #1815
Merge request studip/studip!1207
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/consultation/admin.php | 4 | ||||
| -rw-r--r-- | app/views/consultation/admin/block-responsibilities.php | 6 | ||||
| -rw-r--r-- | app/views/consultation/admin/create.php | 22 |
3 files changed, 31 insertions, 1 deletions
diff --git a/app/controllers/consultation/admin.php b/app/controllers/consultation/admin.php index 737a667..bad2421 100644 --- a/app/controllers/consultation/admin.php +++ b/app/controllers/consultation/admin.php @@ -168,6 +168,10 @@ class Consultation_AdminController extends ConsultationController throw new InvalidArgumentException(_('Die definierte Zeit bis zur Pause ist kleiner als die Dauer eines Termins.')); } + if ($this->range instanceof Institute && !Request::getArray('responsibilities')) { + throw new InvalidArgumentException(_('Es muss mindestens eine durchführende Person, Statusgruppe oder Einrichtung ausgewählt werden.')); + } + $slot_count = ConsultationBlock::countSlots( $start, $end, diff --git a/app/views/consultation/admin/block-responsibilities.php b/app/views/consultation/admin/block-responsibilities.php index 4d1b5ee..82f4586 100644 --- a/app/views/consultation/admin/block-responsibilities.php +++ b/app/views/consultation/admin/block-responsibilities.php @@ -1,5 +1,9 @@ <?php -$block = $block ?? false; +/** + * @var ConsultationBlock|null $block + */ + +$block = $block ?? null; $selected = function ($type, $id) use ($block) { if (!$block ) { return ''; diff --git a/app/views/consultation/admin/create.php b/app/views/consultation/admin/create.php index 31f2b6f..aa4ee30 100644 --- a/app/views/consultation/admin/create.php +++ b/app/views/consultation/admin/create.php @@ -1,4 +1,12 @@ <?php +/** + * @var Consultation_AdminController $controller + * @var Trails_Flash $flash + * @var string|null $room + * @var array $responsible + * @var Range $range + */ + $days_of_the_week = [ _('Montag') => 1, _('Dienstag') => 2, @@ -158,6 +166,20 @@ $intervals = [ <fieldset> <legend><?= _('Durchführende Personen, Gruppen oder Einrichtungen') ?></legend> + <? if ($range instanceof Institute): ?> + <p> + <?= _('Bei Einrichtungen muss mindestens eine durchführende Person, Gruppe oder Einrichtung zugewiesen ' + . 'werden.') ?> + </p> + <p> + <?= _('Bitte beachten Sie, dass bei Zuweisungen von Statusgruppen alle Personen der Gruppe mit dem Status ' + . '"tutor" und "dozent" als durchführende Personen zugewiesen werden und über alle Buchungen ' + . 'informiert werden.') ?> + <?= _('Gleiches gilt für eine zugewiesene Einrichtung. Bitte achten Sie darauf, dass Sie Ihre hier ' + . ' getroffene Auswahl in Absprache tätigen.') ?> + </p> + <? endif; ?> + <?= $this->render_partial('consultation/admin/block-responsibilities.php', compact('responsible')) ?> </fieldset> <? endif; ?> |
