diff --git a/app/controllers/course/enrolment.php b/app/controllers/course/enrolment.php index bfc94b33986714c2ccbfa122714e8a854a756c3f..a2d3c9cf26bb3159a32afbaf0e938136e8b971aa 100644 --- a/app/controllers/course/enrolment.php +++ b/app/controllers/course/enrolment.php @@ -124,7 +124,6 @@ class Course_EnrolmentController extends AuthenticatedController } else { $msg = _("Die Plätze in dieser Veranstaltung werden automatisch verteilt."); if ($limit = $courseset->getAdmissionRule('LimitedAdmission')) { - $msg_details[] = sprintf(_("Diese Veranstaltung gehört zu einem Anmeldeset mit %s Veranstaltungen. Sie können maximal %s davon belegen. Bei der Verteilung werden die von Ihnen gewünschten Prioritäten berücksichtigt."), count($courseset->getCourses()), $limit->getMaxNumber()); $this->user_max_limit = $limit->getMaxNumberForUser($user_id); if (Config::get()->IMPORTANT_SEMNUMBER) { $order = "ORDER BY VeranstaltungsNummer, Name"; @@ -132,6 +131,14 @@ class Course_EnrolmentController extends AuthenticatedController $order = "ORDER BY Name"; } $this->priocourses = Course::findMany($courseset->getCourses(), $order); + if (!$GLOBALS['perm']->have_perm(Config::get()->SEM_VISIBILITY_PERM)) { + $this->priocourses = array_filter($this->priocourses, + function ($c) { + return $c->visible; + } + ); + } + $msg_details[] = sprintf(_("Diese Veranstaltung gehört zu einem Anmeldeset mit %s Veranstaltungen. Sie können maximal %s davon belegen. Bei der Verteilung werden die von Ihnen gewünschten Prioritäten berücksichtigt."), count($this->priocourses), $limit->getMaxNumber()); $this->user_prio = AdmissionPriority::getPrioritiesByUser($courseset->getId(), $user_id); $this->max_limit = $limit->getMaxNumber(); $this->prio_stats = AdmissionPriority::getPrioritiesStats($courseset->getId()); diff --git a/lib/classes/admission/CourseSet.class.php b/lib/classes/admission/CourseSet.class.php index 5bfb440abc4d440a8ffe79a6e4251b4694f37c27..50f983fbc054536ad7fba909415c955f0b87328e 100644 --- a/lib/classes/admission/CourseSet.class.php +++ b/lib/classes/admission/CourseSet.class.php @@ -1005,11 +1005,21 @@ class CourseSet } if (!$short || $this->hasAdmissionRule('LimitedAdmission')) { $courses = Course::findAndMapMany(function($c) { - return ['id' => $c->id, - 'name' => $c->getFullname('number-name-semester')]; + return [ + 'id' => $c->id, + 'name' => $c->getFullname('number-name-semester'), + 'visible' => $c->visible + ]; }, array_keys($this->courses), 'ORDER BY start_time,VeranstaltungsNummer,Name'); + if (!$GLOBALS['perm']->have_perm(Config::get()->SEM_VISIBILITY_PERM)) { + $courses = array_filter($courses, + function ($c) { + return $c['visible']; + } + ); + } $tpl->set_attribute('is_limited', $this->hasAdmissionRule('LimitedAdmission')); $tpl->set_attribute('courses', $courses); } diff --git a/templates/admission/courseset/info.php b/templates/admission/courseset/info.php index 265dbeeebece1af4f1da100f9583ff0276eab5ed..37d9999df0f1b771bb5eff93d4d611c9798a5075 100644 --- a/templates/admission/courseset/info.php +++ b/templates/admission/courseset/info.php @@ -25,9 +25,10 @@ <?php foreach ($courses as $course) { ?> <li> <? if ($is_limited) : ?> - <a href="<?= URLHelper::getLink('dispatch.php/course/details/', ['cid' => null, 'sem_id' => $course['id']])?>"><?= htmlReady($course['name']) ?></a> + <a href="<?= URLHelper::getLink('dispatch.php/course/details/', ['cid' => null, 'sem_id' => $course['id']])?>"><?= htmlReady($course['name']) . (!$course['visible'] ? ' (' . _("versteckt") . ')' : '') ?></a> <? else : ?> <?= htmlReady($course['name']) ?> + <?= (!$course['visible'] ? ' (' . _("versteckt") . ')' : '') ?> <? endif ?> </li> <?php } ?>