diff --git a/app/controllers/course/statusgroups.php b/app/controllers/course/statusgroups.php index 79c595bc2f056d5b82f57ce060634f6c9f927eba..b451fe14d8fc591bad1df2b2cc6f2c1ed0120d0a 100644 --- a/app/controllers/course/statusgroups.php +++ b/app/controllers/course/statusgroups.php @@ -39,7 +39,7 @@ class Course_StatusgroupsController extends AuthenticatedController $this->is_autor = $perm->have_studip_perm('autor', $this->course_id); // Hide groups page? - if (!$this->is_tutor && $this->config->COURSE_MEMBERGROUPS_HIDE) { + if (!$this->is_tutor && $this->config->COURSE_MEMBERS_HIDE) { throw new AccessDeniedException(); } @@ -291,18 +291,6 @@ class Course_StatusgroupsController extends AuthenticatedController ); } $sidebar->addWidget($actions); - - if ($this->is_tutor) { - $options = $sidebar->addWidget(new OptionsWidget()); - $options->addCheckbox( - _('Diese Seite für Studierende verbergen'), - $this->config->COURSE_MEMBERGROUPS_HIDE, - $this->url_for('course/statusgroups/course_groups_hide/1'), - $this->url_for('course/statusgroups/course_groups_hide/0'), - ['title' => _('Über diese Option können Sie die Teilnehmendengruppenliste für Studierende der Veranstaltung unsichtbar machen')] - ); - - } } /** @@ -1402,17 +1390,6 @@ class Course_StatusgroupsController extends AuthenticatedController $this->render_nothing(); } - public function course_groups_hide_action($state) - { - if (!$this->is_tutor) { - throw new AccessDeniedException(); - } - - $this->config->store('COURSE_MEMBERGROUPS_HIDE', $state); - - $this->redirect('course/statusgroups'); - } - private function sortMembers(SimpleCollection $members, $sort_by = null, $sort_dir = null) { $order = "nachname asc, vorname asc"; diff --git a/db/migrations/5.1.23_drop_course_membergroups_hide.php b/db/migrations/5.1.23_drop_course_membergroups_hide.php new file mode 100644 index 0000000000000000000000000000000000000000..235072ea5e1e7effdeb867e8a32415f442a87282 --- /dev/null +++ b/db/migrations/5.1.23_drop_course_membergroups_hide.php @@ -0,0 +1,33 @@ +<?php + +class DropCourseMembergroupsHide extends Migration +{ + public function description() + { + return 'Drop config option to hide course member groups page'; + } + + public function up() + { + $query = "DELETE `config`, `config_values` + FROM `config` + LEFT JOIN `config_values` USING (`field`) + WHERE `field` = 'COURSE_MEMBERGROUPS_HIDE'"; + DBManager::get()->exec($query); + } + + public function down() + { + $query = "INSERT IGNORE INTO `config` (`field`, `value`, `type`, `range`, `mkdate`, `chdate`, `description`) + VALUES (:name, :value, :type, :range, UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), :description)"; + + $statement = DBManager::get()->prepare($query); + $statement->execute([ + ':name' => 'COURSE_MEMBERGROUPS_HIDE', + ':description' => 'Über diese Option können Sie die Teilnehmendengruppenliste für Studierende der Veranstaltung unsichtbar machen', + ':range' => 'course', + ':type' => 'boolean', + ':value' => '0' + ]); + } +} diff --git a/lib/modules/CoreParticipants.class.php b/lib/modules/CoreParticipants.class.php index 74ca506bbe781d18eda00c473ab9caece4e3f344..65997d9999b326da8ec38280fdf9479b948581f6 100644 --- a/lib/modules/CoreParticipants.class.php +++ b/lib/modules/CoreParticipants.class.php @@ -122,7 +122,6 @@ class CoreParticipants extends CorePlugin implements StudipModule */ public function getTabNavigation($course_id) { - #$navigation = new AutoNavigation(_('Teilnehmende')); $navigation = new Navigation(_('Teilnehmende')); $navigation->setImage(Icon::create('persons', Icon::ROLE_INFO_ALT)); $navigation->setActiveImage(Icon::create('persons', Icon::ROLE_INFO)); @@ -133,15 +132,12 @@ class CoreParticipants extends CorePlugin implements StudipModule if (!$course->getSemClass()->isGroup()) { if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id) || !$course->config->COURSE_MEMBERS_HIDE) { $navigation->addSubNavigation('view', new Navigation(_('Teilnehmende'), 'dispatch.php/course/members')); - } - if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id) || !$course->config->COURSE_MEMBERGROUPS_HIDE) { $navigation->addSubNavigation('statusgroups', new Navigation(_('Gruppen'), 'dispatch.php/course/statusgroups')); } } else { - if (!$GLOBALS['perm']->have_studip_perm('tutor', $course_id)) { - return null; + if ($GLOBALS['perm']->have_studip_perm('tutor', $course_id)) { + $navigation->addSubNavigation('children', new Navigation(_('Teilnehmende in Unterveranstaltungen'), 'dispatch.php/course/grouping/members')); } - $navigation->addSubNavigation('children', new Navigation(_('Teilnehmende in Unterveranstaltungen'), 'dispatch.php/course/grouping/members')); } if ($course->aux_lock_rule) {