diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-05-14 08:33:30 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-05-14 08:33:30 +0200 |
| commit | 1a447f53e588bbe2b86fa25ce7628d0be46b5022 (patch) | |
| tree | 4a85b1adeee24ae18b571588049814da03cb082c /app | |
| parent | f69a3082123db28f5156d02a884756cef4e0825f (diff) | |
fix studygroup creation and link to course administration if the module is deactivated, fixes #5591
Closes #5591
Merge request studip/studip!4226
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/course/wizard.php | 21 | ||||
| -rw-r--r-- | app/views/my_studygroups/_course.php | 4 |
2 files changed, 17 insertions, 8 deletions
diff --git a/app/controllers/course/wizard.php b/app/controllers/course/wizard.php index ad289ed..b1cfcbb 100644 --- a/app/controllers/course/wizard.php +++ b/app/controllers/course/wizard.php @@ -197,13 +197,22 @@ class Course_WizardController extends AuthenticatedController // A studygroup has been created. if (in_array($this->course->status, studygroup_sem_types())) { - $message = MessageBox::success(sprintf( - _('Die Studien-/Arbeitsgruppe „%s“ wurde angelegt. ' - . 'Sie können sie direkt hier weiter verwalten.'), - htmlReady($this->course->name) - )); + if ($this->course->isToolActive(CoreStudygroupAdmin::class)) { + $message = MessageBox::success(sprintf( + _('Die Studien-/Arbeitsgruppe „%s“ wurde angelegt. ' + . 'Sie können sie direkt hier weiter verwalten.'), + htmlReady($this->course->name) + )); + + $target = $this->url_for('course/studygroup/edit', ['cid' => $this->course->id]); + } else { + $message = MessageBox::success(sprintf( + _('Die Studien-/Arbeitsgruppe „%s“ wurde angelegt.'), + htmlReady($this->course->name) + )); - $target = $this->url_for('course/studygroup/edit', ['cid' => $this->course->id]); + $target = $this->url_for('course/go', ['to' => $this->course->id]); + } // "Normal" course. } elseif (Request::int('dialog') && $GLOBALS['perm']->have_perm('admin')) { diff --git a/app/views/my_studygroups/_course.php b/app/views/my_studygroups/_course.php index e554ddb..dc36804 100644 --- a/app/views/my_studygroups/_course.php +++ b/app/views/my_studygroups/_course.php @@ -51,10 +51,10 @@ <td style="text-align: right"> <? if (in_array($group["user_status"], ["dozent", "tutor"])) : ?> <? $adminmodule = $group["sem_class"]->getAdminModuleObject(); ?> - <? if ($adminmodule) : ?> + <? if ($adminmodule && $group['tools']->findOneby('plugin_id', $adminmodule->getPluginId())) : ?> <? $adminnavigation = $adminmodule->getIconNavigation($group['seminar_id'], 0, $GLOBALS['user']->id); ?> <? endif ?> - <? if ($adminnavigation) : ?> + <? if (!empty($adminnavigation)) : ?> <a href="<?= URLHelper::getLink($adminnavigation->getURL(), ['cid' => $group['seminar_id']]) ?>"> <?= $adminnavigation->getImage()->asImg($adminnavigation->getLinkAttributes())?> </a> |
