/**
  * Constructor
  *
  * @access public
  * @param
  * @return
  */
 public function __construct($a_parent_obj, $a_type = 'admin', $show_content = true, $show_learning_progress = false, $a_role_id = 0)
 {
     global $lng, $ilCtrl;
     $this->show_learning_progress = $show_learning_progress;
     $this->lng = $lng;
     $this->lng->loadLanguageModule('grp');
     $this->lng->loadLanguageModule('trac');
     $this->ctrl = $ilCtrl;
     $this->type = $a_type;
     $this->role = $a_role_id;
     include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     $this->privacy = ilPrivacySettings::_getInstance();
     $this->setId('grp_' . $a_type . '_' . $this->getRole() . '_' . $a_parent_obj->object->getId());
     parent::__construct($a_parent_obj, 'members');
     $this->initSettings();
     $this->setFormName('participants');
     $this->addColumn('', 'f', "1");
     $this->addColumn($this->lng->txt('name'), 'lastname', '20%');
     $all_cols = $this->getSelectableColumns();
     foreach ($this->getSelectedColumns() as $col) {
         $this->addColumn($all_cols[$col]['txt'], $col);
     }
     if ($this->show_learning_progress) {
         $this->addColumn($this->lng->txt('learning_progress'), 'progress');
     }
     if ($this->privacy->enabledGroupAccessTimes()) {
         $this->addColumn($this->lng->txt('last_access'), 'access_time_unix');
     }
     if ($this->type == 'admin') {
         $this->setPrefix('admin');
         $this->setSelectAllCheckbox('admins');
         $this->addColumn($this->lng->txt('grp_notification'), 'notification');
         $this->addCommandButton('updateStatus', $this->lng->txt('save'));
     } elseif ($this->type == 'member') {
         $this->setPrefix('member');
         $this->setSelectAllCheckbox('members');
     } else {
         $this->setPrefix('role');
         $this->setSelectAllCheckbox('roles');
     }
     $this->addColumn($this->lng->txt(''), 'optional');
     $this->setDefaultOrderField('lastname');
     $this->setRowTemplate("tpl.show_participants_row.html", "Modules/Group");
     $this->setShowRowsSelector(true);
     if ($show_content) {
         $this->enable('sort');
         $this->enable('header');
         $this->enable('numinfo');
         $this->enable('select_all');
     } else {
         $this->disable('content');
         $this->disable('header');
         $this->disable('footer');
         $this->disable('numinfo');
         $this->disable('select_all');
     }
 }
 /**
  * Init acceptance
  * @return 
  */
 protected function initSettings()
 {
     if (self::$accepted_ids !== NULL) {
         return true;
     }
     self::$export_allowed = ilPrivacySettings::_getInstance()->checkExportAccess($this->getParentObject()->object->getRefId());
     self::$confirmation_required = ilPrivacySettings::_getInstance()->groupConfirmationRequired();
     include_once 'Services/Membership/classes/class.ilMemberAgreement.php';
     self::$accepted_ids = ilMemberAgreement::lookupAcceptedAgreements($this->getParentObject()->object->getId());
     include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
     self::$has_odf_definitions = ilCourseDefinedFieldDefinition::_hasFields($this->getParentObject()->object->getId());
 }
 /**
  * Constructor
  *
  * @access public
  * @param
  * @return
  */
 public function __construct($a_parent_obj, $a_type = 'admin', $show_content = true, $a_show_learning_progress = false, $a_show_timings = false, $a_show_edit_link = true, $a_role_id = 0, $a_show_lp_status_sync = false)
 {
     global $lng, $ilCtrl;
     $this->show_learning_progress = $a_show_learning_progress;
     $this->show_timings = $a_show_timings;
     $this->show_edit_link = $a_show_edit_link;
     $this->show_lp_status_sync = $a_show_lp_status_sync;
     // #13208
     include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
     if (!ilObjUserTracking::_enabledLearningProgress()) {
         $this->show_lp_status_sync = false;
     }
     $this->lng = $lng;
     $this->lng->loadLanguageModule('crs');
     $this->lng->loadLanguageModule('trac');
     $this->ctrl = $ilCtrl;
     $this->type = $a_type;
     $this->setRoleId($a_role_id);
     include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     $this->privacy = ilPrivacySettings::_getInstance();
     // required before constructor for columns
     $this->setId('crs_' . $a_type . '_' . $a_role_id . '_' . $a_parent_obj->object->getId());
     parent::__construct($a_parent_obj, 'members');
     $this->initSettings();
     $this->setFormName('participants');
     $this->addColumn('', 'f', "1");
     $this->addColumn($this->lng->txt('name'), 'lastname', '20%');
     $all_cols = $this->getSelectableColumns();
     foreach ($this->getSelectedColumns() as $col) {
         $this->addColumn($all_cols[$col]['txt'], $col);
     }
     if ($this->show_learning_progress) {
         $this->addColumn($this->lng->txt('learning_progress'), 'progress');
     }
     if ($this->privacy->enabledCourseAccessTimes()) {
         $this->addColumn($this->lng->txt('last_access'), 'access_ut', '16em');
     }
     $this->addColumn($this->lng->txt('crs_member_passed'), 'passed');
     if ($this->show_lp_status_sync) {
         $this->addColumn($this->lng->txt('crs_member_passed_status_changed'), 'passed_info');
     }
     if ($this->type == 'admin') {
         $this->setSelectAllCheckbox('admins');
         $this->addColumn($this->lng->txt('crs_notification_list_title'), 'notification');
         $this->addCommandButton('updateAdminStatus', $this->lng->txt('save'));
     } elseif ($this->type == 'tutor') {
         $this->setSelectAllCheckbox('tutors');
         $this->addColumn($this->lng->txt('crs_notification_list_title'), 'notification');
         $this->addCommandButton('updateTutorStatus', $this->lng->txt('save'));
     } elseif ($this->type == 'member') {
         $this->setSelectAllCheckbox('members');
         $this->addColumn($this->lng->txt('crs_blocked'), 'blocked');
         $this->addCommandButton('updateMemberStatus', $this->lng->txt('save'));
     } else {
         $this->setSelectAllCheckbox('roles');
         $this->addColumn($this->lng->txt('crs_blocked'), 'blocked');
         $this->addCommandButton('updateRoleStatus', $this->lng->txt('save'));
     }
     $this->addColumn($this->lng->txt(''), 'optional');
     $this->setRowTemplate("tpl.show_participants_row.html", "Modules/Course");
     if ($show_content) {
         $this->setDefaultOrderField('lastname');
         $this->enable('sort');
         $this->enable('header');
         $this->enable('numinfo');
         $this->enable('select_all');
     } else {
         $this->disable('content');
         $this->disable('header');
         $this->disable('footer');
         $this->disable('numinfo');
         $this->disable('select_all');
     }
     $this->setEnableNumInfo(true);
     $this->setExternalSegmentation(true);
     $this->getItems();
     $this->setTopCommands(true);
     $this->setEnableHeader(true);
     $this->setEnableTitle(true);
     $this->initFilter();
     $this->setShowRowsSelector(true);
     include_once "Services/Certificate/classes/class.ilCertificate.php";
     $this->enable_certificates = ilCertificate::isActive();
     if ($this->enable_certificates) {
         $this->enable_certificates = ilCertificate::isObjectActive($a_parent_obj->object->getId());
     }
     if ($this->enable_certificates) {
         $lng->loadLanguageModule('certificate');
     }
 }