/**
  * 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();
     // 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'), '', ilUtil::getImagePath('edit_add.png'));
             $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'), '', ilUtil::getImagePath('edit_remove.png'));
             $this->ctrl->clearParameters($this);
         }
         $table->addCommandButton('updateMembers', $this->lng->txt('save'));
         $table->setTitle($this->lng->txt('event_tbl_admins'), 'icon_usr.png', $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'), '', ilUtil::getImagePath('edit_add.png'));
             $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'), '', ilUtil::getImagePath('edit_remove.png'));
             $this->ctrl->clearParameters($this);
         }
         $table->addCommandButton('updateMembers', $this->lng->txt('save'));
         $table->setTitle($this->lng->txt('event_tbl_tutors'), 'icon_usr.png', $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'), '', ilUtil::getImagePath('edit_add.png'));
             $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'), '', ilUtil::getImagePath('edit_remove.png'));
             $this->ctrl->clearParameters($this);
         }
         $table->addCommandButton('updateMembers', $this->lng->txt('save'));
         $table->setTitle($this->lng->txt('event_tbl_members'), 'icon_usr.png', $this->lng->txt('event_tbl_admins'));
         $table->enableRegistration($this->object->enabledRegistration());
         $table->setParticipants($members);
         $table->parse();
         $this->tpl->setVariable('MEMBERS', $table->getHTML());
     }
 }
Пример #2
0
 /**
  * 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'));
 }