aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2025-07-11 14:08:41 +0200
committerThomas Hackl <hackl@data-quest.de>2025-07-11 14:08:41 +0200
commit2648404bec7a72990789b3acdf57818a8cdc7df6 (patch)
tree22b79273593d2549eb7740b448bf1c9bc81dc806
parentac233209d548f310dfa3bde658ea0383f3c55e18 (diff)
Resolve "Alte Verlinkung beim Studienbereich"
Merge request studip/studip!4332
-rw-r--r--app/views/course/details/index.php15
-rw-r--r--app/views/study_area/tree.php15
-rw-r--r--lib/modules/CoreOverview.class.php16
3 files changed, 39 insertions, 7 deletions
diff --git a/app/views/course/details/index.php b/app/views/course/details/index.php
index 583f715..57a80d6 100644
--- a/app/views/course/details/index.php
+++ b/app/views/course/details/index.php
@@ -366,7 +366,8 @@
[
'node' => $studyAreaTree,
'open' => true,
- 'dont_open' => Config::get()->COURSE_SEM_TREE_CLOSED_LEVELS
+ 'dont_open' => Config::get()->COURSE_SEM_TREE_CLOSED_LEVELS,
+ 'semester' => $course->end_semester
]
) ?>
</ul>
@@ -381,9 +382,17 @@
</header>
<section>
<ul class="list-unstyled">
- <? foreach ($study_areas as $area) : ?>
+ <?
+ $url_params = [];
+ if ($course->end_semester && $course->end_semester !== Semester::findCurrent()) {
+ $url_params['semester'] = $course->end_semester->id;
+ }
+ foreach ($study_areas as $area) : ?>
+ <?
+ $url_params['node_id'] = 'StudipStudyArea_' . $area->id;
+ ?>
<li>
- <a href="<?=URLHelper::getScriptLink('show_bereich.php?level=sbb&id=' . $area->id)?>">
+ <a href="<?= URLHelper::getLink('dispatch.php/search/courses', $url_params, true) ?>">
<?= htmlReady($area->getPath(' > ')) ?>
</a>
</li>
diff --git a/app/views/study_area/tree.php b/app/views/study_area/tree.php
index d3ec538..e89102d 100644
--- a/app/views/study_area/tree.php
+++ b/app/views/study_area/tree.php
@@ -5,8 +5,16 @@
* @var int $layer
* @var array $dont_open
* @var string $compulsory
+ * @var string|null $semester
*/
$layer = 0;
+
+$url_params = [];
+if ($semester && $semester !== Semester::findCurrent()) {
+ $url_params['semester'] = $semester->id;
+}
+$url_params['node_id'] = 'StudipStudyArea_' . $node->id;
+
?>
<li>
<? if ($node->id !== 'root' && $node->required_children): ?>
@@ -15,7 +23,7 @@ $layer = 0;
<label for='<?= htmlReady($node->id) ?>'></label>
<? if ($node->id !== 'root'): ?>
- <a href="<?= URLHelper::getLink('show_bereich.php?level=sbb&id=' . $node->id) ?>">
+ <a href="<?= URLHelper::getLink('dispatch.php/search/courses', $url_params, true) ?>">
<?= htmlReady($node->name) ?>
</a>
<? else: ?>
@@ -25,7 +33,10 @@ $layer = 0;
<? if ($node->required_children): ?>
<ul>
<? foreach ($node->required_children as $child): ?>
- <?= $this->render_partial('study_area/tree.php', ['node' => $child, 'open' => $open, 'layer' => ((int)$layer + 1)]) ?>
+ <?= $this->render_partial(
+ 'study_area/tree.php',
+ ['node' => $child, 'open' => $open, 'layer' => ((int)$layer + 1), 'semester' => $semester]
+ ) ?>
<? endforeach; ?>
</ul>
<? endif; ?>
diff --git a/lib/modules/CoreOverview.class.php b/lib/modules/CoreOverview.class.php
index 093b016..797ac92 100644
--- a/lib/modules/CoreOverview.class.php
+++ b/lib/modules/CoreOverview.class.php
@@ -90,8 +90,20 @@ class CoreOverview extends CorePlugin implements StudipModule
$navigation->setActiveImage(Icon::create('seminar', Icon::ROLE_INFO));
if ($object_type !== 'sem') {
$navigation->addSubNavigation('info', new Navigation(_('Kurzinfo'), 'dispatch.php/institute/overview'));
- $navigation->addSubNavigation('courses', new Navigation(_('Veranstaltungen'), 'show_bereich.php?level=s&id='.$course_id));
- $navigation->addSubNavigation('schedule', new Navigation(_('Veranstaltungs-Stundenplan'), 'dispatch.php/institute/schedule/index/' . $course_id));
+ $range_tree_node = RangeTreeNode::findOneByStudip_object_id($course_id);
+ if ($range_tree_node) {
+ $navigation->addSubNavigation(
+ 'courses',
+ new Navigation(_('Veranstaltungen'),
+ 'dispatch.php/search/courses',
+ [
+ 'node_id' => 'RangeTreeNode_' . $range_tree_node->id,
+ 'type' => 'rangetree'
+ ]
+ )
+ );
+ $navigation->addSubNavigation('schedule', new Navigation(_('Veranstaltungs-Stundenplan'), 'dispatch.php/institute/schedule/index/' . $course_id));
+ }
if ($GLOBALS['perm']->have_studip_perm('admin', $course_id)) {
$navigation->addSubNavigation('admin', new Navigation(_('Administration der Einrichtung'), 'dispatch.php/institute/basicdata/index?new_inst=TRUE'));