/**
  *	Initialize the table filters.
  *
  *	This method is called internally to initialize
  *	the filters from present on the top of the table.
  */
 public function initFilter()
 {
     include_once 'Services/Form/classes/class.ilTextInputGUI.php';
     $tname = new ilTextInputGUI($this->lng->txt('rep_robj_xtov_test_list_flt_tst_name'), 'flt_tst_name');
     $tname->setSubmitFormOnEnter(true);
     $this->addFilterItem($tname);
     $tname->readFromSession();
     $this->filter['flt_tst_name'] = $tname->getValue();
 }
 public function addToForm()
 {
     $text = new ilTextInputGUI($this->getTitle(), $this->getElementId());
     $text->setSize(20);
     $text->setMaxLength(512);
     $text->setSubmitFormOnEnter(true);
     $text->setValue($this->getADT()->getText());
     $this->addToParentElement($text);
 }
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser, $ilDB;
     // term
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("cont_term"), "term");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $ti->setSubmitFormOnEnter(true);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["term"] = $ti->getValue();
     // definition
     if ($ilDB->getDBType() != "oracle") {
         include_once "./Services/Form/classes/class.ilTextInputGUI.php";
         $ti = new ilTextInputGUI($lng->txt("cont_definition"), "defintion");
         $ti->setMaxLength(64);
         $ti->setSize(20);
         $ti->setSubmitFormOnEnter(true);
         $this->addFilterItem($ti);
         $ti->readFromSession();
         $this->filter["definition"] = $ti->getValue();
     }
 }
 /**
  *	Initialize the table filters.
  *
  *	This method is called internally to initialize
  *	the filters from present on the top of the table.
  */
 public function initFilter()
 {
     include_once 'Services/Form/classes/class.ilTextInputGUI.php';
     include_once 'Services/Form/classes/class.ilSelectInputGUI.php';
     include_once ilPlugin::getPluginObject(IL_COMP_SERVICE, 'Repository', 'robj', 'TestOverview')->getDirectory() . "/classes/mapper/class.ilOverviewMapper.php";
     /* Configure participant name filter (input[type=text]) */
     $pname = new ilTextInputGUI($this->lng->txt('rep_robj_xtov_overview_flt_participant_name'), 'flt_participant_name');
     $pname->setSubmitFormOnEnter(true);
     /* Configure participant group name filter (select) */
     $mapper = new ilOverviewMapper();
     $groups = $mapper->getGroupPairs($this->getParentObject()->object->getId());
     $groups = array("" => "-- Select --") + $groups;
     $gname = new ilSelectInputGUI($this->lng->txt("rep_robj_xtov_overview_flt_group_name"), 'flt_group_name');
     $gname->setOptions($groups);
     /* Configure filter form */
     $this->addFilterItem($pname);
     $this->addFilterItem($gname);
     $pname->readFromSession();
     $gname->readFromSession();
     $this->filter['flt_participant_name'] = $pname->getValue();
     $this->filter['flt_group_name'] = $gname->getValue();
 }
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser, $ilDB;
     // term
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("cont_term"), "term");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $ti->setSubmitFormOnEnter(true);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["term"] = $ti->getValue();
     // definition
     if ($ilDB->getDBType() != "oracle") {
         include_once "./Services/Form/classes/class.ilTextInputGUI.php";
         $ti = new ilTextInputGUI($lng->txt("cont_definition"), "defintion");
         $ti->setMaxLength(64);
         $ti->setSize(20);
         $ti->setSubmitFormOnEnter(true);
         $this->addFilterItem($ti);
         $ti->readFromSession();
         $this->filter["definition"] = $ti->getValue();
     }
     // advanced metadata
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_FILTER, 'glo', $this->glossary->getId(), 'term');
     $record_gui->setSelectedOnly(true);
     $record_gui->setTableGUI($this);
     $record_gui->parse();
 }
 public function initFilter()
 {
     include_once 'Services/Form/classes/class.ilTextInputGUI.php';
     $ul = new ilTextInputGUI($this->lng->txt('login') . '/' . $this->lng->txt('email') . '/' . $this->lng->txt('name'), 'query');
     $ul->setDataSource($this->ctrl->getLinkTarget($this->getParentObject(), 'lookupAddressbookAsync', '', true));
     $ul->setSize(20);
     $ul->setSubmitFormOnEnter(true);
     $this->addFilterItem($ul);
     $ul->readFromSession();
     $this->filter['query'] = $ul->getValue();
 }
示例#7
0
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser, $ilCtrl;
     // Show context filter
     if ($this->getMode() == self::MODE_LOCAL_USER) {
         include_once './Services/User/classes/class.ilLocalUser.php';
         $parent_ids = ilLocalUser::_getFolderIds();
         if (count($parent_ids) > 1) {
             include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
             $co = new ilSelectInputGUI($lng->txt('context'), 'time_limit_owner');
             $ref_id = $this->getUserFolderId();
             $opt[0] = $this->lng->txt('all_users');
             $opt[$this->getUserFolderId()] = $lng->txt('users') . ' (' . ilObject::_lookupTitle(ilObject::_lookupObjId($this->getUserFolderId())) . ')';
             foreach ($parent_ids as $parent_id) {
                 if ($parent_id == $this->getUserFolderId()) {
                     continue;
                 }
                 switch ($parent_id) {
                     case USER_FOLDER_ID:
                         $opt[USER_FOLDER_ID] = $lng->txt('global_user');
                         break;
                     default:
                         $opt[$parent_id] = $lng->txt('users') . ' (' . ilObject::_lookupTitle(ilObject::_lookupObjId($parent_id)) . ')';
                         break;
                 }
             }
             $co->setOptions($opt);
             $this->addFilterItem($co);
             $co->readFromSession();
             $this->filter['time_limit_owner'] = $co->getValue();
         }
     }
     // User name, login, email filter
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ul = new ilTextInputGUI($lng->txt("login") . "/" . $lng->txt("email") . "/" . $lng->txt("name"), "query");
     $ul->setDataSource($ilCtrl->getLinkTarget($this->getParentObject(), "addUserAutoComplete", "", true));
     $ul->setSize(20);
     $ul->setSubmitFormOnEnter(true);
     $this->addFilterItem($ul);
     $ul->readFromSession();
     $this->filter["query"] = $ul->getValue();
     /*
     include_once("./Services/Form/classes/class.ilTextInputGUI.php");
     $ti = new ilTextInputGUI($lng->txt("login")."/".$lng->txt("email")."/".$lng->txt("name"), "query");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $ti->setSubmitFormOnEnter(true);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["query"] = $ti->getValue();
     */
     // activation
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     $options = array("" => $lng->txt("user_all"), "active" => $lng->txt("active"), "inactive" => $lng->txt("inactive"));
     $si = new ilSelectInputGUI($this->lng->txt("user_activation"), "activation");
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter["activation"] = $si->getValue();
     // limited access
     include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
     $cb = new ilCheckboxInputGUI($this->lng->txt("user_limited_access"), "limited_access");
     $this->addFilterItem($cb);
     $cb->readFromSession();
     $this->filter["limited_access"] = $cb->getChecked();
     // last login
     include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php";
     $di = new ilDateTimeInputGUI($this->lng->txt("user_last_login_before"), "last_login");
     $default_date = new ilDateTime(time(), IL_CAL_UNIX);
     $default_date->increment(IL_CAL_DAY, 1);
     $di->setDate($default_date);
     $this->addFilterItem($di);
     $di->readFromSession();
     $this->filter["last_login"] = $di->getDate();
     if ($this->getMode() == self::MODE_USER_FOLDER) {
         // no assigned courses
         include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
         $cb = new ilCheckboxInputGUI($this->lng->txt("user_no_courses"), "no_courses");
         $this->addFilterItem($cb);
         $cb->readFromSession();
         $this->filter["no_courses"] = $cb->getChecked();
         // no assigned groups
         include_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
         $ng = new ilCheckboxInputGUI($this->lng->txt("user_no_groups"), "no_groups");
         $this->addFilterItem($ng);
         $ng->readFromSession();
         $this->filter['no_groups'] = $ng->getChecked();
         // course/group members
         include_once "./Services/Form/classes/class.ilRepositorySelectorInputGUI.php";
         $rs = new ilRepositorySelectorInputGUI($lng->txt("user_member_of_course_group"), "course_group");
         $rs->setSelectText($lng->txt("user_select_course_group"));
         $rs->setHeaderMessage($lng->txt("user_please_select_course_group"));
         $rs->setClickableTypes(array("crs", "grp"));
         $this->addFilterItem($rs);
         $rs->readFromSession();
         $this->filter["course_group"] = $rs->getValue();
     }
     // global roles
     $options = array("" => $lng->txt("user_any"));
     $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
     foreach ($roles as $role) {
         $options[$role["rol_id"]] = $role["title"];
     }
     $si = new ilSelectInputGUI($this->lng->txt("user_global_role"), "global_role");
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter["global_role"] = $si->getValue();
 }
示例#8
0
 /**
  * init create/edit form
  *
  * @access protected
  * @param string edit or create
  * @return
  */
 protected function initForm($a_mode = 'edit')
 {
     global $ilUser, $tpl, $tree;
     if (is_object($this->form)) {
         return true;
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     switch ($a_mode) {
         case 'edit':
             $this->form->setFormAction($this->ctrl->getFormAction($this, 'update'));
             break;
         default:
             $this->form->setTableWidth('600px');
             $this->form->setFormAction($this->ctrl->getFormAction($this, 'save'));
             break;
     }
     // title
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setSubmitFormOnEnter(true);
     $title->setValue($this->object->getTitle());
     $title->setSize(min(40, ilObject::TITLE_LENGTH));
     $title->setMaxLength(ilObject::TITLE_LENGTH);
     $title->setRequired(true);
     $this->form->addItem($title);
     // desc
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $desc->setValue($this->object->getLongDescription());
     $desc->setRows(2);
     $desc->setCols(40);
     $this->form->addItem($desc);
     // Group type
     $grp_type = new ilRadioGroupInputGUI($this->lng->txt('grp_typ'), 'grp_type');
     if ($a_mode == 'edit') {
         $type = $this->object->getGroupType() ? $this->object->getGroupType() : $this->object->readGroupStatus();
     } else {
         $type = $this->object->getGroupType() ? $this->object->getGroupType() : GRP_TYPE_PUBLIC;
     }
     $grp_type->setValue($type);
     $grp_type->setRequired(true);
     // PUBLIC GROUP
     $opt_public = new ilRadioOption($this->lng->txt('grp_public'), GRP_TYPE_PUBLIC, $this->lng->txt('grp_public_info'));
     $grp_type->addOption($opt_public);
     // CLOSED GROUP
     $opt_closed = new ilRadioOption($this->lng->txt('grp_closed'), GRP_TYPE_CLOSED, $this->lng->txt('grp_closed_info'));
     $grp_type->addOption($opt_closed);
     $this->form->addItem($grp_type);
     if ($a_mode == 'edit') {
         // Group registration ############################################################
         $pres = new ilFormSectionHeaderGUI();
         $pres->setTitle($this->lng->txt('grp_setting_header_registration'));
         $this->form->addItem($pres);
         // Registration type
         $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type');
         $reg_type->setValue($this->object->getRegistrationType());
         $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'), GRP_REGISTRATION_DIRECT);
         #$this->lng->txt('grp_reg_direct_info'));
         $reg_type->addOption($opt_dir);
         $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'), GRP_REGISTRATION_PASSWORD);
         $pass = new ilTextInputGUI($this->lng->txt("password"), 'password');
         $pass->setInfo($this->lng->txt('grp_reg_password_info'));
         $pass->setValue($this->object->getPassword());
         $pass->setSize(10);
         $pass->setMaxLength(32);
         $opt_pass->addSubItem($pass);
         $reg_type->addOption($opt_pass);
         $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info'));
         $reg_type->addOption($opt_req);
         $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_no_selfreg'), GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info'));
         $reg_type->addOption($opt_deact);
         // Registration codes
         $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled');
         $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
         $reg_code->setValue(1);
         $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
         $this->form->addItem($reg_type);
         // Registration codes
         if (!$this->object->getRegistrationAccessCode()) {
             include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
             $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
         }
         $reg_link = new ilHiddenInputGUI('reg_code');
         $reg_link->setValue($this->object->getRegistrationAccessCode());
         $this->form->addItem($reg_link);
         $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link'));
         include_once './Services/Link/classes/class.ilLink.php';
         $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode());
         $link->setHTML('<font class="small">' . $val . '</font>');
         $reg_code->addSubItem($link);
         $this->form->addItem($reg_code);
         // time limit
         $time_limit = new ilCheckboxInputGUI($this->lng->txt('grp_reg_limited'), 'reg_limit_time');
         //			$time_limit->setOptionTitle($this->lng->txt('grp_reg_limit_time'));
         $time_limit->setChecked($this->object->isRegistrationUnlimited() ? false : true);
         $this->lng->loadLanguageModule('dateplaner');
         include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
         $tpl->addJavaScript('./Services/Form/js/date_duration.js');
         $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_period'), 'reg');
         $dur->setStartText($this->lng->txt('cal_start'));
         $dur->setEndText($this->lng->txt('cal_end'));
         $dur->setShowTime(true);
         $dur->setStart($this->object->getRegistrationStart());
         $dur->setEnd($this->object->getRegistrationEnd());
         $time_limit->addSubItem($dur);
         $this->form->addItem($time_limit);
         // max member
         $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'), 'registration_membership_limited');
         $lim->setValue(1);
         //			$lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
         $lim->setChecked($this->object->isMembershipLimited());
         $max = new ilTextInputGUI($this->lng->txt('reg_grp_max_members'), 'registration_max_members');
         $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
         //$max->setTitle($this->lng->txt('members'));
         $max->setSize(3);
         $max->setMaxLength(4);
         $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
         $lim->addSubItem($max);
         $wait = new ilCheckboxInputGUI($this->lng->txt('grp_waiting_list'), 'waiting_list');
         $wait->setValue(1);
         //$wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
         $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
         $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
         $lim->addSubItem($wait);
         $this->form->addItem($lim);
         // Group presentation
         $hasParentMembership = $tree->checkForParentType($this->object->getRefId(), 'crs') || $tree->checkForParentType($this->object->getRefId(), 'grp');
         $pres = new ilFormSectionHeaderGUI();
         $pres->setTitle($this->lng->txt('grp_setting_header_presentation'));
         $this->form->addItem($pres);
         // presentation type
         $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'), 'view_mode');
         if ($hasParentMembership) {
             switch ($this->object->getViewMode()) {
                 case ilContainer::VIEW_SESSIONS:
                     $course_view_mode = ': ' . $this->lng->txt('cntr_view_sessions');
                     break;
                 case ilContainer::VIEW_SIMPLE:
                     $course_view_mode = ': ' . $this->lng->txt('cntr_view_simple');
                     break;
                 case ilContainer::VIEW_BY_TYPE:
                     $course_view_mode = ': ' . $this->lng->txt('cntr_view_by_type');
                     break;
             }
             $opt = new ilRadioOption($this->lng->txt('grp_view_inherit') . $course_view_mode, ilContainer::VIEW_INHERIT);
             $opt->setInfo($this->lng->txt('grp_view_inherit_info'));
             $view_type->addOption($opt);
         }
         if ($hasParentMembership && $this->object->getViewMode(false) == ilContainer::VIEW_INHERIT) {
             $view_type->setValue(ilContainer::VIEW_INHERIT);
         } else {
             $view_type->setValue($this->object->getViewMode(true));
         }
         $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'), ilContainer::VIEW_SIMPLE);
         $opt->setInfo($this->lng->txt('grp_view_info_simple'));
         $view_type->addOption($opt);
         $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), ilContainer::VIEW_BY_TYPE);
         $opt->setInfo($this->lng->txt('grp_view_info_by_type'));
         $view_type->addOption($opt);
         $this->form->addItem($view_type);
         // Sorting
         $sorting_settings = array();
         if ($hasParentMembership) {
             $sorting_settings[] = ilContainer::SORT_INHERIT;
         }
         $sorting_settings[] = ilContainer::SORT_TITLE;
         $sorting_settings[] = ilContainer::SORT_CREATION;
         $sorting_settings[] = ilContainer::SORT_MANUAL;
         $this->initSortingForm($this->form, $sorting_settings);
         // additional features
         $feat = new ilFormSectionHeaderGUI();
         $feat->setTitle($this->lng->txt('obj_features'));
         $this->form->addItem($feat);
         include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
         ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $this->form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY, ilObjectServiceSettingsGUI::AUTO_RATING_NEW_OBJECTS, ilObjectServiceSettingsGUI::TAG_CLOUD));
         // Notification Settings
         /*$notification = new ilFormSectionHeaderGUI();
         		$notification->setTitle($this->lng->txt('grp_notification'));
         		$this->form->addItem($notification);*/
         // Show members type
         $mail_type = new ilRadioGroupInputGUI($this->lng->txt('grp_mail_type'), 'mail_type');
         $mail_type->setValue($this->object->getMailToMembersType());
         $mail_tutors = new ilRadioOption($this->lng->txt('grp_mail_tutors_only'), ilObjGroup::MAIL_ALLOWED_TUTORS, $this->lng->txt('grp_mail_tutors_only_info'));
         $mail_type->addOption($mail_tutors);
         $mail_all = new ilRadioOption($this->lng->txt('grp_mail_all'), ilObjGroup::MAIL_ALLOWED_ALL, $this->lng->txt('grp_mail_all_info'));
         $mail_type->addOption($mail_all);
         $this->form->addItem($mail_type);
     }
     switch ($a_mode) {
         case 'create':
             $this->form->setTitle($this->lng->txt('grp_new'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.svg'));
             $this->form->addCommandButton('save', $this->lng->txt('grp_new'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
         case 'edit':
             $this->form->setTitle($this->lng->txt('grp_edit'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.svg'));
             // Edit ecs export settings
             include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
             $ecs = new ilECSGroupSettings($this->object);
             $ecs->addSettingsToForm($this->form, 'grp');
             $this->form->addCommandButton('update', $this->lng->txt('save'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
     }
     return true;
 }
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser;
     include_once "./Services/User/classes/class.ilAccountCode.php";
     // code
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("user_account_code"), "query");
     $ti->setMaxLength(ilAccountCode::CODE_LENGTH);
     $ti->setSize(20);
     $ti->setSubmitFormOnEnter(true);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["code"] = $ti->getValue();
     // generated
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     $options = array("" => $lng->txt("user_account_code_generated_all"));
     foreach ((array) ilAccountCode::getGenerationDates() as $date) {
         $options[$date] = ilDatePresentation::formatDate(new ilDateTime($date, IL_CAL_UNIX));
     }
     $si = new ilSelectInputGUI($lng->txt("user_account_code_generated"), "generated");
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter["generated"] = $si->getValue();
 }
 /**
  * init create/edit form
  *
  * @access protected
  * @param string edit or create
  * @return
  */
 protected function initForm($a_mode = 'edit')
 {
     global $ilUser, $tpl, $tree;
     if (is_object($this->form)) {
         return true;
     }
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     switch ($a_mode) {
         case 'edit':
             $this->form->setFormAction($this->ctrl->getFormAction($this, 'update'));
             break;
         default:
             $this->form->setTableWidth('600px');
             $this->form->setFormAction($this->ctrl->getFormAction($this, 'save'));
             break;
     }
     // title
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setSubmitFormOnEnter(true);
     $title->setValue($this->object->getTitle());
     $title->setSize(40);
     $title->setMaxLength(128);
     $title->setRequired(true);
     $this->form->addItem($title);
     // desc
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $desc->setValue($this->object->getLongDescription());
     $desc->setRows(2);
     $desc->setCols(40);
     $this->form->addItem($desc);
     // Group type
     $grp_type = new ilRadioGroupInputGUI($this->lng->txt('grp_typ'), 'grp_type');
     if ($a_mode == 'edit') {
         $type = $this->object->getGroupType() ? $this->object->getGroupType() : $this->object->readGroupStatus();
     } else {
         $type = $this->object->getGroupType() ? $this->object->getGroupType() : GRP_TYPE_PUBLIC;
     }
     $grp_type->setValue($type);
     $grp_type->setRequired(true);
     // PUBLIC GROUP
     $opt_public = new ilRadioOption($this->lng->txt('grp_public'), GRP_TYPE_PUBLIC, $this->lng->txt('grp_public_info'));
     $grp_type->addOption($opt_public);
     // CLOSED GROUP
     $opt_closed = new ilRadioOption($this->lng->txt('grp_closed'), GRP_TYPE_CLOSED, $this->lng->txt('grp_closed_info'));
     $grp_type->addOption($opt_closed);
     if ($a_mode == 'update_group_type') {
         $grp_type->setAlert($this->lng->txt('grp_type_changed_info'));
     }
     $this->form->addItem($grp_type);
     if ($a_mode == 'edit') {
         // Group registration ############################################################
         $pres = new ilFormSectionHeaderGUI();
         $pres->setTitle($this->lng->txt('grp_setting_header_registration'));
         $this->form->addItem($pres);
         // Registration type
         $reg_type = new ilRadioGroupInputGUI($this->lng->txt('group_registration_mode'), 'registration_type');
         $reg_type->setValue($this->object->getRegistrationType());
         $opt_dir = new ilRadioOption($this->lng->txt('grp_reg_direct'), GRP_REGISTRATION_DIRECT);
         #$this->lng->txt('grp_reg_direct_info'));
         $reg_type->addOption($opt_dir);
         $opt_pass = new ilRadioOption($this->lng->txt('grp_pass_request'), GRP_REGISTRATION_PASSWORD);
         $pass = new ilTextInputGUI('', 'password');
         $pass->setInfo($this->lng->txt('grp_reg_password_info'));
         $pass->setValue($this->object->getPassword());
         $pass->setSize(10);
         $pass->setMaxLength(32);
         $opt_pass->addSubItem($pass);
         $reg_type->addOption($opt_pass);
         $opt_req = new ilRadioOption($this->lng->txt('grp_reg_request'), GRP_REGISTRATION_REQUEST, $this->lng->txt('grp_reg_request_info'));
         $reg_type->addOption($opt_req);
         $opt_deact = new ilRadioOption($this->lng->txt('grp_reg_disabled'), GRP_REGISTRATION_DEACTIVATED, $this->lng->txt('grp_reg_disabled_info'));
         $reg_type->addOption($opt_deact);
         // Registration codes
         $reg_code = new ilCheckboxInputGUI($this->lng->txt('grp_reg_code'), 'reg_code_enabled');
         $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
         $reg_code->setValue(1);
         $reg_code->setInfo($this->lng->txt('grp_reg_code_enabled_info'));
         $this->form->addItem($reg_type);
         // time limit
         $time_limit = new ilCheckboxInputGUI($this->lng->txt('grp_reg_limited'), 'reg_limit_time');
         $time_limit->setOptionTitle($this->lng->txt('grp_reg_limit_time'));
         $time_limit->setChecked($this->object->isRegistrationUnlimited() ? false : true);
         $this->lng->loadLanguageModule('dateplaner');
         include_once './Services/Form/classes/class.ilDateDurationInputGUI.php';
         $tpl->addJavaScript('./Services/Form/js/date_duration.js');
         $dur = new ilDateDurationInputGUI($this->lng->txt('grp_reg_period'), 'reg');
         $dur->setStartText($this->lng->txt('cal_start'));
         $dur->setEndText($this->lng->txt('cal_end'));
         $dur->setMinuteStepSize(5);
         $dur->setShowDate(true);
         $dur->setShowTime(true);
         $dur->setStart($this->object->getRegistrationStart());
         $dur->setEnd($this->object->getRegistrationEnd());
         $time_limit->addSubItem($dur);
         $this->form->addItem($time_limit);
         // max member
         $lim = new ilCheckboxInputGUI($this->lng->txt('reg_grp_max_members_short'), 'registration_membership_limited');
         $lim->setValue(1);
         $lim->setOptionTitle($this->lng->txt('reg_grp_max_members'));
         $lim->setChecked($this->object->isMembershipLimited());
         $max = new ilTextInputGUI('', 'registration_max_members');
         $max->setValue($this->object->getMaxMembers() ? $this->object->getMaxMembers() : '');
         $max->setTitle($this->lng->txt('members') . ':');
         $max->setSize(3);
         $max->setMaxLength(4);
         $max->setInfo($this->lng->txt('grp_reg_max_members_info'));
         $lim->addSubItem($max);
         $wait = new ilCheckboxInputGUI('', 'waiting_list');
         $wait->setValue(1);
         $wait->setOptionTitle($this->lng->txt('grp_waiting_list'));
         $wait->setInfo($this->lng->txt('grp_waiting_list_info'));
         $wait->setChecked($this->object->isWaitingListEnabled() ? true : false);
         $lim->addSubItem($wait);
         $this->form->addItem($lim);
         // Registration codes
         if (!$this->object->getRegistrationAccessCode()) {
             include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
             $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
         }
         $reg_link = new ilHiddenInputGUI('reg_code');
         $reg_link->setValue($this->object->getRegistrationAccessCode());
         $this->form->addItem($reg_link);
         $link = new ilCustomInputGUI($this->lng->txt('grp_reg_code_link'));
         include_once './Services/Link/classes/class.ilLink.php';
         $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode());
         $link->setHTML('<font class="small">' . $val . '</font>');
         $reg_code->addSubItem($link);
         $this->form->addItem($reg_code);
         // Group presentation
         $hasParentCourse = $tree->checkForParentType($this->object->getRefId(), 'crs');
         $pres = new ilFormSectionHeaderGUI();
         $pres->setTitle($this->lng->txt('grp_setting_header_presentation'));
         $this->form->addItem($pres);
         // presentation type
         $view_type = new ilRadioGroupInputGUI($this->lng->txt('grp_presentation_type'), 'view_mode');
         if ($hasParentCourse) {
             switch ($this->object->getViewMode()) {
                 case ilContainer::VIEW_SESSIONS:
                     $course_view_mode = ' (' . $this->lng->txt('cntr_view_sessions') . ')';
                     break;
                 case ilContainer::VIEW_SIMPLE:
                     $course_view_mode = ' (' . $this->lng->txt('cntr_view_simple') . ')';
                     break;
                 case ilContainer::VIEW_BY_TYPE:
                     $course_view_mode = ' (' . $this->lng->txt('cntr_view_by_type') . ')';
                     break;
             }
             $opt = new ilRadioOption($this->lng->txt('grp_view_inherit') . $course_view_mode, ilContainer::VIEW_INHERIT);
             $opt->setInfo($this->lng->txt('grp_view_inherit_info'));
             $view_type->addOption($opt);
         }
         if ($hasParentCourse && $this->object->getViewMode(false) == ilContainer::VIEW_INHERIT) {
             $view_type->setValue(ilContainer::VIEW_INHERIT);
         } else {
             $view_type->setValue($this->object->getViewMode(true));
         }
         $opt = new ilRadioOption($this->lng->txt('cntr_view_simple'), ilContainer::VIEW_SIMPLE);
         $opt->setInfo($this->lng->txt('grp_view_info_simple'));
         $view_type->addOption($opt);
         $opt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), ilContainer::VIEW_BY_TYPE);
         $opt->setInfo($this->lng->txt('grp_view_info_by_type'));
         $view_type->addOption($opt);
         $this->form->addItem($view_type);
         $sog = new ilRadioGroupInputGUI($this->lng->txt('sorting_header'), 'sor');
         $sog->setRequired(true);
         if ($a_mode == 'edit') {
             $sog->setValue(ilContainerSortingSettings::_readSortMode(ilObject::_lookupObjId($this->object->getRefId())));
         } elseif ($hasParentCourse) {
             $sog->setValue(ilContainer::SORT_INHERIT);
         } else {
             $sog->setValue(ilContainer::SORT_TITLE);
         }
         if ($hasParentCourse) {
             $sde = new ilRadioOption();
             $sde->setValue(ilContainer::SORT_INHERIT);
             $title = $this->lng->txt('sort_inherit_prefix');
             $title .= ' (' . ilContainerSortingSettings::sortModeToString(ilContainerSortingSettings::lookupSortModeFromParentContainer(ilObject::_lookupObjectId($ref_id))) . ') ';
             $sde->setTitle($title);
             $sde->setInfo($this->lng->txt('sorting_info_inherit'));
             $sog->addOption($sde);
         }
         $sma = new ilRadioOption();
         $sma->setValue(ilContainer::SORT_TITLE);
         $sma->setTitle($this->lng->txt('sorting_title_header'));
         $sma->setInfo($this->lng->txt('sorting_info_title'));
         $sog->addOption($sma);
         $sti = new ilRadioOption();
         $sti->setValue(ilContainer::SORT_MANUAL);
         $sti->setTitle($this->lng->txt('sorting_manual_header'));
         $sti->setInfo($this->lng->txt('sorting_info_manual'));
         $sog->addOption($sti);
         $this->form->addItem($sog);
         include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
         ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $this->form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY));
     }
     switch ($a_mode) {
         case 'create':
             $this->form->setTitle($this->lng->txt('grp_new'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
             $this->form->addCommandButton('save', $this->lng->txt('grp_new'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
         case 'edit':
             $this->form->setTitle($this->lng->txt('grp_edit'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
             // Edit ecs export settings
             include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
             $ecs = new ilECSGroupSettings($this->object);
             $ecs->addSettingsToForm($this->form, 'grp');
             $this->form->addCommandButton('update', $this->lng->txt('save'));
             $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
             return true;
         case 'update_group_type':
             $grp_type->setValue($type == GRP_TYPE_PUBLIC ? GRP_TYPE_CLOSED : GRP_TYPE_PUBLIC);
             $this->form->setTitle($this->lng->txt('grp_edit'));
             $this->form->setTitleIcon(ilUtil::getImagePath('icon_grp.png'));
             return true;
     }
     return true;
 }
 /**
  * init form
  *
  * @access protected
  * @param
  * @return
  */
 protected function initEditForm()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/Calendar/classes/class.ilDateTime.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('crs_edit'));
     $form->setTitleIcon(ilUtil::getImagePath('icon_crs_s.png'));
     $form->addCommandButton('update', $this->lng->txt('save'));
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $form->setFormAction($this->ctrl->getFormAction($this, 'update'));
     // title
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setSubmitFormOnEnter(true);
     $title->setValue($this->object->getTitle());
     $title->setSize(40);
     $title->setMaxLength(128);
     $title->setRequired(true);
     $form->addItem($title);
     // desc
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $desc->setValue($this->object->getLongDescription());
     $desc->setRows(2);
     $desc->setCols(40);
     $form->addItem($desc);
     // Show didactic template type
     $this->initDidacticTemplate($form);
     // activation/availability
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'activation_online');
     $online->setChecked(!$this->object->getOfflineStatus());
     $online->setInfo($this->lng->txt('crs_activation_online_info'));
     $form->addItem($online);
     $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
     $act_type->setValue($this->object->getActivationType());
     $opt = new ilRadioOption($this->lng->txt('crs_visibility_limitless'), IL_CRS_ACTIVATION_UNLIMITED);
     $opt->setInfo($this->lng->txt('crs_availability_limitless_info'));
     $act_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_visibility_until'), IL_CRS_ACTIVATION_LIMITED);
     $opt->setInfo($this->lng->txt('crs_availability_until_info'));
     $start = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_start'), 'activation_start');
     #$start->setMode(ilDateTimeInputGUI::MODE_INPUT);
     $start->setShowTime(true);
     $start_date = new ilDateTime($this->object->getActivationStart(), IL_CAL_UNIX);
     $start->setDate($start_date);
     $opt->addSubItem($start);
     $end = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_end'), 'activation_end');
     #$end->setMode(ilDateTimeInputGUI::MODE_INPUT);
     $end->setShowTime(true);
     $end_date = new ilDateTime($this->object->getActivationEnd(), IL_CAL_UNIX);
     $end->setDate($end_date);
     $opt->addSubItem($end);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('crs_activation_limited_visibility_info'));
     $visible->setChecked($this->object->getActivationVisibility());
     $opt->addSubItem($visible);
     $act_type->addOption($opt);
     $form->addItem($act_type);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('crs_reg'));
     $form->addItem($section);
     $reg_type = new ilRadioGroupInputGUI($this->lng->txt('crs_reg_period'), 'subscription_limitation_type');
     $reg_type->setValue($this->object->getSubscriptionLimitationType());
     $opt = new ilRadioOption($this->lng->txt('crs_reg_deactivated'), IL_CRS_SUBSCRIPTION_DEACTIVATED);
     $opt->setInfo($this->lng->txt('crs_registration_deactivated'));
     $reg_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_registration_unlimited'), IL_CRS_SUBSCRIPTION_UNLIMITED);
     $opt->setInfo($this->lng->txt('crs_reg_unlim_info'));
     $reg_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_registration_limited'), IL_CRS_SUBSCRIPTION_LIMITED);
     $opt->setInfo($this->lng->txt('crs_reg_lim_info'));
     $start = new ilDateTimeInputGUI($this->lng->txt('crs_start'), 'subscription_start');
     $start->setShowTime(true);
     $start_date = new ilDateTime($this->object->getSubscriptionStart(), IL_CAL_UNIX);
     $start->setDate($start_date);
     $opt->addSubItem($start);
     $end = new ilDateTimeInputGUI($this->lng->txt('crs_end'), 'subscription_end');
     $end->setShowTime(true);
     $end_date = new ilDateTime($this->object->getSubscriptionEnd(), IL_CAL_UNIX);
     $end->setDate($end_date);
     $opt->addSubItem($end);
     $reg_type->addOption($opt);
     $form->addItem($reg_type);
     $reg_proc = new ilRadioGroupInputGUI($this->lng->txt('crs_registration_type'), 'subscription_type');
     $reg_proc->setValue($this->object->getSubscriptionType());
     $reg_proc->setInfo($this->lng->txt('crs_reg_type_info'));
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_confirmation'), IL_CRS_SUBSCRIPTION_CONFIRMATION);
     $reg_proc->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_direct'), IL_CRS_SUBSCRIPTION_DIRECT);
     $reg_proc->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_password'), IL_CRS_SUBSCRIPTION_PASSWORD);
     $pass = new ilTextInputGUI('', 'subscription_password');
     $pass->setSubmitFormOnEnter(true);
     $pass->setSize(12);
     $pass->setMaxLength(12);
     $pass->setValue($this->object->getSubscriptionPassword());
     $opt->addSubItem($pass);
     $reg_proc->addOption($opt);
     $form->addItem($reg_proc);
     // Registration codes
     $reg_code = new ilCheckboxInputGUI('', 'reg_code_enabled');
     $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
     $reg_code->setValue(1);
     $reg_code->setInfo($this->lng->txt('crs_reg_code_enabled_info'));
     $reg_code->setOptionTitle($this->lng->txt('crs_reg_code'));
     /*
     $code = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_value'));
     $code->setValue($this->object->getRegistrationAccessCode());
     $reg_code->addSubItem($code);
     */
     #$link = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_link'));
     // Create default access code
     if (!$this->object->getRegistrationAccessCode()) {
         include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
         $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
     }
     $reg_link = new ilHiddenInputGUI('reg_code');
     $reg_link->setValue($this->object->getRegistrationAccessCode());
     $form->addItem($reg_link);
     $link = new ilCustomInputGUI($this->lng->txt('crs_reg_code_link'));
     include_once './Services/Link/classes/class.ilLink.php';
     $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode());
     $link->setHTML('<font class="small">' . $val . '</font>');
     $reg_code->addSubItem($link);
     $form->addItem($reg_code);
     // Max members
     $lim = new ilCheckboxInputGUI($this->lng->txt('crs_subscription_max_members_short'), 'subscription_membership_limitation');
     $lim->setValue(1);
     $lim->setOptionTitle($this->lng->txt('crs_subscription_max_members'));
     $lim->setChecked($this->object->isSubscriptionMembershipLimited());
     $max = new ilTextInputGUI('', 'subscription_max');
     $max->setSubmitFormOnEnter(true);
     $max->setSize(4);
     $max->setMaxLength(4);
     $max->setValue($this->object->getSubscriptionMaxMembers() ? $this->object->getSubscriptionMaxMembers() : '');
     $max->setTitle($this->lng->txt('members') . ':');
     $max->setInfo($this->lng->txt('crs_reg_max_info'));
     $lim->addSubItem($max);
     $wait = new ilCheckboxInputGUI('', 'waiting_list');
     $wait->setOptionTitle($this->lng->txt('crs_waiting_list'));
     $wait->setChecked($this->object->enabledWaitingList());
     $wait->setInfo($this->lng->txt('crs_wait_info'));
     $lim->addSubItem($wait);
     $form->addItem($lim);
     $not = new ilCheckboxInputGUI($this->lng->txt('crs_auto_notification'), 'auto_notification');
     $not->setValue(1);
     $not->setInfo($this->lng->txt('crs_auto_notification_info'));
     $not->setChecked($this->object->getAutoNotification());
     $form->addItem($not);
     $pres = new ilFormSectionHeaderGUI();
     $pres->setTitle($this->lng->txt('crs_view_mode'));
     $form->addItem($pres);
     // presentation type
     $view_type = new ilRadioGroupInputGUI($this->lng->txt('crs_presentation_type'), 'view_mode');
     $view_type->setValue($this->object->getViewMode());
     $opts = new ilRadioOption($this->lng->txt('cntr_view_sessions'), IL_CRS_VIEW_SESSIONS);
     $opts->setInfo($this->lng->txt('cntr_view_info_sessions'));
     $view_type->addOption($opts);
     // Limited sessions
     $sess = new ilCheckboxInputGUI($this->lng->txt('sess_limit'), 'sl');
     $sess->setValue(1);
     $sess->setChecked($this->object->isSessionLimitEnabled());
     $sess->setInfo($this->lng->txt('sess_limit_info'));
     $prev = new ilNumberInputGUI($this->lng->txt('sess_num_prev'), 'sp');
     #$prev->setSubmitFormOnEnter(true);
     $prev->setMinValue(0);
     $prev->setValue($this->object->getNumberOfPreviousSessions() == -1 ? '' : $this->object->getNumberOfPreviousSessions());
     $prev->setSize(2);
     $prev->setMaxLength(3);
     $sess->addSubItem($prev);
     $next = new ilNumberInputGUI($this->lng->txt('sess_num_next'), 'sn');
     #$next->setSubmitFormOnEnter(true);
     $next->setMinValue(0);
     $next->setValue($this->object->getNumberOfNextSessions() == -1 ? '' : $this->object->getNumberOfnextSessions());
     $next->setSize(2);
     $next->setMaxLength(3);
     $sess->addSubItem($next);
     $opts->addSubItem($sess);
     $optsi = new ilRadioOption($this->lng->txt('cntr_view_simple'), IL_CRS_VIEW_SIMPLE);
     $optsi->setInfo($this->lng->txt('cntr_view_info_simple'));
     $view_type->addOption($optsi);
     $optbt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), IL_CRS_VIEW_BY_TYPE);
     $optbt->setInfo($this->lng->txt('cntr_view_info_by_type'));
     $view_type->addOption($optbt);
     $opto = new ilRadioOption($this->lng->txt('crs_view_objective'), IL_CRS_VIEW_OBJECTIVE);
     $opto->setInfo($this->lng->txt('crs_view_info_objective'));
     $view_type->addOption($opto);
     $optt = new ilRadioOption($this->lng->txt('crs_view_timing'), IL_CRS_VIEW_TIMING);
     $optt->setInfo($this->lng->txt('crs_view_info_timing'));
     $view_type->addOption($optt);
     /*
     	$opt = new ilRadioOption($this->lng->txt('crs_view_archive'),IL_CRS_VIEW_ARCHIVE);
     	$opt->setInfo($this->lng->txt('crs_archive_info'));
     	
     		$down = new ilCheckboxInputGUI('','archive_type');
     		$down->setOptionTitle($this->lng->txt('crs_archive_download'));
     		$down->setChecked($this->object->getArchiveType() == IL_CRS_ARCHIVE_DOWNLOAD);
     		$opt->addSubItem($down);
     		
     		$start = new ilDateTimeInputGUI($this->lng->txt('crs_start'),'archive_start');
     		$start->setShowTime(true);
     		$start_date = new ilDateTime($this->object->getArchiveStart(),IL_CAL_UNIX);
     		$start->setDate($start_date);
     		$opt->addSubItem($start);
     
     		$end = new ilDateTimeInputGUI($this->lng->txt('crs_end'),'archive_end');
     		$end->setShowTime(true);
     		$end_date = new ilDateTime($this->object->getArchiveEnd(),IL_CAL_UNIX);
     		$end->setDate($end_date);
     		$opt->addSubItem($end);
     		
     	$view_type->addOption($opt);
     */
     $form->addItem($view_type);
     // sorting type
     $sort = new ilRadioGroupInputGUI($this->lng->txt('crs_sortorder_abo'), 'order_type');
     $sort->setValue($this->object->getOrderType());
     $opt = new ilRadioOption($this->lng->txt('crs_sort_title'), ilContainer::SORT_TITLE);
     $opt->setInfo($this->lng->txt('crs_sort_title_info'));
     $sort->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_sort_manual'), ilContainer::SORT_MANUAL);
     $opt->setInfo($this->lng->txt('crs_sort_manual_info'));
     $sort->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_sort_activation'), ilContainer::SORT_ACTIVATION);
     $opt->setInfo($this->lng->txt('crs_sort_timing_info'));
     $sort->addOption($opt);
     $form->addItem($sort);
     include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
     ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY));
     // lp vs. course status
     include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
     if (ilObjUserTracking::_enabledLearningProgress()) {
         include_once './Services/Tracking/classes/class.ilLPObjSettings.php';
         $lp_settings = new ilLPObjSettings($this->object->getId());
         if ($lp_settings->getMode()) {
             $lp_status = new ilFormSectionHeaderGUI();
             $lp_status->setTitle($this->lng->txt('crs_course_status_of_users'));
             $form->addItem($lp_status);
             $lp_status_options = new ilRadioGroupInputGUI($this->lng->txt('crs_status_determination'), "status_dt");
             $lp_status_options->setRequired(true);
             $lp_status_options->setValue($this->object->getStatusDetermination());
             $lp_option = new ilRadioOption($this->lng->txt('crs_status_determination_lp'), ilObjCourse::STATUS_DETERMINATION_LP);
             $lp_status_options->addOption($lp_option);
             $lp_status_options->addOption(new ilRadioOption($this->lng->txt('crs_status_determination_manual'), ilObjCourse::STATUS_DETERMINATION_MANUAL));
             $form->addItem($lp_status_options);
         }
     }
     $further = new ilFormSectionHeaderGUI();
     $further->setTitle($this->lng->txt('crs_further_settings'));
     $form->addItem($further);
     $desk = new ilCheckboxInputGUI($this->lng->txt('crs_add_remove_from_desktop'), 'abo');
     $desk->setChecked($this->object->getAboStatus());
     $desk->setInfo($this->lng->txt('crs_add_remove_from_desktop_info'));
     $form->addItem($desk);
     $mem = new ilCheckboxInputGUI($this->lng->txt('crs_show_members'), 'show_members');
     $mem->setChecked($this->object->getShowMembers());
     $mem->setInfo($this->lng->txt('crs_show_members_info'));
     $form->addItem($mem);
     // Edit ecs export settings
     include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
     $ecs = new ilECSCourseSettings($this->object);
     $ecs->addSettingsToForm($form, 'crs');
     return $form;
 }
 public function getFormElement($a_query, $a_field_name, ilPropertyFormGUI $a_form)
 {
     include_once './Services/MetaData/classes/class.ilMDUtilSelect.php';
     $a_post_name = 'query[' . $a_field_name . ']';
     switch ($a_field_name) {
         case 'general_offline':
             $offline_options = array('0' => $this->lng->txt('search_any'), self::ONLINE_QUERY => $this->lng->txt('search_option_online'), self::OFFLINE_QUERY => $this->lng->txt('search_option_offline'));
             $offline = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $offline->setOptions($offline_options);
             $offline->setValue($a_query['general_offline']);
             return $offline;
         case 'lom_content':
             $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $text->setSubmitFormOnEnter(true);
             $text->setValue($a_query['lom_content']);
             $text->setSize(30);
             $text->setMaxLength(255);
             return $text;
             // General
         // General
         case 'lom_language':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_language']);
             $select->setOptions(ilMDUtilSelect::_getLanguageSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_keyword':
             $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $text->setSubmitFormOnEnter(true);
             $text->setValue($a_query['lom_keyword']);
             $text->setSize(30);
             $text->setMaxLength(255);
             return $text;
         case 'lom_coverage':
             $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $text->setSubmitFormOnEnter(true);
             $text->setValue($a_query['lom_coverage']);
             $text->setSize(30);
             $text->setMaxLength(255);
             return $text;
         case 'lom_structure':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_structure']);
             $select->setOptions(ilMDUtilSelect::_getStructureSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
             // Lifecycle
         // Lifecycle
         case 'lom_status':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_status']);
             $select->setOptions(ilMDUtilSelect::_getStatusSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_version':
             $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $text->setSubmitFormOnEnter(true);
             $text->setValue($a_query['lom_version']);
             $text->setSize(30);
             $text->setMaxLength(255);
             return $text;
         case 'lom_contribute':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], 'query[' . 'lom_role' . ']');
             $select->setValue($a_query['lom_role']);
             $select->setOptions(ilMDUtilSelect::_getRoleSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             $text = new ilTextInputGUI($this->lng->txt('meta_entry'), 'query[' . 'lom_role_entry' . ']');
             $text->setValue($a_query['lom_role_entry']);
             $text->setSize(30);
             $text->setMaxLength(255);
             $select->addSubItem($text);
             return $select;
             // Technical
         // Technical
         case 'lom_format':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_format']);
             $select->setOptions(ilMDUtilSelect::_getFormatSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_operating_system':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_operating_system']);
             $select->setOptions(ilMDUtilSelect::_getOperatingSystemSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_browser':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_browser']);
             $select->setOptions(ilMDUtilSelect::_getBrowserSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
             // Education
         // Education
         case 'lom_interactivity':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_interactivity']);
             $select->setOptions(ilMDUtilSelect::_getInteractivityTypeSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_resource':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_resource']);
             $select->setOptions(ilMDUtilSelect::_getLearningResourceTypeSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_level':
             $range = new ilCustomInputGUI($this->active_fields[$a_field_name]);
             $html = $this->getRangeSelect($this->lng->txt('from'), ilMDUtilSelect::_getInteractivityLevelSelect($a_query['lom_level_start'], 'query[' . 'lom_level_start' . ']', array(0 => $this->lng->txt('search_any'))), $this->lng->txt('until'), ilMDUtilSelect::_getInteractivityLevelSelect($a_query['lom_level_end'], 'query[' . 'lom_level_end' . ']', array(0 => $this->lng->txt('search_any'))));
             $range->setHTML($html);
             return $range;
         case 'lom_density':
             $range = new ilCustomInputGUI($this->active_fields[$a_field_name]);
             $html = $this->getRangeSelect($this->lng->txt('from'), ilMDUtilSelect::_getSemanticDensitySelect($a_query['lom_density_start'], 'query[' . 'lom_density_start' . ']', array(0 => $this->lng->txt('search_any'))), $this->lng->txt('until'), ilMDUtilSelect::_getSemanticDensitySelect($a_query['lom_density_end'], 'query[' . 'lom_density_end' . ']', array(0 => $this->lng->txt('search_any'))));
             $range->setHTML($html);
             return $range;
         case 'lom_user_role':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_user_role']);
             $select->setOptions(ilMDUtilSelect::_getIntendedEndUserRoleSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_context':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_context']);
             $select->setOptions(ilMDUtilSelect::_getContextSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_difficulty':
             $range = new ilCustomInputGUI($this->active_fields[$a_field_name]);
             $html = $this->getRangeSelect($this->lng->txt('from'), ilMDUtilSelect::_getDifficultySelect($a_query['lom_difficulty_start'], 'query[' . 'lom_difficulty_start' . ']', array(0 => $this->lng->txt('search_any'))), $this->lng->txt('until'), ilMDUtilSelect::_getDifficultySelect($a_query['lom_difficulty_end'], 'query[' . 'lom_difficulty_end' . ']', array(0 => $this->lng->txt('search_any'))));
             $range->setHTML($html);
             return $range;
             // Rights
         // Rights
         case 'lom_costs':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_costs']);
             $select->setOptions(ilMDUtilSelect::_getCostsSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_copyright':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_copyright']);
             $select->setOptions(ilMDUtilSelect::_getCopyrightAndOtherRestrictionsSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
             // Classification
         // Classification
         case 'lom_purpose':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_purpose']);
             $select->setOptions(ilMDUtilSelect::_getPurposeSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_taxon':
             $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $text->setSubmitFormOnEnter(true);
             $text->setValue($a_query['lom_taxon']);
             $text->setSize(30);
             $text->setMaxLength(255);
             return $text;
         default:
             if (substr($a_field_name, 0, 3) != 'adv') {
                 break;
             }
             // Advanced meta data
             $field_id = substr($a_field_name, 4);
             include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
             $field = ilAdvancedMDFieldDefinition::getInstance($field_id);
             $field_form = ilADTFactory::getInstance()->getSearchBridgeForDefinitionInstance($field->getADTDefinition(), true, false);
             $field_form->setForm($a_form);
             $field_form->setElementId($a_post_name);
             $field_form->setTitle($this->active_fields[$a_field_name]);
             $field_form->addToForm();
             // reload search values
             if (isset($a_query[$a_field_name])) {
                 $field_form->importFromPost($a_query);
                 $field_form->validate();
             }
             return;
     }
     return null;
 }
 /**
  * Parse property for filter (table)
  *
  * @access private
  * 
  */
 private function parseFilter()
 {
     global $ilUser;
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
     if ($this->getSelectedOnly()) {
         $recs = ilAdvancedMDRecord::_getSelectedRecordsByObject($this->obj_type, $this->obj_id, $this->sub_type);
     } else {
         $recs = ilAdvancedMDRecord::_getActivatedRecordsByObjectType($this->obj_type, $this->sub_type);
     }
     foreach ($recs as $record_obj) {
         include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
         foreach (ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record_obj->getRecordId()) as $def) {
             if ($this->handleECSDefinitions($def)) {
                 continue;
             }
             include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php';
             switch ($def->getFieldType()) {
                 case ilAdvancedMDFieldDefinition::TYPE_TEXT:
                     $text = new ilTextInputGUI($def->getTitle(), 'md_' . $def->getFieldId());
                     $text->setSize(20);
                     $text->setMaxLength(512);
                     $text->setSubmitFormOnEnter(true);
                     $this->table_gui->addFilterItem($text);
                     $text->readFromSession();
                     $this->table_gui->filter['md_' . $def->getFieldId()] = $text->getValue();
                     break;
                 case ilAdvancedMDFieldDefinition::TYPE_SELECT:
                     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
                     $select = new ilSelectInputGUI($def->getTitle(), 'md_' . $def->getFieldId());
                     $select->setOptions($def->getFieldValuesForSelect());
                     $this->table_gui->addFilterItem($select);
                     $select->readFromSession();
                     $this->table_gui->filter['md_' . $def->getFieldId()] = $select->getValue();
                     break;
                 case ilAdvancedMDFieldDefinition::TYPE_DATE:
                     include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php";
                     $time = new ilDateTimeInputGUI($def->getTitle(), 'md_' . $def->getFieldId());
                     $time->setShowTime(false);
                     $time->enableDateActivation($this->lng->txt('enabled'), 'md_activated[' . $def->getFieldId() . ']', false);
                     $this->table_gui->addFilterItem($time);
                     $time->readFromSession();
                     $this->table_gui->filter['md_' . $def->getFieldId()] = $time->getDate();
                     break;
                 case ilAdvancedMDFieldDefinition::TYPE_DATETIME:
                     $time = new ilDateTimeInputGUI($def->getTitle(), 'md_' . $def->getFieldId());
                     $time->setShowTime(true);
                     $time->enableDateActivation($this->lng->txt('enabled'), 'md_activated[' . $def->getFieldId() . ']', false);
                     $this->table_gui->addFilterItem($time);
                     $time->readFromSession();
                     $this->table_gui->filter['md_' . $def->getFieldId()] = $time->getValue();
                     break;
             }
         }
     }
 }
 public function getFormElement($a_query, $a_field_name)
 {
     include_once './Services/MetaData/classes/class.ilMDUtilSelect.php';
     $a_post_name = 'query[' . $a_field_name . ']';
     switch ($a_field_name) {
         case 'general_offline':
             $offline_options = array('0' => $this->lng->txt('search_any'), self::ONLINE_QUERY => $this->lng->txt('search_option_online'), self::OFFLINE_QUERY => $this->lng->txt('search_option_offline'));
             $offline = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $offline->setOptions($offline_options);
             $offline->setValue($a_query['general_offline']);
             return $offline;
         case 'lom_content':
             $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $text->setSubmitFormOnEnter(true);
             $text->setValue($a_query['lom_content']);
             $text->setSize(30);
             $text->setMaxLength(255);
             return $text;
             // General
         // General
         case 'lom_language':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_language']);
             $select->setOptions(ilMDUtilSelect::_getLanguageSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_keyword':
             $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $text->setSubmitFormOnEnter(true);
             $text->setValue($a_query['lom_keyword']);
             $text->setSize(30);
             $text->setMaxLength(255);
             return $text;
         case 'lom_coverage':
             $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $text->setSubmitFormOnEnter(true);
             $text->setValue($a_query['lom_coverage']);
             $text->setSize(30);
             $text->setMaxLength(255);
             return $text;
         case 'lom_structure':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_structure']);
             $select->setOptions(ilMDUtilSelect::_getStructureSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
             // Lifecycle
         // Lifecycle
         case 'lom_status':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_status']);
             $select->setOptions(ilMDUtilSelect::_getStatusSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_version':
             $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $text->setSubmitFormOnEnter(true);
             $text->setValue($a_query['lom_version']);
             $text->setSize(30);
             $text->setMaxLength(255);
             return $text;
         case 'lom_contribute':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], 'query[' . 'lom_role' . ']');
             $select->setValue($a_query['lom_role']);
             $select->setOptions(ilMDUtilSelect::_getRoleSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             $text = new ilTextInputGUI($this->lng->txt('meta_entry'), 'query[' . 'lom_role_entry' . ']');
             $text->setValue($a_query['lom_role_entry']);
             $text->setSize(30);
             $text->setMaxLength(255);
             $select->addSubItem($text);
             return $select;
             // Technical
         // Technical
         case 'lom_format':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_format']);
             $select->setOptions(ilMDUtilSelect::_getFormatSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_operating_system':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_operating_system']);
             $select->setOptions(ilMDUtilSelect::_getOperatingSystemSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_browser':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_browser']);
             $select->setOptions(ilMDUtilSelect::_getBrowserSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
             // Education
         // Education
         case 'lom_interactivity':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_interactivity']);
             $select->setOptions(ilMDUtilSelect::_getInteractivityTypeSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_resource':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_resource']);
             $select->setOptions(ilMDUtilSelect::_getLearningResourceTypeSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_level':
             $range = new ilCustomInputGUI($this->active_fields[$a_field_name]);
             $html = $this->getRangeSelect($this->lng->txt('from'), ilMDUtilSelect::_getInteractivityLevelSelect($a_query['lom_level_start'], 'query[' . 'lom_level_start' . ']', array(0 => $this->lng->txt('search_any'))), $this->lng->txt('until'), ilMDUtilSelect::_getInteractivityLevelSelect($a_query['lom_level_end'], 'query[' . 'lom_level_end' . ']', array(0 => $this->lng->txt('search_any'))));
             $range->setHTML($html);
             return $range;
         case 'lom_density':
             $range = new ilCustomInputGUI($this->active_fields[$a_field_name]);
             $html = $this->getRangeSelect($this->lng->txt('from'), ilMDUtilSelect::_getSemanticDensitySelect($a_query['lom_density_start'], 'query[' . 'lom_density_start' . ']', array(0 => $this->lng->txt('search_any'))), $this->lng->txt('until'), ilMDUtilSelect::_getSemanticDensitySelect($a_query['lom_density_end'], 'query[' . 'lom_density_end' . ']', array(0 => $this->lng->txt('search_any'))));
             $range->setHTML($html);
             return $range;
         case 'lom_user_role':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_user_role']);
             $select->setOptions(ilMDUtilSelect::_getIntendedEndUserRoleSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_context':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_context']);
             $select->setOptions(ilMDUtilSelect::_getContextSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_difficulty':
             $range = new ilCustomInputGUI($this->active_fields[$a_field_name]);
             $html = $this->getRangeSelect($this->lng->txt('from'), ilMDUtilSelect::_getDifficultySelect($a_query['lom_difficulty_start'], 'query[' . 'lom_difficulty_start' . ']', array(0 => $this->lng->txt('search_any'))), $this->lng->txt('until'), ilMDUtilSelect::_getDifficultySelect($a_query['lom_difficulty_end'], 'query[' . 'lom_difficulty_end' . ']', array(0 => $this->lng->txt('search_any'))));
             $range->setHTML($html);
             return $range;
             // Rights
         // Rights
         case 'lom_costs':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_costs']);
             $select->setOptions(ilMDUtilSelect::_getCostsSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_copyright':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_copyright']);
             $select->setOptions(ilMDUtilSelect::_getCopyrightAndOtherRestrictionsSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
             // Classification
         // Classification
         case 'lom_purpose':
             $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $select->setValue($a_query['lom_purpose']);
             $select->setOptions(ilMDUtilSelect::_getPurposeSelect('', $a_field_name, array(0 => $this->lng->txt('search_any')), true));
             return $select;
         case 'lom_taxon':
             $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
             $text->setSubmitFormOnEnter(true);
             $text->setValue($a_query['lom_taxon']);
             $text->setSize(30);
             $text->setMaxLength(255);
             return $text;
         default:
             if (substr($a_field_name, 0, 3) != 'adv') {
                 break;
             }
             // Advanced meta data
             $field_id = substr($a_field_name, 4);
             include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
             $field = ilAdvancedMDFieldDefinition::_getInstanceByFieldId($field_id);
             switch ($field->getFieldType()) {
                 case ilAdvancedMDFieldDefinition::TYPE_TEXT:
                     $text = new ilTextInputGUI($this->active_fields[$a_field_name], $a_post_name);
                     $text->setSubmitFormOnEnter(true);
                     $text->setValue($a_query[$a_field_name]);
                     $text->setSize(30);
                     $text->setMaxLength(255);
                     return $text;
                 case ilAdvancedMDFieldDefinition::TYPE_SELECT:
                     $select = new ilSelectInputGUI($this->active_fields[$a_field_name], $a_post_name);
                     $select->setValue($a_query[$a_field_name]);
                     $select->setOptions($field->getFieldValuesForSearch());
                     return $select;
                 case ilAdvancedMDFieldDefinition::TYPE_DATE:
                 case ilAdvancedMDFieldDefinition::TYPE_DATETIME:
                     $check = new ilCheckboxInputGUI($this->active_fields[$a_field_name], $a_post_name);
                     $check->setValue(1);
                     $check->setChecked($a_query[$a_field_name]);
                     $time = new ilDateTimeInputGUI($this->lng->txt('from'), $a_field_name . '_start');
                     $time->setShowTime($field->getFieldType() != ilAdvancedMDFieldDefinition::TYPE_DATE);
                     $time->setDate(new ilDateTime(mktime(8, 0, 0, date('m'), date('d'), date('Y')), IL_CAL_UNIX));
                     $check->addSubItem($time);
                     $time = new ilDateTimeInputGUI($this->lng->txt('until'), $a_field_name . '_end');
                     $time->setShowTime($field->getFieldType() != ilAdvancedMDFieldDefinition::TYPE_DATE);
                     $time->setDate(new ilDateTime(mktime(16, 0, 0, date('m'), date('d'), date('Y')), IL_CAL_UNIX));
                     $check->addSubItem($time);
                     return $check;
             }
     }
     return null;
 }
示例#15
0
 /**
  * init form
  *
  * @access protected
  * @param
  * @return
  */
 protected function initEditForm()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     include_once './Services/Calendar/classes/class.ilDateTime.php';
     $form = new ilPropertyFormGUI();
     $form->setTitle($this->lng->txt('crs_edit'));
     $form->addCommandButton('update', $this->lng->txt('save'));
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $form->setFormAction($this->ctrl->getFormAction($this, 'update'));
     // title
     $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $title->setSubmitFormOnEnter(true);
     $title->setValue($this->object->getTitle());
     $title->setSize(min(40, ilObject::TITLE_LENGTH));
     $title->setMaxLength(ilObject::TITLE_LENGTH);
     $title->setRequired(true);
     $form->addItem($title);
     // desc
     $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'desc');
     $desc->setValue($this->object->getLongDescription());
     $desc->setRows(2);
     $desc->setCols(40);
     $form->addItem($desc);
     // Show didactic template type
     $this->initDidacticTemplate($form);
     // activation/availability
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'activation_online');
     $online->setChecked(!$this->object->getOfflineStatus());
     $online->setInfo($this->lng->txt('crs_activation_online_info'));
     $form->addItem($online);
     $act_type = new ilCheckboxInputGUI($this->lng->txt('crs_visibility_until'), 'activation_type');
     $act_type->setChecked($this->object->getActivationType() == IL_CRS_ACTIVATION_LIMITED);
     // $act_type->setInfo($this->lng->txt('crs_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
     $dur->setShowTime(true);
     $dur->setStart(new ilDateTime($this->object->getActivationStart(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $dur->setEnd(new ilDateTime($this->object->getActivationEnd(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $act_type->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('crs_activation_limited_visibility_info'));
     $visible->setChecked($this->object->getActivationVisibility());
     $act_type->addSubItem($visible);
     $form->addItem($act_type);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('crs_reg'));
     $form->addItem($section);
     $reg_proc = new ilRadioGroupInputGUI($this->lng->txt('crs_registration_type'), 'subscription_type');
     $reg_proc->setValue($this->object->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED ? $this->object->getSubscriptionType() : IL_CRS_SUBSCRIPTION_DEACTIVATED);
     // $reg_proc->setInfo($this->lng->txt('crs_reg_type_info'));
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_direct'), IL_CRS_SUBSCRIPTION_DIRECT);
     $reg_proc->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_password'), IL_CRS_SUBSCRIPTION_PASSWORD);
     $pass = new ilTextInputGUI($this->lng->txt("password"), 'subscription_password');
     $pass->setInfo($this->lng->txt('crs_reg_password_info'));
     $pass->setSubmitFormOnEnter(true);
     $pass->setSize(12);
     $pass->setMaxLength(12);
     $pass->setValue($this->object->getSubscriptionPassword());
     $opt->addSubItem($pass);
     $reg_proc->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_subscription_options_confirmation'), IL_CRS_SUBSCRIPTION_CONFIRMATION);
     $opt->setInfo($this->lng->txt('crs_registration_confirmation_info'));
     $reg_proc->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('crs_reg_no_selfreg'), IL_CRS_SUBSCRIPTION_DEACTIVATED);
     $opt->setInfo($this->lng->txt('crs_registration_deactivated'));
     $reg_proc->addOption($opt);
     $form->addItem($reg_proc);
     // Registration codes
     $reg_code = new ilCheckboxInputGUI($this->lng->txt('crs_reg_code'), 'reg_code_enabled');
     $reg_code->setChecked($this->object->isRegistrationAccessCodeEnabled());
     $reg_code->setValue(1);
     $reg_code->setInfo($this->lng->txt('crs_reg_code_enabled_info'));
     /*
     $code = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_value'));
     $code->setValue($this->object->getRegistrationAccessCode());
     $reg_code->addSubItem($code);
     */
     #$link = new ilNonEditableValueGUI($this->lng->txt('crs_reg_code_link'));
     // Create default access code
     if (!$this->object->getRegistrationAccessCode()) {
         include_once './Services/Membership/classes/class.ilMembershipRegistrationCodeUtils.php';
         $this->object->setRegistrationAccessCode(ilMembershipRegistrationCodeUtils::generateCode());
     }
     $reg_link = new ilHiddenInputGUI('reg_code');
     $reg_link->setValue($this->object->getRegistrationAccessCode());
     $form->addItem($reg_link);
     $link = new ilCustomInputGUI($this->lng->txt('crs_reg_code_link'));
     include_once './Services/Link/classes/class.ilLink.php';
     $val = ilLink::_getLink($this->object->getRefId(), $this->object->getType(), array(), '_rcode' . $this->object->getRegistrationAccessCode());
     $link->setHTML('<font class="small">' . $val . '</font>');
     $reg_code->addSubItem($link);
     $form->addItem($reg_code);
     // time limit
     $time_limit = new ilCheckboxInputGUI($this->lng->txt('crs_registration_limited'), 'subscription_limitation_type');
     $time_limit->setChecked($this->object->getSubscriptionLimitationType() == IL_CRS_SUBSCRIPTION_LIMITED ? true : false);
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $sdur = new ilDateDurationInputGUI($this->lng->txt('crs_registration_period'), "subscription_period");
     $sdur->setShowTime(true);
     $sdur->setStart(new ilDateTime($this->object->getSubscriptionStart(), IL_CAL_UNIX));
     $sdur->setStartText($this->lng->txt('crs_start'));
     $sdur->setEnd(new ilDateTime($this->object->getSubscriptionEnd(), IL_CAL_UNIX));
     $sdur->setEndText($this->lng->txt('crs_end'));
     $time_limit->addSubItem($sdur);
     $form->addItem($time_limit);
     // Max members
     $lim = new ilCheckboxInputGUI($this->lng->txt('crs_subscription_max_members_short'), 'subscription_membership_limitation');
     $lim->setValue(1);
     $lim->setChecked($this->object->isSubscriptionMembershipLimited());
     $max = new ilTextInputGUI('', 'subscription_max');
     $max->setSubmitFormOnEnter(true);
     $max->setSize(4);
     $max->setMaxLength(4);
     $max->setValue($this->object->getSubscriptionMaxMembers() ? $this->object->getSubscriptionMaxMembers() : '');
     $max->setTitle($this->lng->txt('crs_subscription_max_members'));
     $max->setInfo($this->lng->txt('crs_reg_max_info'));
     $lim->addSubItem($max);
     $wait = new ilCheckboxInputGUI($this->lng->txt('crs_waiting_list'), 'waiting_list');
     $wait->setChecked($this->object->enabledWaitingList());
     $wait->setInfo($this->lng->txt('crs_wait_info'));
     $lim->addSubItem($wait);
     $form->addItem($lim);
     $pres = new ilFormSectionHeaderGUI();
     $pres->setTitle($this->lng->txt('crs_view_mode'));
     $form->addItem($pres);
     // presentation type
     $view_type = new ilRadioGroupInputGUI($this->lng->txt('crs_presentation_type'), 'view_mode');
     $view_type->setValue($this->object->getViewMode());
     $opts = new ilRadioOption($this->lng->txt('cntr_view_sessions'), IL_CRS_VIEW_SESSIONS);
     $opts->setInfo($this->lng->txt('cntr_view_info_sessions'));
     $view_type->addOption($opts);
     // Limited sessions
     $sess = new ilCheckboxInputGUI($this->lng->txt('sess_limit'), 'sl');
     $sess->setValue(1);
     $sess->setChecked($this->object->isSessionLimitEnabled());
     $sess->setInfo($this->lng->txt('sess_limit_info'));
     $prev = new ilNumberInputGUI($this->lng->txt('sess_num_prev'), 'sp');
     #$prev->setSubmitFormOnEnter(true);
     $prev->setMinValue(0);
     $prev->setValue($this->object->getNumberOfPreviousSessions() == -1 ? '' : $this->object->getNumberOfPreviousSessions());
     $prev->setSize(2);
     $prev->setMaxLength(3);
     $sess->addSubItem($prev);
     $next = new ilNumberInputGUI($this->lng->txt('sess_num_next'), 'sn');
     #$next->setSubmitFormOnEnter(true);
     $next->setMinValue(0);
     $next->setValue($this->object->getNumberOfNextSessions() == -1 ? '' : $this->object->getNumberOfnextSessions());
     $next->setSize(2);
     $next->setMaxLength(3);
     $sess->addSubItem($next);
     $opts->addSubItem($sess);
     $optsi = new ilRadioOption($this->lng->txt('cntr_view_simple'), IL_CRS_VIEW_SIMPLE);
     $optsi->setInfo($this->lng->txt('cntr_view_info_simple'));
     $view_type->addOption($optsi);
     $optbt = new ilRadioOption($this->lng->txt('cntr_view_by_type'), IL_CRS_VIEW_BY_TYPE);
     $optbt->setInfo($this->lng->txt('cntr_view_info_by_type'));
     $view_type->addOption($optbt);
     $opto = new ilRadioOption($this->lng->txt('crs_view_objective'), IL_CRS_VIEW_OBJECTIVE);
     $opto->setInfo($this->lng->txt('crs_view_info_objective'));
     $view_type->addOption($opto);
     $optt = new ilRadioOption($this->lng->txt('crs_view_timing'), IL_CRS_VIEW_TIMING);
     $optt->setInfo($this->lng->txt('crs_view_info_timing'));
     $view_type->addOption($optt);
     $form->addItem($view_type);
     $this->initSortingForm($form, array(ilContainer::SORT_TITLE, ilContainer::SORT_MANUAL, ilContainer::SORT_CREATION, ilContainer::SORT_ACTIVATION));
     // lp vs. course status
     include_once "Services/Tracking/classes/class.ilObjUserTracking.php";
     if (ilObjUserTracking::_enabledLearningProgress()) {
         include_once './Services/Object/classes/class.ilObjectLP.php';
         $olp = ilObjectLP::getInstance($this->object->getId());
         if ($olp->getCurrentMode()) {
             $lp_status = new ilFormSectionHeaderGUI();
             $lp_status->setTitle($this->lng->txt('crs_course_status_of_users'));
             $form->addItem($lp_status);
             $lp_status_options = new ilRadioGroupInputGUI($this->lng->txt('crs_status_determination'), "status_dt");
             //				$lp_status_options->setRequired(true);
             $lp_status_options->setValue($this->object->getStatusDetermination());
             $lp_option = new ilRadioOption($this->lng->txt('crs_status_determination_lp'), ilObjCourse::STATUS_DETERMINATION_LP, $this->lng->txt('crs_status_determination_lp_info'));
             $lp_status_options->addOption($lp_option);
             $lp_status_options->addOption(new ilRadioOption($this->lng->txt('crs_status_determination_manual'), ilObjCourse::STATUS_DETERMINATION_MANUAL));
             $form->addItem($lp_status_options);
         }
     }
     // additional features
     $feat = new ilFormSectionHeaderGUI();
     $feat->setTitle($this->lng->txt('obj_features'));
     $form->addItem($feat);
     include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
     ilObjectServiceSettingsGUI::initServiceSettingsForm($this->object->getId(), $form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY, ilObjectServiceSettingsGUI::AUTO_RATING_NEW_OBJECTS, ilObjectServiceSettingsGUI::TAG_CLOUD));
     $mem = new ilCheckboxInputGUI($this->lng->txt('crs_show_members'), 'show_members');
     $mem->setChecked($this->object->getShowMembers());
     $mem->setInfo($this->lng->txt('crs_show_members_info'));
     $form->addItem($mem);
     // Show members type
     $mail_type = new ilRadioGroupInputGUI($this->lng->txt('crs_mail_type'), 'mail_type');
     $mail_type->setValue($this->object->getMailToMembersType());
     $mail_tutors = new ilRadioOption($this->lng->txt('crs_mail_tutors_only'), ilCourseConstants::MAIL_ALLOWED_TUTORS, $this->lng->txt('crs_mail_tutors_only_info'));
     $mail_type->addOption($mail_tutors);
     $mail_all = new ilRadioOption($this->lng->txt('crs_mail_all'), ilCourseConstants::MAIL_ALLOWED_ALL, $this->lng->txt('crs_mail_all_info'));
     $mail_type->addOption($mail_all);
     $form->addItem($mail_type);
     // Notification Settings
     /*$notification = new ilFormSectionHeaderGUI();
     		$notification->setTitle($this->lng->txt('crs_notification'));
     		$form->addItem($notification);*/
     // Self notification
     $not = new ilCheckboxInputGUI($this->lng->txt('crs_auto_notification'), 'auto_notification');
     $not->setValue(1);
     $not->setInfo($this->lng->txt('crs_auto_notification_info'));
     $not->setChecked($this->object->getAutoNotification());
     $form->addItem($not);
     // Further information
     //$further = new ilFormSectionHeaderGUI();
     //$further->setTitle($this->lng->txt('crs_further_settings'));
     //$form->addItem($further);
     $desk = new ilCheckboxInputGUI($this->lng->txt('crs_add_remove_from_desktop'), 'abo');
     $desk->setChecked($this->object->getAboStatus());
     $desk->setInfo($this->lng->txt('crs_add_remove_from_desktop_info'));
     $form->addItem($desk);
     // Edit ecs export settings
     include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
     $ecs = new ilECSCourseSettings($this->object);
     $ecs->addSettingsToForm($form, 'crs');
     return $form;
 }
 /**
  * 
  */
 public function initFilter()
 {
     /**
      * @var $tpl ilTemplate
      */
     global $tpl;
     include_once 'Services/Form/classes/class.ilTextInputGUI.php';
     $ul = new ilTextInputGUI($this->lng->txt('login') . '/' . $this->lng->txt('email') . '/' . $this->lng->txt('name'), 'query');
     $ul->setDataSource($this->ctrl->getLinkTarget($this->getParentObject(), 'addUserAutoComplete', '', true));
     $ul->setSize(20);
     $ul->setSubmitFormOnEnter(true);
     $this->addFilterItem($ul);
     $ul->readFromSession();
     $this->filter['query'] = $ul->getValue();
     include_once 'Services/Form/classes/class.ilSelectInputGUI.php';
     $options = array();
     $languages = ilObject::_getObjectsByType('lng');
     foreach ($languages as $lng) {
         $options[$lng['title']] = $this->lng->txt('meta_l_' . $lng['title']);
     }
     asort($options);
     $options = array('' => $this->lng->txt('any_language')) + $options;
     $si = new ilSelectInputGUI($this->lng->txt('language'), 'lng');
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter['lng'] = $si->getValue();
     include_once 'Services/Form/classes/class.ilDateDurationInputGUI.php';
     $tpl->addJavaScript('./Services/Form/js/date_duration.js');
     $duration = new ilDateDurationInputGUI($this->lng->txt('tos_period'), 'period');
     $duration->setStartText($this->lng->txt('tos_period_from'));
     $duration->setEndText($this->lng->txt('tos_period_until'));
     $duration->setStart(new ilDateTime(strtotime('-1 year', time()), IL_CAL_UNIX));
     $duration->setEnd(new ilDateTime(time(), IL_CAL_UNIX));
     $duration->setShowTime(true);
     $this->addFilterItem($duration, true);
     $duration->readFromSession();
     $this->optional_filter['period'] = $duration->getValue();
 }
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser, $ilObjDataCache;
     include_once "./Services/Registration/classes/class.ilRegistrationCode.php";
     // code
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("registration_code"), "query");
     $ti->setMaxLength(ilRegistrationCode::CODE_LENGTH);
     $ti->setSize(20);
     $ti->setSubmitFormOnEnter(true);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["code"] = $ti->getValue();
     // role
     $this->role_map = array();
     foreach ($rbacreview->getGlobalRoles() as $role_id) {
         if (!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) {
             $this->role_map[$role_id] = $ilObjDataCache->lookupTitle($role_id);
         }
     }
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $options = array("" => $this->lng->txt("registration_roles_all")) + $this->role_map;
     $si = new ilSelectInputGUI($this->lng->txt("role"), "role");
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter["role"] = $si->getValue();
     // access limitation
     $options = array("" => $this->lng->txt("registration_codes_access_limitation_all"), "unlimited" => $this->lng->txt("reg_access_limitation_none"), "absolute" => $this->lng->txt("reg_access_limitation_mode_absolute"), "relative" => $this->lng->txt("reg_access_limitation_mode_relative"));
     $si = new ilSelectInputGUI($this->lng->txt("reg_access_limitations"), "alimit");
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter["alimit"] = $si->getValue();
     // generated
     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
     $options = array("" => $this->lng->txt("registration_generated_all"));
     foreach ((array) ilRegistrationCode::getGenerationDates() as $date) {
         $options[$date] = ilDatePresentation::formatDate(new ilDateTime($date, IL_CAL_UNIX));
     }
     $si = new ilSelectInputGUI($this->lng->txt("registration_generated"), "generated");
     $si->setOptions($options);
     $this->addFilterItem($si);
     $si->readFromSession();
     $this->filter["generated"] = $si->getValue();
 }