diff options
| author | Peter Thienel <thienel@data-quest.de> | 2025-06-26 16:44:58 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2025-06-26 16:44:58 +0000 |
| commit | 6f7299342e86431a2ebd3a6197a985d1653b1dd2 (patch) | |
| tree | cc52bc96e0cad1ca0c0a33c4dcb048746db4ff83 /app/views/shared/modul/overview.php | |
| parent | 176cf83d651b28f1d19895af375cef66292624ef (diff) | |
Resolve "Erweiterung der Modulverwaltung um Studiengangsspezifische Informationen"
Closes #5383
Merge request studip/studip!4051
Diffstat (limited to 'app/views/shared/modul/overview.php')
| -rw-r--r-- | app/views/shared/modul/overview.php | 130 |
1 files changed, 66 insertions, 64 deletions
diff --git a/app/views/shared/modul/overview.php b/app/views/shared/modul/overview.php index be91c7a..16695bd 100644 --- a/app/views/shared/modul/overview.php +++ b/app/views/shared/modul/overview.php @@ -1,26 +1,32 @@ <?php /** * @var Modul $modul - * @var Institute $institut - * @var ModulDeskriptor $deskriptor - * @var array $modulteile * @var Semester $semester * @var string $pruef_ebene * @var int $type + * @var string $code + * @var string $title */ ?> +<? $deskriptor = $modul->getDeskriptor() ?> <table class="default mvv-modul-details nohover"> <tr> - <th class="mvv-modul-details-head" style="width: 30%"><?= htmlReady($modul->code) ?></th> - <th class="mvv-modul-details-head" style="width: 30%"><?= htmlReady($institut->name) ?></th> - <th class="mvv-modul-details-head" style="width: 40%"><?= sprintf("%d CP", $modul->kp) ?> </th> - <th class="mvv-modul-details-head"></th> + <th class="mvv-modul-details-head" style="width: 30%"> + <?= htmlReady($code ?: $modul->code) ?> + </th> + <th class="mvv-modul-details-head" style="width: 30%"> + <?= $modul->responsible_institute ? htmlReady($modul->responsible_institute->institute->name) : '' ?> + </th> + <th class="mvv-modul-details-head" style="width: 40%"></th> + <th class="mvv-modul-details-head" style="white-space: nowrap;"> + <?= sprintf("%d CP", $modul->getReplacedValue('kp')) ?> + </th> </tr> <tr> <td colspan="2"> - <h3><?= htmlReady($deskriptor->bezeichnung) ?></h3> - <?= _('Lehrveranstaltungen') ?> <?= htmlReady($semester['name']) ?> + <h3><?= htmlReady($title ?: $deskriptor->bezeichnung) ?></h3> + <?= _('Lehrveranstaltungen') ?> <?= htmlReady($semester->name) ?> </td> <td> <dl> @@ -37,8 +43,8 @@ </td> <td> <? if ($GLOBALS['perm']->have_perm('admin')) : ?> - <a href="<?= URLHelper::getLink("dispatch.php/shared/modul/mail/{$modul->id}/{$semester['semester_id']}")?>" data-dialog> - <?= Icon::create('mail', Icon::ROLE_CLICKABLE, tooltip2(_('Nachricht an alle Veranstaltungteilnehmer die diesem Modul zugeordnet sind.')))?> + <a href="<?= URLHelper::getLink("dispatch.php/shared/modul/mail/{$modul->id}/{$semester->id}")?>" data-dialog> + <?= Icon::create('mail', Icon::ROLE_CLICKABLE, tooltip2(_('Nachricht an alle Teilnehmenden der Veranstaltungen, die diesem Modul zugeordnet sind.')))?> </a> <? endif; ?> </td> @@ -46,22 +52,22 @@ <tr> <td colspan="4" style="padding: 0;"> <table class="default nohover"> - <? if (mb_strlen($deskriptor->voraussetzung) > 0): ?> + <? if (mb_strlen($deskriptor->getReplacedValue('voraussetzung')) > 0): ?> <tr> <td style="width: 20%; font-weight: bold;"><?= _('Teilnahmevoraussetzungen') ?></td> - <td ><?= formatReady($deskriptor->voraussetzung) ?></td> + <td ><?= formatReady($deskriptor->getReplacedValue('voraussetzung')) ?></td> </tr> <? endif; ?> - <? if (mb_strlen($deskriptor->kommentar)) : ?> + <? if (mb_strlen($deskriptor->getReplacedValue('kommentar'))) : ?> <tr> <td style="width: 20%; font-weight: bold;"><?= _('Hinweise') ?></td> - <td><?= formatReady($deskriptor->kommentar) ?></td> + <td><?= formatReady($deskriptor->getReplacedValue('kommentar')) ?></td> </tr> <? endif; ?> <? if (mb_strlen($deskriptor->ersatztext) > 0): ?> <tr> <td style="width: 20%; font-weight: bold;"> </td> - <td><?= formatReady($deskriptor->ersatztext) ?></td> + <td><?= formatReady($deskriptor->getReplacedValue('ersatztext')) ?></td> </tr> <? else: ?> @@ -70,8 +76,8 @@ <td style="width: 20%; font-weight: bold;"><?= _('Kapazität Modul') ?></td> <td> <?= htmlReady($modul->kapazitaet) ?> - <? if (mb_strlen($deskriptor->kommentar_kapazitaet) > 0): ?> - (<?= formatReady($deskriptor->kommentar_kapazitaet) ?>) + <? if (mb_strlen($deskriptor->getReplacedValue('kommentar_kapazitaet')) > 0): ?> + (<?= formatReady($deskriptor->getReplacedValue('kommentar_kapazitaet')) ?>) <? endif; ?> </td> @@ -83,22 +89,22 @@ <td><?= htmlReady($pruef_ebene) ?></td> </tr> <? endif; ?> - <? if (mb_strlen($deskriptor->pruef_vorleistung)) : ?> + <? if (mb_strlen($deskriptor->getReplacedValue('pruef_vorleistung'))) : ?> <tr> <td style="width: 20%; font-weight: bold;"><?= _('Prüfungsvorleistung Modul') ?></td> - <td><?= formatReady($deskriptor->pruef_vorleistung) ?></td> + <td><?= formatReady($deskriptor->getReplacedValue('pruef_vorleistung')) ?></td> </tr> <? endif; ?> <? if (mb_strlen($deskriptor->pruef_leistung)) : ?> <tr> <td style="width: 20%; font-weight: bold;"><?= _('Prüfungsleistung Modul') ?></td> - <td><?= formatReady($deskriptor->pruef_leistung) ?></td> + <td><?= formatReady($deskriptor->getReplacedValue('pruef_leistung')) ?></td> </tr> <? endif; ?> <? if (mb_strlen($deskriptor->kompetenzziele)): ?> <tr> <td style="width: 20%; font-weight: bold;"><?= _('Kompetenzziele') ?></td> - <td><?= formatReady($deskriptor->kompetenzziele) ?></td> + <td><?= formatReady($deskriptor->getReplacedValue('kompetenzziele')) ?></td> </tr> <? endif; ?> @@ -111,66 +117,62 @@ <? if ($type === 1): ?> <th><?= _('Modulteile') ?></th> <? endif; ?> - <th <? if ($type === 2): ?> colspan="3" <? endif; ?> ><?= _('Semesterveranstaltungen') ?></th> + <th <? if ($type === 2): ?> colspan="4" <? endif; ?> ><?= _('Semesterveranstaltungen') ?></th> <? if ($type === 1): ?> - <th><?= _('Prüfungsleistung') ?></th> + <th colspan="2"><?= _('Prüfungsleistung') ?></th> <? endif; ?> </tr> - <? foreach ($modulteile as $modul_teil): ?> + <? foreach ($modul->modulteile as $modulteil): ?> + <? $modulteil_deskriptor = $modulteil->getDeskriptor() ?> <tr> <? if ($type === 1): ?> <td> - <b> <?= htmlReady($modul_teil['name']) ?> </b> - <? if (mb_strlen($modul_teil['kommentar']) > 0): ?> - <?= $modul_teil['kommentar'] ? '<br>(' . formatReady($modul_teil['kommentar']) . ')' : '' ?> + <b> <?= htmlReady($modulteil_deskriptor->getReplacedValue('bezeichnung')) ?> </b> + <? if (mb_strlen($modulteil_deskriptor->getReplacedValue('kommentar')) > 0): ?> + <?= trim($modulteil_deskriptor->getReplacedValue('kommentar')) ? '<br>(' . formatReady($modulteil_deskriptor->getReplacedValue('kommentar')) . ')' : '' ?> <? endif; ?> - <? if (mb_strlen($modul_teil['voraussetzung']) > 0): ?> + <? if (mb_strlen($modulteil_deskriptor->getReplacedValue('voraussetzung')) > 0): ?> <br> - <b><?= _('Teilnahmevoraussetzungen') ?>:</b> <?= formatReady($modul_teil['voraussetzung']) ?> + <b><?= _('Teilnahmevoraussetzungen') ?>:</b> <?= formatReady($modulteil_deskriptor->getReplacedValue('voraussetzung')) ?> <? endif; ?> </td> <? endif; ?> <td <? if ($type === 2): ?> colspan="3" <? endif; ?>> - <? foreach ($modul_teil['lvGruppen'] as $gruppe): ?> - <? if (mb_strlen($gruppe['alt_texte']) > 0): ?> - <?= formatReady($gruppe['alt_texte']) ?> + <? foreach ($modulteil->lvgruppen as $gruppe): ?> + <? if (mb_strlen($gruppe->alttext) > 0): ?> + <?= formatReady($gruppe->alttext) ?> <? endif; ?> - <? if (count($gruppe['courses'])) : ?> + <? if (count($gruppe->courses)) : ?> <ul> - <? foreach ($gruppe['courses'] as $course): ?> + <? foreach ($gruppe->courses as $course): ?> <li> <a href="<?= URLHelper::getLink('dispatch.php/course/details', ['sem_id' => $course->id]) ?>"> - <?= htmlReady(($course['VeranstaltungsNummer'] ? $course['VeranstaltungsNummer'] . ' - ' : '') . $course['Name']) ?> + <?= htmlReady(($course->veranstaltungsnummer ? $course->veranstaltungsnummer . ' - ' : '') . $course->name) ?> </a> - <? if ($course['visible'] != 1) : ?> + <? if (!$course->visible) : ?> <em><?= _('[versteckt]') ?></em> <? endif; ?> <? if (Config::get()->COURSE_SEARCH_SHOW_ADMISSION_STATE) : ?> <? $admission_status = GlobalSearchCourses::getStatusCourseAdmission($course->id, $course->admission_prelim); ?> - <? switch ($admission_status) : - case 1: - echo Icon::create('span-2quarter', Icon::ROLE_STATUS_YELLOW, [ - 'alt' => _('Eingeschränkter Zugang'), - 'title' => _('Eingeschränkter Zugang'), - 'style' => 'vertical-align: text-bottom', - ]); - break; - case 2: - echo Icon::create('span-empty', Icon::ROLE_STATUS_RED, [ - 'alt' => _('Kein Zugang'), - 'title' => _('Kein Zugang'), - 'style' => 'vertical-align: text-bottom', - ]); - break; - default: - echo Icon::create('span-full', Icon::ROLE_STATUS_GREEN, [ - 'alt' => _('Uneingeschränkter Zugang'), - 'title' => _('Uneingeschränkter Zugang'), - 'style' => 'vertical-align: text-bottom', - ]); - endswitch; ?> + <? echo match ($admission_status) { + 1 => Icon::create('span-2quarter', Icon::ROLE_STATUS_YELLOW, [ + 'alt' => _('Eingeschränkter Zugang'), + 'title' => _('Eingeschränkter Zugang'), + 'style' => 'vertical-align: text-bottom', + ]), + 2 => Icon::create('span-empty', Icon::ROLE_STATUS_RED, [ + 'alt' => _('Kein Zugang'), + 'title' => _('Kein Zugang'), + 'style' => 'vertical-align: text-bottom', + ]), + default => Icon::create('span-full', Icon::ROLE_STATUS_GREEN, [ + 'alt' => _('Uneingeschränkter Zugang'), + 'title' => _('Uneingeschränkter Zugang'), + 'style' => 'vertical-align: text-bottom', + ]), + }; ?> <? endif; ?> </li> <? endforeach; ?> @@ -179,13 +181,13 @@ <? endforeach; ?> </td> <? if ($type === 1) : ?> - <td> - <? if (mb_strlen($modul_teil['pruef_vorleistung']) > 0) : ?> - <b><?= _('Prüfungsvorleistung') ?>:</b> <?= htmlReady($modul_teil['pruef_vorleistung']) ?> + <td colspan="2"> + <? if (mb_strlen($modulteil_deskriptor->getReplacedValue('pruef_vorleistung')) > 0) : ?> + <b><?= _('Prüfungsvorleistung') ?>:</b> <?= htmlReady($modulteil_deskriptor->getReplacedValue('pruef_vorleistung')) ?> <? endif; ?> - <? if (mb_strlen($modul_teil['pruef_leistung']) > 0) : ?> - <b><?= _('Prüfungsform') ?>:</b> <br/><?= htmlReady($modul_teil['pruef_leistung']) ?> (<?= ($modul_teil['anteil_note'] ? '(' . htmlReady($modul_teil['anteil_note']) . '%)' : '') ?> + <? if (mb_strlen($modulteil_deskriptor->pruef_leistung) > 0) : ?> + <b><?= _('Prüfungsform') ?>:</b> <br/><?= htmlReady($modulteil_deskriptor->getReplacedValue('pruef_leistung')) ?> (<?= ($modulteil->anteil_note ? '(' . htmlReady($modulteil->anteil_note) . '%)' : '') ?> <? endif; ?> </td> <? endif; ?> |
