Example #1
0
 /**
  * Member administration
  *
  * @global ilRbacReview $rbacreview
  * @access protected
  * @return
  */
 protected function membersObject()
 {
     global $ilUser, $ilAccess, $ilToolbar, $lng, $ilCtrl, $tpl, $rbacreview;
     include_once './Modules/Course/classes/class.ilCourseParticipants.php';
     include_once './Modules/Course/classes/class.ilCourseParticipantsTableGUI.php';
     if (isset($_GET['member_table_nav'])) {
         list($_SESSION['crs_print_sort'], $_SESSION['crs_print_order'], $tmp) = explode(':', $_GET['member_table_nav']);
     }
     $this->checkPermission('write');
     include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
     $this->show_tracking = (ilObjUserTracking::_enabledLearningProgress() and ilObjUserTracking::_enabledUserRelatedData());
     if ($this->show_tracking) {
         include_once './Services/Object/classes/class.ilObjectLP.php';
         $olp = ilObjectLP::getInstance($this->object->getId());
         $this->show_tracking = $olp->isActive();
     }
     include_once './Services/Object/classes/class.ilObjectActivation.php';
     $this->timings_enabled = (ilObjectActivation::hasTimings($this->object->getRefId()) and $this->object->getViewMode() == IL_CRS_VIEW_TIMING);
     $this->setSubTabs('members');
     $this->tabs_gui->setTabActive('members');
     $this->tabs_gui->setSubTabActive('crs_member_administration');
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.crs_edit_members.html', 'Modules/Course');
     $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
     // add members
     include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
     ilRepositorySearchGUI::fillAutoCompleteToolbar($this, $ilToolbar, array('auto_complete_name' => $lng->txt('user'), 'user_type' => $this->getLocalRoles(), 'submit_name' => $lng->txt('add')));
     // spacer
     $ilToolbar->addSeparator();
     // search button
     $ilToolbar->addButton($this->lng->txt("crs_search_users"), $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', 'start'));
     // separator
     $ilToolbar->addSeparator();
     // print button
     $ilToolbar->addButton($this->lng->txt("crs_print_list"), $this->ctrl->getLinkTarget($this, 'printMembers'));
     /* attendance list button
     		$ilToolbar->addButton($this->lng->txt("sess_gen_attendance_list"),
     			$this->ctrl->getLinkTarget($this, 'attendanceList'));
     		*/
     $this->setShowHidePrefs();
     // Waiting list table
     include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
     $waiting_list = new ilCourseWaitingList($this->object->getId());
     if (count($wait = $waiting_list->getAllUsers())) {
         include_once './Services/Membership/classes/class.ilWaitingListTableGUI.php';
         if ($ilUser->getPref('crs_wait_hide')) {
             $table_gui = new ilWaitingListTableGUI($this, $waiting_list, false);
             $this->ctrl->setParameter($this, 'wait_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilWaitingListTableGUI($this, $waiting_list, true);
             $this->ctrl->setParameter($this, 'wait_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setUsers($wait);
         $table_gui->setTitle($this->lng->txt('crs_waiting_list'), 'icon_usr.svg', $this->lng->txt('crs_waiting_list'));
         $this->tpl->setVariable('TABLE_WAIT', $table_gui->getHTML());
     }
     // Subscriber table
     if ($subscribers = ilCourseParticipants::lookupSubscribers($this->object->getId())) {
         include_once './Services/Membership/classes/class.ilSubscriberTableGUI.php';
         if ($ilUser->getPref('crs_subscriber_hide')) {
             $table_gui = new ilSubscriberTableGUI($this, false);
             $this->ctrl->setParameter($this, 'subscriber_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilSubscriberTableGUI($this, true);
             $this->ctrl->setParameter($this, 'subscriber_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->readSubscriberData();
         $table_gui->setTitle($this->lng->txt('group_new_registrations'), 'icon_usr.svg', $this->lng->txt('group_new_registrations'));
         $this->tpl->setVariable('TABLE_SUB', $table_gui->getHTML());
     }
     if ($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultAdminRole()))) {
         // Security: display the list of course administrators read-only,
         // if the user doesn't have the 'edit_permission' permission.
         $showEditLink = ($ilAccess->checkAccess("edit_permission", '', $this->object->getRefId()) or ilCourseParticipants::_getInstanceByObjId($this->object->getId())->isAdmin($ilUser->getId()));
         if ($ilUser->getPref('crs_admin_hide')) {
             $table_gui = new ilCourseParticipantsTableGUI($this, 'admin', false, false, $this->timings_enabled, $showEditLink, $this->object->getDefaultAdminRole(), $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP);
             $this->ctrl->setParameter($this, 'admin_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilCourseParticipantsTableGUI($this, 'admin', true, false, $this->timings_enabled, $showEditLink, $this->object->getDefaultAdminRole(), $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP);
             $this->ctrl->setParameter($this, 'admin_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle($this->lng->txt('crs_administrators'), 'icon_usr.svg', $this->lng->txt('crs_administrators'));
         $table_gui->parse();
         $this->tpl->setVariable('ADMINS', $table_gui->getHTML());
     }
     if ($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultTutorRole()))) {
         if ($ilUser->getPref('crs_tutor_hide')) {
             $table_gui = new ilCourseParticipantsTableGUI($this, 'tutor', false, false, $this->timings_enabled, true, $this->object->getDefaultTutorRole(), $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP);
             $this->ctrl->setParameter($this, 'tutor_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilCourseParticipantsTableGUI($this, 'tutor', true, false, $this->timings_enabled, true, $this->object->getDefaultTutorRole(), $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP);
             $this->ctrl->setParameter($this, 'tutor_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle($this->lng->txt('crs_tutors'), 'icon_usr.svg', $this->lng->txt('crs_tutors'));
         $table_gui->parse();
         $this->tpl->setVariable('TUTORS', $table_gui->getHTML());
     }
     if ($rbacreview->getNumberOfAssignedUsers(array($this->object->getDefaultMemberRole()))) {
         if ($ilUser->getPref('crs_member_hide')) {
             $table_gui = new ilCourseParticipantsTableGUI($this, 'member', false, $this->show_tracking, $this->timings_enabled, true, $this->object->getDefaultMemberRole(), $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP);
             $this->ctrl->setParameter($this, 'member_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilCourseParticipantsTableGUI($this, 'member', true, $this->show_tracking, $this->timings_enabled, true, $this->object->getDefaultMemberRole(), $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP);
             $this->ctrl->setParameter($this, 'member_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle($this->lng->txt('crs_members'), 'icon_usr.svg', $this->lng->txt('crs_members'));
         $table_gui->parse();
         $this->tpl->setCurrentBlock('member_block');
         $this->tpl->setVariable('MEMBERS', $table_gui->getHTML());
         $this->tpl->parseCurrentBlock();
     }
     foreach (ilCourseParticipants::getMemberRoles($this->object->getRefId()) as $role_id) {
         // Do not show table if no user is assigned
         if (!$GLOBALS['rbacreview']->getNumberOfAssignedUsers(array($role_id))) {
             continue;
         }
         if ($ilUser->getPref('crs_role_hide_' . $role_id)) {
             $table_gui = new ilCourseParticipantsTableGUI($this, 'role', false, $this->show_tracking, $this->timings_enabled, true, $role_id, $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP);
             $this->ctrl->setParameter($this, 'role_hide_' . $role_id, 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilCourseParticipantsTableGUI($this, 'role', true, $this->show_tracking, $this->timings_enabled, true, $role_id, $this->object->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP);
             $this->ctrl->setParameter($this, 'role_hide_' . $role_id, 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle(ilObject::_lookupTitle($role_id), 'icon_usr.svg', $this->lng->txt('crs_members'));
         $table_gui->parse();
         $this->tpl->setCurrentBlock('member_block');
         $this->tpl->setVariable('MEMBERS', $table_gui->getHTML());
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable('TXT_SELECTED_USER', $this->lng->txt('crs_selected_users'));
     $this->tpl->setVariable('BTN_FOOTER_EDIT', $this->lng->txt('edit'));
     $this->tpl->setVariable('BTN_FOOTER_VAL', $this->lng->txt('remove'));
     $this->tpl->setVariable('BTN_FOOTER_MAIL', $this->lng->txt('crs_mem_send_mail'));
     $this->tpl->setVariable('ARROW_DOWN', ilUtil::getImagePath('arrow_downright.svg'));
 }
 /**
  * Show participants table
  * @return void 
  */
 protected function membersObject()
 {
     global $tree, $ilUser;
     $this->checkPermission('write');
     $this->tabs_gui->setTabActive('event_edit_members');
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_members.html', 'Modules/Session');
     include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
     $toolbar = new ilToolbarGUI();
     $toolbar->addButton($this->lng->txt('sess_gen_attendance_list'), $this->ctrl->getLinkTarget($this, 'attendanceList'));
     $this->tpl->setVariable('ACTION_BUTTONS', $toolbar->getHTML());
     $members_obj = $this->initContainer(true);
     include_once './Modules/Session/classes/class.ilEventParticipants.php';
     // Save hide/show table settings
     $this->setShowHidePrefs();
     // Waiting list table
     include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
     $waiting_list = new ilSessionWaitingList($this->object->getId());
     if (count($wait = $waiting_list->getAllUsers())) {
         include_once './Services/Membership/classes/class.ilWaitingListTableGUI.php';
         if ($ilUser->getPref('sess_wait_hide')) {
             $table_gui = new ilWaitingListTableGUI($this, $waiting_list, false);
             $this->ctrl->setParameter($this, 'wait_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilWaitingListTableGUI($this, $waiting_list, true);
             $this->ctrl->setParameter($this, 'wait_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setUsers($wait);
         $table_gui->setTitle($this->lng->txt('grp_header_waiting_list'), 'icon_usr.svg', $this->lng->txt('group_new_registrations'));
         $this->tpl->setVariable('TABLE_WAIT', $table_gui->getHTML());
     }
     // subscribers
     // Subscriber table
     include_once './Services/Membership/classes/class.ilParticipants.php';
     $part = ilParticipants::getInstanceByObjId($this->object->getId());
     if ($part->getSubscribers()) {
         include_once './Services/Membership/classes/class.ilSubscriberTableGUI.php';
         if ($ilUser->getPref('grp_subscriber_hide')) {
             $table_gui = new ilSubscriberTableGUI($this, false, false);
             $this->ctrl->setParameter($this, 'subscriber_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilSubscriberTableGUI($this, true, false);
             $this->ctrl->setParameter($this, 'subscriber_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->readSubscriberData();
         $table_gui->setTitle($this->lng->txt('group_new_registrations'), 'icon_usr.svg', $this->lng->txt('group_new_registrations'));
         $this->tpl->setVariable('TABLE_SUB', $table_gui->getHTML());
     }
     // Admins
     if (count($admins = $members_obj->getAdmins())) {
         include_once './Modules/Session/classes/class.ilSessionParticipantsTableGUI.php';
         if ($ilUser->getPref('sess_admin_hide')) {
             $table = new ilSessionParticipantsTableGUI($this, ilSessionParticipantsTableGUI::TYPE_ADMIN, false);
             $this->ctrl->setParameter($this, 'admin_hide', 0);
             $table->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table = new ilSessionParticipantsTableGUI($this, ilSessionParticipantsTableGUI::TYPE_ADMIN, true);
             $this->ctrl->setParameter($this, 'admin_hide', 1);
             $table->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table->addCommandButton('updateMembers', $this->lng->txt('save'));
         $table->setTitle($this->lng->txt('event_tbl_admins'), 'icon_usr.svg', $this->lng->txt('event_tbl_admins'));
         $table->enableRegistration($this->object->enabledRegistration());
         $table->setParticipants($admins);
         $table->parse();
         $this->tpl->setVariable('ADMINS', $table->getHTML());
     }
     // Tutors
     if (count($tutors = $members_obj->getTutors())) {
         include_once './Modules/Session/classes/class.ilSessionParticipantsTableGUI.php';
         if ($ilUser->getPref('sess_tutor_hide')) {
             $table = new ilSessionParticipantsTableGUI($this, ilSessionParticipantsTableGUI::TYPE_TUTOR, false);
             $this->ctrl->setParameter($this, 'tutor_hide', 0);
             $table->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table = new ilSessionParticipantsTableGUI($this, ilSessionParticipantsTableGUI::TYPE_TUTOR, true);
             $this->ctrl->setParameter($this, 'tutor_hide', 1);
             $table->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table->addCommandButton('updateMembers', $this->lng->txt('save'));
         $table->setTitle($this->lng->txt('event_tbl_tutors'), 'icon_usr.svg', $this->lng->txt('event_tbl_admins'));
         $table->enableRegistration($this->object->enabledRegistration());
         $table->setParticipants($tutors);
         $table->parse();
         $this->tpl->setVariable('TUTORS', $table->getHTML());
     }
     // Members
     if (count($members = $members_obj->getMembers())) {
         include_once './Modules/Session/classes/class.ilSessionParticipantsTableGUI.php';
         if ($ilUser->getPref('sess_member_hide')) {
             $table = new ilSessionParticipantsTableGUI($this, ilSessionParticipantsTableGUI::TYPE_MEMBER, false);
             $this->ctrl->setParameter($this, 'member_hide', 0);
             $table->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table = new ilSessionParticipantsTableGUI($this, ilSessionParticipantsTableGUI::TYPE_MEMBER, true);
             $this->ctrl->setParameter($this, 'member_hide', 1);
             $table->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table->addCommandButton('updateMembers', $this->lng->txt('save'));
         $table->setTitle($this->lng->txt('event_tbl_members'), 'icon_usr.svg', $this->lng->txt('event_tbl_admins'));
         $table->enableRegistration($this->object->enabledRegistration());
         $table->setParticipants($members);
         $table->parse();
         $this->tpl->setVariable('MEMBERS', $table->getHTML());
     }
     $GLOBALS['lng']->loadLanguageModule('mmbr');
     $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
     $this->tpl->setVariable('TXT_SELECTED_USER', $this->lng->txt('mmbr_selected_users'));
     $this->tpl->setVariable('BTN_FOOTER_MAIL', $this->lng->txt('mmbr_btn_mail_selected_users'));
     $this->tpl->setVariable('ARROW_DOWN', ilUtil::getImagePath('arrow_downright.svg'));
 }
 /**
  * edit members
  *
  * @access public
  * @return
  */
 public function membersObject()
 {
     global $ilUser, $ilToolbar, $lng, $ilCtrl;
     include_once './Modules/Group/classes/class.ilGroupParticipants.php';
     include_once './Modules/Group/classes/class.ilGroupParticipantsTableGUI.php';
     $this->checkPermission('write');
     include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
     include_once './Services/Tracking/classes/class.ilLPObjSettings.php';
     $this->show_tracking = (ilObjUserTracking::_enabledLearningProgress() and ilObjUserTracking::_enabledUserRelatedData() and ilLPObjSettings::_lookupMode($this->object->getId()) != LP_MODE_DEACTIVATED);
     $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
     $this->setSubTabs('members');
     $this->tabs_gui->setTabActive('members');
     $this->tabs_gui->setSubTabActive('grp_edit_members');
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.grp_edit_members.html', 'Modules/Group');
     $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
     // add members
     include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
     ilRepositorySearchGUI::fillAutoCompleteToolbar($this, $ilToolbar, array('auto_complete_name' => $lng->txt('user'), 'user_type' => array(ilObjGroup::GRP_MEMBER => $lng->txt("member"), ilObjGroup::GRP_ADMIN => $lng->txt("administrator")), 'submit_name' => $lng->txt('add')));
     // spacer
     $ilToolbar->addSeparator();
     // search button
     $ilToolbar->addButton($this->lng->txt("grp_search_users"), $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', 'start'));
     $ilToolbar->addSeparator();
     // print button
     $ilToolbar->addButton($this->lng->txt("grp_print_list"), $this->ctrl->getLinkTarget($this, 'printMembers'));
     $this->setShowHidePrefs();
     // Waiting list table
     include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
     $waiting_list = new ilGroupWaitingList($this->object->getId());
     if (count($wait = $waiting_list->getAllUsers())) {
         include_once './Services/Membership/classes/class.ilWaitingListTableGUI.php';
         if ($ilUser->getPref('grp_wait_hide')) {
             $table_gui = new ilWaitingListTableGUI($this, $waiting_list, false);
             $this->ctrl->setParameter($this, 'wait_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'), '', ilUtil::getImagePath('edit_add.png'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilWaitingListTableGUI($this, $waiting_list, true);
             $this->ctrl->setParameter($this, 'wait_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'), '', ilUtil::getImagePath('edit_remove.png'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setUsers($wait);
         $table_gui->setTitle($this->lng->txt('grp_header_waiting_list'), 'icon_usr.png', $this->lng->txt('group_new_registrations'));
         $this->tpl->setVariable('TABLE_SUB', $table_gui->getHTML());
     }
     // Subscriber table
     if ($part->getSubscribers()) {
         include_once './Services/Membership/classes/class.ilSubscriberTableGUI.php';
         if ($ilUser->getPref('grp_subscriber_hide')) {
             $table_gui = new ilSubscriberTableGUI($this, false);
             $this->ctrl->setParameter($this, 'subscriber_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'), '', ilUtil::getImagePath('edit_add.png'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilSubscriberTableGUI($this, true);
             $this->ctrl->setParameter($this, 'subscriber_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'), '', ilUtil::getImagePath('edit_remove.png'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->readSubscriberData();
         $table_gui->setTitle($this->lng->txt('group_new_registrations'), 'icon_usr.png', $this->lng->txt('group_new_registrations'));
         $this->tpl->setVariable('TABLE_SUB', $table_gui->getHTML());
     }
     if (count($part->getAdmins())) {
         if ($ilUser->getPref('grp_admin_hide')) {
             $table_gui = new ilGroupParticipantsTableGUI($this, 'admin', false, false);
             $this->ctrl->setParameter($this, 'admin_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'), '', ilUtil::getImagePath('edit_add.png'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilGroupParticipantsTableGUI($this, 'admin', true, false);
             $this->ctrl->setParameter($this, 'admin_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'), '', ilUtil::getImagePath('edit_remove.png'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle($this->lng->txt('grp_admins'), 'icon_usr.png', $this->lng->txt('grp_admins'));
         $table_gui->parse($this->readMemberData($part->getAdmins()));
         $this->tpl->setVariable('ADMINS', $table_gui->getHTML());
     }
     if (count($part->getMembers())) {
         if ($ilUser->getPref('grp_member_hide')) {
             $table_gui = new ilGroupParticipantsTableGUI($this, 'member', false, $this->show_tracking);
             $this->ctrl->setParameter($this, 'member_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'), '', ilUtil::getImagePath('edit_add.png'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilGroupParticipantsTableGUI($this, 'member', true, $this->show_tracking);
             $this->ctrl->setParameter($this, 'member_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'), '', ilUtil::getImagePath('edit_remove.png'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle($this->lng->txt('grp_members'), 'icon_usr.png', $this->lng->txt('grp_members'));
         $table_gui->parse($this->readMemberData($part->getMembers()));
         $this->tpl->setVariable('MEMBERS', $table_gui->getHTML());
     }
     $this->tpl->setVariable('TXT_SELECTED_USER', $this->lng->txt('grp_selected_users'));
     $this->tpl->setVariable('BTN_FOOTER_EDIT', $this->lng->txt('edit'));
     $this->tpl->setVariable('BTN_FOOTER_VAL', $this->lng->txt('remove'));
     $this->tpl->setVariable('BTN_FOOTER_MAIL', $this->lng->txt('grp_mem_send_mail'));
     $this->tpl->setVariable('ARROW_DOWN', ilUtil::getImagePath('arrow_downright.png'));
 }
Example #4
0
 /**
  * edit members
  *
  * @access public
  * @return
  */
 public function membersObject()
 {
     global $ilUser, $ilToolbar, $lng, $ilCtrl;
     include_once './Modules/Group/classes/class.ilGroupParticipants.php';
     include_once './Modules/Group/classes/class.ilGroupParticipantsTableGUI.php';
     $this->checkPermission('write');
     include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
     $this->show_tracking = (ilObjUserTracking::_enabledLearningProgress() and ilObjUserTracking::_enabledUserRelatedData());
     if ($this->show_tracking) {
         include_once './Services/Object/classes/class.ilObjectLP.php';
         $olp = ilObjectLP::getInstance($this->object->getId());
         $this->show_tracking = $olp->isActive();
     }
     $part = ilGroupParticipants::_getInstanceByObjId($this->object->getId());
     $this->setSubTabs('members');
     $this->tabs_gui->setTabActive('members');
     $this->tabs_gui->setSubTabActive('grp_edit_members');
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.grp_edit_members.html', 'Modules/Group');
     $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
     // add members
     include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
     ilRepositorySearchGUI::fillAutoCompleteToolbar($this, $ilToolbar, array('auto_complete_name' => $lng->txt('user'), 'user_type' => $this->getLocalRoles(), 'submit_name' => $lng->txt('add')));
     // spacer
     $ilToolbar->addSeparator();
     // search button
     $ilToolbar->addButton($this->lng->txt("grp_search_users"), $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', 'start'));
     $ilToolbar->addSeparator();
     // print button
     $ilToolbar->addButton($this->lng->txt("grp_print_list"), $this->ctrl->getLinkTarget($this, 'printMembers'));
     $this->setShowHidePrefs();
     // Waiting list table
     include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
     $waiting_list = new ilGroupWaitingList($this->object->getId());
     if (count($wait = $waiting_list->getAllUsers())) {
         include_once './Services/Membership/classes/class.ilWaitingListTableGUI.php';
         if ($ilUser->getPref('grp_wait_hide')) {
             $table_gui = new ilWaitingListTableGUI($this, $waiting_list, false);
             $this->ctrl->setParameter($this, 'wait_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilWaitingListTableGUI($this, $waiting_list, true);
             $this->ctrl->setParameter($this, 'wait_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setUsers($wait);
         $table_gui->setTitle($this->lng->txt('grp_header_waiting_list'), 'icon_usr.svg', $this->lng->txt('group_new_registrations'));
         $this->tpl->setVariable('TABLE_SUB', $table_gui->getHTML());
     }
     // Subscriber table
     if ($part->getSubscribers()) {
         include_once './Services/Membership/classes/class.ilSubscriberTableGUI.php';
         if ($ilUser->getPref('grp_subscriber_hide')) {
             $table_gui = new ilSubscriberTableGUI($this, false);
             $this->ctrl->setParameter($this, 'subscriber_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilSubscriberTableGUI($this, true);
             $this->ctrl->setParameter($this, 'subscriber_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->readSubscriberData();
         $table_gui->setTitle($this->lng->txt('group_new_registrations'), 'icon_usr.svg', $this->lng->txt('group_new_registrations'));
         $this->tpl->setVariable('TABLE_SUB', $table_gui->getHTML());
     }
     if (count($part->getAdmins())) {
         if ($ilUser->getPref('grp_admin_hide')) {
             $table_gui = new ilGroupParticipantsTableGUI($this, 'admin', false, false);
             $this->ctrl->setParameter($this, 'admin_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilGroupParticipantsTableGUI($this, 'admin', true, false);
             $this->ctrl->setParameter($this, 'admin_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle($this->lng->txt('grp_admins'), 'icon_usr.svg', $this->lng->txt('grp_admins'));
         $table_gui->parse($this->readMemberData($part->getAdmins()));
         $this->tpl->setVariable('ADMINS', $table_gui->getHTML());
     }
     if ($GLOBALS['rbacreview']->getNumberOfAssignedUsers(array($this->object->getDefaultMemberRole()))) {
         if ($ilUser->getPref('grp_member_hide')) {
             $table_gui = new ilGroupParticipantsTableGUI($this, 'member', false, $this->show_tracking, $this->object->getDEfaultMemberRole());
             $this->ctrl->setParameter($this, 'member_hide', 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilGroupParticipantsTableGUI($this, 'member', true, $this->show_tracking, $this->object->getDefaultMemberRole());
             $this->ctrl->setParameter($this, 'member_hide', 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle($this->lng->txt('grp_members'), 'icon_usr.svg', $this->lng->txt('grp_members'));
         $table_gui->parse($this->readMemberData($GLOBALS['rbacreview']->assignedUsers($this->object->getDefaultMemberRole()), null, $table_gui->getSelectedColumns()));
         $this->tpl->setCurrentBlock('member_block');
         $this->tpl->setVariable('MEMBERS', $table_gui->getHTML());
         $this->tpl->parseCurrentBlock();
     }
     foreach (ilGroupParticipants::getMemberRoles($this->object->getRefId()) as $role_id) {
         // Do not show table if no user is assigned
         if (!$GLOBALS['rbacreview']->getNumberOfAssignedUsers(array($role_id))) {
             continue;
         }
         if ($ilUser->getPref('grp_role_hide' . $role_id)) {
             $table_gui = new ilGroupParticipantsTableGUI($this, 'role', false, $this->show_tracking, $role_id);
             $this->ctrl->setParameter($this, 'role_hide_' . $role_id, 0);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('show'));
             $this->ctrl->clearParameters($this);
         } else {
             $table_gui = new ilGroupParticipantsTableGUI($this, 'role', true, $this->show_tracking, $role_id);
             $this->ctrl->setParameter($this, 'role_hide_' . $role_id, 1);
             $table_gui->addHeaderCommand($this->ctrl->getLinkTarget($this, 'members'), $this->lng->txt('hide'));
             $this->ctrl->clearParameters($this);
         }
         $table_gui->setTitle(ilObject::_lookupTitle($role_id), 'icon_usr.gif', ilObject::_lookupTitle($role_id));
         $table_gui->parse($this->readMemberData($GLOBALS['rbacreview']->assignedUsers($role_id)));
         $this->tpl->setCurrentBlock('member_block');
         $this->tpl->setVariable('MEMBERS', $table_gui->getHTML());
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable('TXT_SELECTED_USER', $this->lng->txt('grp_selected_users'));
     $this->tpl->setVariable('BTN_FOOTER_EDIT', $this->lng->txt('edit'));
     $this->tpl->setVariable('BTN_FOOTER_VAL', $this->lng->txt('remove'));
     $this->tpl->setVariable('BTN_FOOTER_MAIL', $this->lng->txt('grp_mem_send_mail'));
     $this->tpl->setVariable('ARROW_DOWN', ilUtil::getImagePath('arrow_downright.svg'));
 }