public function addToForm() { global $lng; $adt_date = $this->getADT()->getDate(); $date = new ilDateTimeInputGUI($this->getTitle(), $this->getElementId()); $date->setShowTime(true); if (!(bool) $this->text_input) { $checked = !(!$adt_date || $adt_date->isNull()); $date->enableDateActivation($lng->txt("enabled"), $this->addToElementId("tgl"), $checked); } else { $date->setMode(ilDateTimeInputGUI::MODE_INPUT); } $date->setDate($adt_date); $this->addToParentElement($date); }
protected function addCustomEditForm(ilPropertyFormGUI $a_form) { $radio_grp = new ilRadioGroupInputGUI($this->lng->txt('grp_visibility'), 'activation_type'); $radio_grp->setValue($this->object->getAvailabilityType()); $radio_grp->setDisabled(true); $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_unvisible'), ilObjRemoteTest::ACTIVATION_OFFLINE); $radio_grp->addOption($radio_opt); $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_limitless'), ilObjRemoteTest::ACTIVATION_UNLIMITED); $radio_grp->addOption($radio_opt); // :TODO: not supported in ECS yet $radio_opt = new ilRadioOption($this->lng->txt('grp_visibility_until'), ilObjRemoteTest::ACTIVATION_LIMITED); $start = new ilDateTimeInputGUI($this->lng->txt('grp_start'), 'start'); $start->setDate(new ilDateTime(time(), IL_CAL_UNIX)); $start->setDisabled(true); $start->setShowTime(true); $radio_opt->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('grp_end'), 'end'); $end->setDate(new ilDateTime(time(), IL_CAL_UNIX)); $end->setDisabled(true); $end->setShowTime(true); $radio_opt->addSubItem($end); $radio_grp->addOption($radio_opt); $a_form->addItem($radio_grp); }
protected function initUpdateBookingForm($booking) { global $lng; $lng->loadLanguageModule('dateplaner'); $lng->loadLanguageModule('crs'); include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, 'showContent')); $form->setTitle(ilViteroPlugin::getInstance()->txt('tbl_update_appointment')); $form->addCommandButton('updateBooking', $GLOBALS['lng']->txt('save')); $form->addCommandButton('showContent', $GLOBALS['lng']->txt('cancel')); // Show only start if type is "cafe" if ($booking->booking->cafe) { $start = new ilDateTimeInputGUI($lng->txt('event_start_date'), 'cstart'); $start->setShowTime(false); $start->setDate(ilViteroUtils::parseSoapDate($booking->booking->start)); $form->addItem($start); } else { include_once './Services/Form/classes/class.ilDateDurationInputGUI.php'; $dt = new ilDateDurationInputGUI($lng->txt('cal_fullday'), 'roomduration'); $dt->setMinuteStepSize(15); $dt->setStartText($lng->txt('event_start_date')); $dt->setEndText($lng->txt('event_end_date')); $dt->setShowTime(true); $dt->setStart(ilViteroUtils::parseSoapDate($booking->booking->start)); $dt->setEnd(ilViteroUtils::parseSoapDate($booking->booking->end)); $form->addItem($dt); $this->initFormTimeBuffer($form); $form->getItemByPostVar('buffer_before')->setValue($booking->booking->startbuffer); $form->getItemByPostVar('buffer_after')->setValue($booking->booking->endbuffer); } return $form; }
/** * Init survey settings form * * @return ilPropertyFormGUI */ function initPropertiesForm() { $template_settings = $hide_rte_switch = null; $template = $this->object->getTemplate(); if ($template) { include_once "Services/Administration/classes/class.ilSettingsTemplate.php"; $template = new ilSettingsTemplate($template); $template_settings = $template->getSettings(); $hide_rte_switch = $template_settings["rte_switch"]["hide"]; } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTableWidth("100%"); $form->setId("survey_properties"); // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("settings")); $form->addItem($header); // title & description (meta data) include_once 'Services/MetaData/classes/class.ilMD.php'; $md_obj = new ilMD($this->object->getId(), 0, "svy"); $md_section = $md_obj->getGeneral(); $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); $title->setValue($md_section->getTitle()); $form->addItem($title); $ids = $md_section->getDescriptionIds(); if ($ids) { $desc_obj = $md_section->getDescription(array_pop($ids)); $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description"); $desc->setCols(50); $desc->setRows(4); $desc->setValue($desc_obj->getDescription()); $form->addItem($desc); } // anonymization $anonymization_options = new ilRadioGroupInputGUI($this->lng->txt("survey_auth_mode"), "anonymization_options"); $hasDatasets = $this->object->_hasDatasets($this->object->getSurveyId()); if ($hasDatasets) { $anonymization_options->setDisabled(true); } $anonymization_options->addOption(new ilCheckboxOption($this->lng->txt("anonymize_personalized"), 'personalized', '')); $anonymization_options->addOption(new ilCheckboxOption($this->lng->txt("anonymize_without_code"), 'anonymize_without_code', '')); $anonymization_options->addOption(new ilCheckboxOption($this->lng->txt("anonymize_with_code"), 'anonymize_with_code', '')); if (!$this->object->getAnonymize()) { $anonymization_options->setValue('personalized'); } else { $anonymization_options->setValue($this->object->isAccessibleWithoutCode() ? 'anonymize_without_code' : 'anonymize_with_code'); } $anonymization_options->setInfo($this->lng->txt("anonymize_survey_description")); $form->addItem($anonymization_options); // pool usage $pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool"); $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1); $opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info")); $pool_usage->addOption($opt); $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0); $opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info")); $pool_usage->addOption($opt); $pool_usage->setValue($this->object->getPoolUsage()); $form->addItem($pool_usage); // activation include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info); $online->setChecked($this->object->isOnline()); $form->addItem($online); $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'access_type'); $act_type->setInfo($act_ref_info); $act_type->setValue($this->object->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED); $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED); $opt->setInfo($this->lng->txt('svy_availability_limitless_info')); $act_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION); $opt->setInfo($this->lng->txt('svy_availability_until_info')); $date = $this->object->getActivationStartDate(); $start = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_start'), 'access_begin'); $start->setShowTime(true); $start->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($start); $date = $this->object->getActivationEndDate(); $end = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_end'), 'access_end'); $end->setShowTime(true); $end->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($end); $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity'); $visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info')); $visible->setChecked($this->object->getActivationVisibility()); $opt->addSubItem($visible); $act_type->addOption($opt); $form->addItem($act_type); // enable start date $start = $this->object->getStartDate(); $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("start_date"), "enabled_start_date"); $enablestartingtime->setValue(1); // $enablestartingtime->setOptionTitle($this->lng->txt("enabled")); $enablestartingtime->setChecked($start); // start date $startingtime = new ilDateTimeInputGUI('', 'start_date'); $startingtime->setShowDate(true); $startingtime->setShowTime(true); if ($start) { $startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP)); } $enablestartingtime->addSubItem($startingtime); $form->addItem($enablestartingtime); // enable end date $end = $this->object->getEndDate(); $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("end_date"), "enabled_end_date"); $enableendingtime->setValue(1); // $enableendingtime->setOptionTitle($this->lng->txt("enabled")); $enableendingtime->setChecked($end); // end date $endingtime = new ilDateTimeInputGUI('', 'end_date'); $endingtime->setShowDate(true); $endingtime->setShowTime(true); if ($end) { $endingtime->setDate(new ilDate($end, IL_CAL_TIMESTAMP)); } $enableendingtime->addSubItem($endingtime); $form->addItem($enableendingtime); // presentation properties $info = new ilFormSectionHeaderGUI(); $info->setTitle($this->lng->txt("svy_presentation_properties")); $form->addItem($info); // show question titles $show_question_titles = new ilCheckboxInputGUI($this->lng->txt("svy_show_questiontitles"), "show_question_titles"); $show_question_titles->setValue(1); $show_question_titles->setChecked($this->object->getShowQuestionTitles()); $form->addItem($show_question_titles); // introduction $intro = new ilTextAreaInputGUI($this->lng->txt("introduction"), "introduction"); $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction())); $intro->setRows(10); $intro->setCols(80); $intro->setUseRte(TRUE); $intro->setInfo($this->lng->txt("survey_introduction_info")); include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey")); $intro->addPlugin("latex"); $intro->addButton("latex"); $intro->addButton("pastelatex"); $intro->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch, "3.4.7"); $form->addItem($intro); // final statement $finalstatement = new ilTextAreaInputGUI($this->lng->txt("outro"), "outro"); $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro())); $finalstatement->setRows(10); $finalstatement->setCols(80); $finalstatement->setUseRte(TRUE); $finalstatement->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey")); $finalstatement->addPlugin("latex"); $finalstatement->addButton("latex"); $finalstatement->addButton("pastelatex"); $finalstatement->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch, "3.4.7"); $form->addItem($finalstatement); // results properties $results = new ilFormSectionHeaderGUI(); $results->setTitle($this->lng->txt("results")); $form->addItem($results); // evaluation access $evaluation_access = new ilRadioGroupInputGUI($this->lng->txt('evaluation_access'), "evaluation_access"); $evaluation_access->setInfo($this->lng->txt('evaluation_access_description')); $evaluation_access->addOption(new ilCheckboxOption($this->lng->txt("evaluation_access_off"), EVALUATION_ACCESS_OFF, '')); $evaluation_access->addOption(new ilCheckboxOption($this->lng->txt("evaluation_access_all"), EVALUATION_ACCESS_ALL, '')); $evaluation_access->addOption(new ilCheckboxOption($this->lng->txt("evaluation_access_participants"), EVALUATION_ACCESS_PARTICIPANTS, '')); $evaluation_access->setValue($this->object->getEvaluationAccess()); $form->addItem($evaluation_access); // mail notification $mailnotification = new ilCheckboxInputGUI($this->lng->txt("mailnotification"), "mailnotification"); // $mailnotification->setOptionTitle($this->lng->txt("activate")); $mailnotification->setValue(1); $mailnotification->setChecked($this->object->getMailNotification()); // addresses $mailaddresses = new ilTextInputGUI($this->lng->txt("mailaddresses"), "mailaddresses"); $mailaddresses->setValue($this->object->getMailAddresses()); $mailaddresses->setSize(80); $mailaddresses->setInfo($this->lng->txt('mailaddresses_info')); $mailaddresses->setRequired(true); // participant data $participantdata = new ilTextAreaInputGUI($this->lng->txt("mailparticipantdata"), "mailparticipantdata"); $participantdata->setValue($this->object->getMailParticipantData()); $participantdata->setRows(6); $participantdata->setCols(80); $participantdata->setUseRte(false); $participantdata->setInfo($this->lng->txt('mailparticipantdata_info')); $mailnotification->addSubItem($mailaddresses); $mailnotification->addSubItem($participantdata); $form->addItem($mailnotification); $form->addCommandButton("saveProperties", $this->lng->txt("save")); // remove items when using template if ($template_settings) { foreach ($template_settings as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } return $form; }
protected function initEditCustomForm(ilPropertyFormGUI $a_form) { global $lng; // activation include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $a_form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setInfo($this->lng->txt('poll_activation_online_info') . $act_obj_info); $a_form->addItem($online); $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'access_type'); $act_type->setInfo($act_ref_info); $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED); $opt->setInfo($this->lng->txt('poll_availability_limitless_info')); $act_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION); $opt->setInfo($this->lng->txt('poll_availability_until_info')); $date = $this->object->getAccessBegin(); $start = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_start'), 'access_begin'); $start->setShowTime(true); $start->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($start); $date = $this->object->getAccessEnd(); $end = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_end'), 'access_end'); $end->setShowTime(true); $end->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($end); /* $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity'); $visible->setInfo($this->lng->txt('poll_activation_limited_visibility_info')); $opt->addSubItem($visible); */ $act_type->addOption($opt); $a_form->addItem($act_type); // period/results $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('poll_voting_period_and_results')); $a_form->addItem($section); $prd = new ilRadioGroupInputGUI($this->lng->txt('poll_voting_period'), 'period'); $opt = new ilRadioOption($this->lng->txt('poll_voting_period_unlimited'), 0); $prd->addOption($opt); $opt = new ilRadioOption($this->lng->txt('poll_voting_period_limited'), 1); $prd->addOption($opt); $date = $this->object->getVotingPeriodBegin(); $start = new ilDateTimeInputGUI($this->lng->txt('poll_voting_period_start'), 'period_begin'); $start->setShowTime(true); $start->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($start); $date = $this->object->getVotingPeriodEnd(); $end = new ilDateTimeInputGUI($this->lng->txt('poll_voting_period_end'), 'period_end'); $end->setShowTime(true); $end->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($end); $a_form->addItem($prd); $results = new ilRadioGroupInputGUI($lng->txt("poll_view_results"), "results"); $results->setRequired(true); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_always"), ilObjPoll::VIEW_RESULTS_ALWAYS)); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_never"), ilObjPoll::VIEW_RESULTS_NEVER)); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_vote"), ilObjPoll::VIEW_RESULTS_AFTER_VOTE)); $results->addOption(new ilRadioOption($lng->txt("poll_view_results_after_period"), ilObjPoll::VIEW_RESULTS_AFTER_PERIOD)); $a_form->addItem($results); }
private function buildForm() { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save")); $form->setTableWidth("100%"); $form->setId("test_properties"); if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) { // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("tst_general_properties")); $form->addItem($header); } // title & description (meta data) include_once 'Services/MetaData/classes/class.ilMD.php'; $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst"); $md_section = $md_obj->getGeneral(); $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); $title->setValue($md_section->getTitle()); $form->addItem($title); $ids = $md_section->getDescriptionIds(); if ($ids) { $desc_obj = $md_section->getDescription(array_pop($ids)); $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description"); $desc->setCols(50); $desc->setRows(4); $desc->setValue($desc_obj->getDescription()); $form->addItem($desc); } // anonymity $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity'); if ($this->testOBJ->participantDataExist()) { $anonymity->setDisabled(true); } $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0); $anonymity->addOption($rb); $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1); $anonymity->addOption($rb); $anonymity->setValue((int) $this->testOBJ->getAnonymity()); $form->addItem($anonymity); // test mode (question set type) $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type'); $questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc")); $questSetType->addOption($questSetTypeFixed); $questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc")); $questSetType->addOption($questSetTypeRandom); $questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc")); $questSetType->addOption($questSetTypeContinues); $questSetType->setValue($this->testOBJ->getQuestionSetType()); if ($this->testOBJ->participantDataExist()) { $questSetType->setDisabled(true); } $form->addItem($questSetType); // pool usage $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool"); $pool_usage->setValue(1); $pool_usage->setChecked($this->testOBJ->getPoolUsage()); $form->addItem($pool_usage); // enable_archiving $enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving'); $enable_archiving->setValue(1); $enable_archiving->setChecked($this->testOBJ->getEnableArchiving()); $form->addItem($enable_archiving); // activation/availability (no template support yet) include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setChecked($this->testOBJ->isOnline()); $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info); $form->addItem($online); $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type'); $act_type->setInfo($act_ref_info); $act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED); $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED); $opt->setInfo($this->lng->txt('tst_availability_limitless_info')); $act_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION); $opt->setInfo($this->lng->txt('tst_availability_until_info')); $this->tpl->addJavaScript('./Services/Form/js/date_duration.js'); include_once "Services/Form/classes/class.ilDateDurationInputGUI.php"; $dur = new ilDateDurationInputGUI("", "access_period"); $dur->setShowTime(true); $date = $this->testOBJ->getActivationStartingTime(); $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setStartText($this->lng->txt('rep_activation_limited_start')); $date = $this->testOBJ->getActivationEndingTime(); $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setEndText($this->lng->txt('rep_activation_limited_end')); $opt->addSubItem($dur); $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility'); $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info')); $visible->setChecked($this->testOBJ->getActivationVisibility()); $opt->addSubItem($visible); $act_type->addOption($opt); $form->addItem($act_type); if (!$this->settingsTemplate || $this->formShowBeginningEndingInformation($this->settingsTemplate->getSettings())) { // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("tst_beginning_ending_information")); $form->addItem($header); } // introduction $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction"), "introduction"); $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction())); $intro->setRows(10); $intro->setCols(80); $intro->setUseRte(TRUE); $intro->addPlugin("latex"); $intro->addButton("latex"); $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment"); $intro->setRteTagSet('full'); $intro->setInfo($this->lng->txt('intro_desc')); // showinfo $showinfo = new ilCheckboxInputGUI('', "showinfo"); $showinfo->setValue(1); $showinfo->setChecked($this->testOBJ->getShowInfo()); $showinfo->setOptionTitle($this->lng->txt("showinfo")); $showinfo->setInfo($this->lng->txt("showinfo_desc")); $intro->addSubItem($showinfo); $form->addItem($intro); // final statement $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement"); $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement())); $finalstatement->setRows(10); $finalstatement->setCols(80); $finalstatement->setUseRte(TRUE); $finalstatement->addPlugin("latex"); $finalstatement->addButton("latex"); $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment"); $finalstatement->setRteTagSet('full'); // show final statement $showfinal = new ilCheckboxInputGUI('', "showfinalstatement"); $showfinal->setValue(1); $showfinal->setChecked($this->testOBJ->getShowFinalStatement()); $showfinal->setOptionTitle($this->lng->txt("final_statement_show")); $showfinal->setInfo($this->lng->txt("final_statement_show_desc")); $finalstatement->addSubItem($showfinal); $form->addItem($finalstatement); // examview $enable_examview = new ilCheckboxInputGUI($this->lng->txt("enable_examview"), 'enable_examview'); $enable_examview->setValue(1); $enable_examview->setChecked($this->testOBJ->getEnableExamview()); $enable_examview->setInfo($this->lng->txt("enable_examview_desc")); $show_examview_html = new ilCheckboxInputGUI('', 'show_examview_html'); $show_examview_html->setValue(1); $show_examview_html->setChecked($this->testOBJ->getShowExamviewHtml()); $show_examview_html->setOptionTitle($this->lng->txt("show_examview_html")); $show_examview_html->setInfo($this->lng->txt("show_examview_html_desc")); $enable_examview->addSubItem($show_examview_html); $show_examview_pdf = new ilCheckboxInputGUI('', 'show_examview_pdf'); $show_examview_pdf->setValue(1); $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf()); $show_examview_pdf->setOptionTitle($this->lng->txt("show_examview_pdf")); $show_examview_pdf->setInfo($this->lng->txt("show_examview_pdf_desc")); $enable_examview->addSubItem($show_examview_pdf); $form->addItem($enable_examview); if (!$this->settingsTemplate || $this->formShowSessionSection($this->settingsTemplate->getSettings())) { // session properties $sessionheader = new ilFormSectionHeaderGUI(); $sessionheader->setTitle($this->lng->txt("tst_session_settings")); $form->addItem($sessionheader); } // max. number of passes $nr_of_tries = new ilTextInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries"); $nr_of_tries->setSize(3); $nr_of_tries->setValue($this->testOBJ->getNrOfTries()); $nr_of_tries->setRequired(true); $nr_of_tries->setSuffix($this->lng->txt("0_unlimited")); $total = $this->testOBJ->evalTotalPersons(); if ($total) { $nr_of_tries->setDisabled(true); } $form->addItem($nr_of_tries); // enable max. processing time $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time"); $processing->setValue(1); //$processing->setOptionTitle($this->lng->txt("enabled")); if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) { $processing->setChecked(true); } else { $processing->setChecked($this->testOBJ->getEnableProcessingTime()); } // max. processing time $processingtime = new ilDurationInputGUI('', 'processing_time'); $ptime = $this->testOBJ->getProcessingTimeAsArray(); $processingtime->setHours($ptime['hh']); $processingtime->setMinutes($ptime['mm']); $processingtime->setSeconds($ptime['ss']); $processingtime->setShowMonths(false); $processingtime->setShowDays(false); $processingtime->setShowHours(true); $processingtime->setShowMinutes(true); $processingtime->setShowSeconds(true); $processingtime->setInfo($this->lng->txt("tst_processing_time_desc")); $processing->addSubItem($processingtime); // reset max. processing time $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time"); $resetprocessing->setValue(1); $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time")); $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime()); $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc")); $processing->addSubItem($resetprocessing); $form->addItem($processing); // enable starting time $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("tst_starting_time"), "chb_starting_time"); $enablestartingtime->setValue(1); //$enablestartingtime->setOptionTitle($this->lng->txt("enabled")); if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_starting_time')) { $enablestartingtime->setChecked(true); } else { $enablestartingtime->setChecked(strlen($this->testOBJ->getStartingTime())); } // starting time $startingtime = new ilDateTimeInputGUI('', 'starting_time'); $startingtime->setShowDate(true); $startingtime->setShowTime(true); if (strlen($this->testOBJ->getStartingTime())) { $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_TIMESTAMP)); } else { $startingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $enablestartingtime->addSubItem($startingtime); $form->addItem($enablestartingtime); if ($this->testOBJ->participantDataExist()) { $enablestartingtime->setDisabled(true); $startingtime->setDisabled(true); } // enable ending time $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("tst_ending_time"), "chb_ending_time"); $enableendingtime->setValue(1); //$enableendingtime->setOptionTitle($this->lng->txt("enabled")); if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_ending_time')) { $enableendingtime->setChecked(true); } else { $enableendingtime->setChecked(strlen($this->testOBJ->getEndingTime())); } // ending time $endingtime = new ilDateTimeInputGUI('', 'ending_time'); $endingtime->setShowDate(true); $endingtime->setShowTime(true); if (strlen($this->testOBJ->getEndingTime())) { $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_TIMESTAMP)); } else { $endingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $enableendingtime->addSubItem($endingtime); $form->addItem($enableendingtime); // test password $password = new ilTextInputGUI($this->lng->txt("tst_password"), "password"); $password->setSize(20); $password->setValue($this->testOBJ->getPassword()); $password->setInfo($this->lng->txt("tst_password_details")); $form->addItem($password); if (!$this->settingsTemplate || $this->formShowPresentationSection($this->settingsTemplate->getSettings())) { // sequence properties $seqheader = new ilFormSectionHeaderGUI(); $seqheader->setTitle($this->lng->txt("tst_presentation_properties")); $form->addItem($seqheader); } // use previous answers $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers"); $prevanswers->setValue(1); $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers()); $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description")); $form->addItem($prevanswers); // force js $forcejs = new ilCheckboxInputGUI($this->lng->txt("forcejs_short"), "forcejs"); $forcejs->setValue(1); $forcejs->setChecked($this->testOBJ->getForceJS()); $forcejs->setOptionTitle($this->lng->txt("forcejs")); $forcejs->setInfo($this->lng->txt("forcejs_desc")); $form->addItem($forcejs); // question title output $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output"); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, '')); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, '')); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, '')); $title_output->setValue($this->testOBJ->getTitleOutput()); $title_output->setInfo($this->lng->txt("tst_title_output_description")); $form->addItem($title_output); // selector for unicode characters global $ilSetting; if ($ilSetting->get('char_selector_availability') > 0) { require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php'; $char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST); $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability()); $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition()); $char_selector->addFormProperties($form); $char_selector->setFormValues($form); } // Autosave $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave'); $autosave_output->setValue(1); $autosave_output->setChecked($this->testOBJ->getAutosave()); $autosave_output->setInfo($this->lng->txt('autosave_info')); $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival'); $autosave_interval->setSize(10); $autosave_interval->setValue($this->testOBJ->getAutosaveIval() / 1000); $autosave_interval->setInfo($this->lng->txt('autosave_ival_info')); $autosave_output->addSubItem($autosave_interval); $form->addItem($autosave_output); if (!$this->settingsTemplate || $this->formShowSequenceSection($this->settingsTemplate->getSettings())) { // sequence properties $seqheader = new ilFormSectionHeaderGUI(); $seqheader->setTitle($this->lng->txt("tst_sequence_properties")); $form->addItem($seqheader); } // postpone questions $postpone = new ilCheckboxInputGUI($this->lng->txt("tst_postpone"), "chb_postpone"); $postpone->setValue(1); $postpone->setChecked($this->testOBJ->getSequenceSettings()); $postpone->setInfo($this->lng->txt("tst_postpone_description")); $form->addItem($postpone); // shuffle questions $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions"); $shuffle->setValue(1); $shuffle->setChecked($this->testOBJ->getShuffleQuestions()); $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description")); $form->addItem($shuffle); // show list of questions $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions"); //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary")); $list_of_questions->setValue(1); $list_of_questions->setChecked($this->testOBJ->getListOfQuestions()); $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description")); $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options"); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', '')); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', '')); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', '')); $values = array(); if ($this->testOBJ->getListOfQuestionsStart()) { array_push($values, 'chb_list_of_questions_start'); } if ($this->testOBJ->getListOfQuestionsEnd()) { array_push($values, 'chb_list_of_questions_end'); } if ($this->testOBJ->getListOfQuestionsDescription()) { array_push($values, 'chb_list_of_questions_with_description'); } $list_of_questions_options->setValue($values); $list_of_questions->addSubItem($list_of_questions_options); $form->addItem($list_of_questions); // show question marking $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker"); $marking->setValue(1); $marking->setChecked($this->testOBJ->getShowMarker()); $marking->setInfo($this->lng->txt("question_marking_description")); $form->addItem($marking); // show suspend test $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel"); $cancel->setValue(1); $cancel->setChecked($this->testOBJ->getShowCancel()); $cancel->setInfo($this->lng->txt("tst_show_cancel_description")); $form->addItem($cancel); if (!$this->settingsTemplate || $this->formShowNotificationSection($this->settingsTemplate->getSettings())) { // notifications $notifications = new ilFormSectionHeaderGUI(); $notifications->setTitle($this->lng->txt("tst_mail_notification")); $form->addItem($notifications); } // mail notification $mailnotification = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification"); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_no"), 0, '')); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, '')); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, '')); $mailnotification->setValue($this->testOBJ->getMailNotification()); $form->addItem($mailnotification); $mailnottype = new ilCheckboxInputGUI('', "mailnottype"); $mailnottype->setValue(1); $mailnottype->setOptionTitle($this->lng->txt("mailnottype")); $mailnottype->setChecked($this->testOBJ->getMailNotificationType()); $form->addItem($mailnottype); /* This options always active (?) */ $highscore_head = new ilFormSectionHeaderGUI(); $highscore_head->setTitle($this->lng->txt("tst_highscore_options")); $form->addItem($highscore_head); $highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled"); $highscore->setValue(1); $highscore->setChecked($this->testOBJ->getHighscoreEnabled()); $highscore->setInfo($this->lng->txt("tst_highscore_description")); $form->addItem($highscore); $highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon"); $highscore_anon->setValue(1); $highscore_anon->setChecked($this->testOBJ->getHighscoreAnon()); $highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description")); $highscore->addSubItem($highscore_anon); $highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts"); $highscore_achieved_ts->setValue(1); $highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS()); $highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description")); $highscore->addSubItem($highscore_achieved_ts); $highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score"); $highscore_score->setValue(1); $highscore_score->setChecked($this->testOBJ->getHighscoreScore()); $highscore_score->setInfo($this->lng->txt("tst_highscore_score_description")); $highscore->addSubItem($highscore_score); $highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage"); $highscore_percentage->setValue(1); $highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage()); $highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description")); $highscore->addSubItem($highscore_percentage); $highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints"); $highscore_hints->setValue(1); $highscore_hints->setChecked($this->testOBJ->getHighscoreHints()); $highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description")); $highscore->addSubItem($highscore_hints); $highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime"); $highscore_wtime->setValue(1); $highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime()); $highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description")); $highscore->addSubItem($highscore_wtime); $highscore_own_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_own_table"), "highscore_own_table"); $highscore_own_table->setValue(1); $highscore_own_table->setChecked($this->testOBJ->getHighscoreOwnTable()); $highscore_own_table->setInfo($this->lng->txt("tst_highscore_own_table_description")); $highscore->addSubItem($highscore_own_table); $highscore_top_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_top_table"), "highscore_top_table"); $highscore_top_table->setValue(1); $highscore_top_table->setChecked($this->testOBJ->getHighscoreTopTable()); $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_table_description")); $highscore->addSubItem($highscore_top_table); $highscore_top_num = new ilTextInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num"); $highscore_top_num->setSize(4); $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit")); $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum()); $highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description")); $highscore->addSubItem($highscore_top_num); if (!$this->settingsTemplate || $this->formShowTestExecutionSection($this->settingsTemplate->getSettings())) { $testExecution = new ilFormSectionHeaderGUI(); $testExecution->setTitle($this->lng->txt("tst_test_execution")); $form->addItem($testExecution); } // kiosk mode $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk"); $kiosk->setValue(1); $kiosk->setChecked($this->testOBJ->getKioskMode()); $kiosk->setInfo($this->lng->txt("kiosk_description")); // kiosk mode options $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options"); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', '')); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', '')); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt('examid_in_kiosk'), 'examid_in_kiosk')); $values = array(); if ($this->testOBJ->getShowKioskModeTitle()) { array_push($values, 'kiosk_title'); } if ($this->testOBJ->getShowKioskModeParticipant()) { array_push($values, 'kiosk_participant'); } if ($this->testOBJ->getExamidInKiosk()) { array_push($values, 'examid_in_kiosk'); } $kiosktitle->setValue($values); $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc")); $kiosk->addSubItem($kiosktitle); $form->addItem($kiosk); $redirection_mode = $this->testOBJ->getRedirectionMode(); $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled'); $rm_enabled->setChecked($redirection_mode == '0' ? false : true); $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_mode'); $always = new ilRadioOption($this->lng->txt('tst_results_access_always'), REDIRECT_ALWAYS); $radio_rm->addOption($always); $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK); $radio_rm->addOption($kiosk); $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS); $rm_enabled->addSubItem($radio_rm); $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url'); $redirection_url->setValue((string) $this->testOBJ->getRedirectionUrl()); $redirection_url->setRequired(true); $rm_enabled->addSubItem($redirection_url); $form->addItem($rm_enabled); // Sign submission $sign_submission = $this->testOBJ->getSignSubmission(); $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission'); $sign_submission_enabled->setChecked($sign_submission); $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info')); $form->addItem($sign_submission_enabled); if (!$this->settingsTemplate || $this->formShowParticipantSection($this->settingsTemplate->getSettings())) { // participants properties $restrictions = new ilFormSectionHeaderGUI(); $restrictions->setTitle($this->lng->txt("tst_max_allowed_users")); $form->addItem($restrictions); } $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants"); $fixedparticipants->setValue(1); $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants()); $fixedparticipants->setOptionTitle($this->lng->txt("tst_allow_fixed_participants")); $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description")); $invited_users = $this->testOBJ->getInvitedUsers(); if ($total && count($invited_users) == 0) { $fixedparticipants->setDisabled(true); } $form->addItem($fixedparticipants); // simultaneous users $simul = new ilTextInputGUI($this->lng->txt("tst_allowed_users"), "allowedUsers"); $simul->setSize(3); $simul->setValue($this->testOBJ->getAllowedUsers() ? $this->testOBJ->getAllowedUsers() : ''); $form->addItem($simul); // idle time $idle = new ilTextInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap"); $idle->setSize(4); $idle->setSuffix($this->lng->txt("seconds")); $idle->setValue($this->testOBJ->getAllowedUsersTimeGap() ? $this->testOBJ->getAllowedUsersTimeGap() : ''); $form->addItem($idle); // Edit ecs export settings include_once 'Modules/Test/classes/class.ilECSTestSettings.php'; $ecs = new ilECSTestSettings($this->testOBJ); $ecs->addSettingsToForm($form, 'tst'); // remove items when using template if ($this->settingsTemplate) { foreach ($this->settingsTemplate->getSettings() as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } return $form; }
/** * Init category mapping form * @return */ protected function initCategoryMappingForm($a_mode = 'add') { global $ilDB; if (is_object($this->form)) { return true; } include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php'; $this->form = new ilPropertyFormGUI(); if ($a_mode == 'add') { $this->form->setTitle($this->lng->txt('ecs_new_category_mapping')); $this->form->setFormAction($this->ctrl->getFormAction($this, 'categoryMapping')); $this->form->addCommandButton('addCategoryMapping', $this->lng->txt('save')); $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel')); } else { $this->form->setTitle($this->lng->txt('ecs_edit_category_mapping')); $this->form->setFormAction($this->ctrl->getFormAction($this, 'editCategoryMapping')); $this->form->addCommandButton('updateCategoryMapping', $this->lng->txt('save')); $this->form->addCommandButton('categoryMapping', $this->lng->txt('cancel')); } $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'), 'import_id'); $imp->setRequired(true); $tpl = new ilTemplate('tpl.ecs_import_id_form.html', true, true, 'Services/WebServices/ECS'); $tpl->setVariable('SIZE', 5); $tpl->setVariable('MAXLENGTH', 11); $tpl->setVariable('POST_VAR', 'import_id'); $tpl->setVariable('PROPERTY_VALUE', $this->rule->getContainerId()); if ($this->settings->getImportId()) { $tpl->setVariable('COMPLETE_PATH', $this->buildPath($this->rule->getContainerId())); } $imp->setHTML($tpl->get()); $imp->setInfo($this->lng->txt('ecs_import_id_info')); $this->form->addItem($imp); include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php'; $select = new ilSelectInputGUI($this->lng->txt('ecs_attribute_name'), 'field'); $select->setValue($this->rule->getFieldName()); $select->setRequired(true); $select->setOptions(ilECSCategoryMapping::getPossibleFields()); $this->form->addItem($select); // Value $value = new ilRadioGroupInputGUI($this->lng->txt('ecs_cat_mapping_type'), 'type'); $value->setValue($this->rule->getMappingType()); $value->setRequired(true); $fixed = new ilRadioOption($this->lng->txt('ecs_cat_mapping_fixed'), ilECSCategoryMappingRule::TYPE_FIXED); $fixed->setInfo($this->lng->txt('ecs_cat_mapping_fixed_info')); $fixed_val = new ilTextInputGUI($this->lng->txt('ecs_cat_mapping_values'), 'mapping_value'); $fixed_val->setValue($this->rule->getMappingValue()); $fixed_val->setMaxLength(255); $fixed_val->setSize(40); $fixed_val->setRequired(true); $fixed->addSubItem($fixed_val); $value->addOption($fixed); $duration = new ilRadioOption($this->lng->txt('ecs_cat_mapping_duration'), ilECSCategoryMappingRule::TYPE_DURATION); $duration->setInfo($this->lng->txt('ecs_cat_mapping_duration_info')); $dur_start = new ilDateTimeInputGUI($this->lng->txt('from'), 'dur_begin'); $dur_start->setDate($this->rule->getDateRangeStart()); $duration->addSubItem($dur_start); $dur_end = new ilDateTimeInputGUI($this->lng->txt('to'), 'dur_end'); $dur_end->setDate($this->rule->getDateRangeEnd()); $duration->addSubItem($dur_end); $value->addOption($duration); $type = new ilRadioOption($this->lng->txt('ecs_cat_mapping_by_type'), ilECSCategoryMappingRule::TYPE_BY_TYPE); $type->setInfo($this->lng->txt('ecs_cat_mapping_by_type_info')); $options = ilECSUtils::getPossibleRemoteTypes(true); $types = new ilSelectInputGUI($this->lng->txt('type'), 'by_type'); $types->setOptions($options); $types->setValue($this->rule->getByType()); $types->setRequired(true); $type->addSubitem($types); $value->addOption($type); $this->form->addItem($value); }
/** * Show lucene settings form * @param * @return */ protected function initFormLuceneSettings() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/Search/classes/class.ilSearchSettings.php'; $this->settings = ilSearchSettings::getInstance(); $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this, 'cancel')); $this->form->setTitle($this->lng->txt('lucene_settings_title')); $this->form->addCommandButton('saveLuceneSettings', $this->lng->txt('save')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); // Offline filter /* $offline = new ilCheckboxInputGUI($this->lng->txt('lucene_offline_filter_setting'),'offline_filter'); $offline->setInfo($this->lng->txt('lucene_offline_filter_setting_info')); $offline->setValue(1); $offline->setChecked($this->settings->isLuceneOfflineFilterEnabled()); $this->form->addItem($offline); */ // user search $us = new ilCheckboxInputGUI($this->lng->txt('search_user_search_form'), 'user_search_enabled'); $us->setInfo($this->lng->txt('search_user_search_info_form')); $us->setValue(1); $us->setChecked($this->settings->isLuceneUserSearchEnabled()); $this->form->addItem($us); // Item filter $if = new ilCheckboxInputGUI($this->lng->txt('search_mime_filter_form'), 'mime_enabled'); $if->setValue(1); $if->setChecked($this->settings->isLuceneMimeFilterEnabled()); $if->setInfo($this->lng->txt('search_item_filter_form_info')); $this->form->addItem($if); $mimes = $this->settings->getLuceneMimeFilter(); foreach (ilSearchSettings::getLuceneMimeFilterDefinitions() as $mime => $def) { $ch = new ilCheckboxInputGUI($this->lng->txt($def['trans']), 'mime[' . $mime . ']'); if (isset($mimes[$mime]) and $mimes[$mime]) { $ch->setChecked(true); } $ch->setValue(1); $if->addSubItem($ch); } $prefix = new ilCheckboxInputGUI($this->lng->txt('lucene_prefix_wildcard'), 'prefix'); $prefix->setValue(1); $prefix->setInfo($this->lng->txt('lucene_prefix_wildcard_info')); $prefix->setChecked($this->settings->isPrefixWildcardQueryEnabled()); $this->form->addItem($prefix); $numFrag = new ilNumberInputGUI($this->lng->txt('lucene_num_fragments'), 'fragmentCount'); $numFrag->setRequired(true); $numFrag->setSize(2); $numFrag->setMaxLength(2); $numFrag->setMinValue(1); $numFrag->setMaxValue(10); $numFrag->setInfo($this->lng->txt('lucene_num_frag_info')); $numFrag->setValue($this->settings->getFragmentCount()); $this->form->addItem($numFrag); $sizeFrag = new ilNumberInputGUI($this->lng->txt('lucene_size_fragments'), 'fragmentSize'); $sizeFrag->setRequired(true); $sizeFrag->setSize(2); $sizeFrag->setMaxLength(4); $sizeFrag->setMinValue(10); $sizeFrag->setMaxValue(1000); $sizeFrag->setInfo($this->lng->txt('lucene_size_frag_info')); $sizeFrag->setValue($this->settings->getFragmentSize()); $this->form->addItem($sizeFrag); $maxSub = new ilNumberInputGUI($this->lng->txt('lucene_max_sub'), 'maxSubitems'); $maxSub->setRequired(true); $maxSub->setSize(2); $maxSub->setMaxLength(2); $maxSub->setMinValue(1); $maxSub->setMaxValue(10); $maxSub->setInfo($this->lng->txt('lucene_max_sub_info')); $maxSub->setValue($this->settings->getMaxSubitems()); $this->form->addItem($maxSub); $relevance = new ilCheckboxInputGUI($this->lng->txt('lucene_relevance'), 'relevance'); $relevance->setOptionTitle($this->lng->txt('lucene_show_relevance')); $relevance->setInfo($this->lng->txt('lucene_show_relevance_info')); $relevance->setValue(1); $relevance->setChecked($this->settings->isRelevanceVisible()); $this->form->addItem($relevance); // begin-patch mime_filter $subrel = new ilCheckboxInputGUI('', 'subrelevance'); $subrel->setOptionTitle($this->lng->txt('lucene_show_sub_relevance')); $subrel->setValue(1); $subrel->setChecked($this->settings->isSubRelevanceVisible()); $relevance->addSubItem($subrel); // end-patch mime_filter $last_index = new ilDateTimeInputGUI($this->lng->txt('lucene_last_index_time'), 'last_index'); $last_index->setShowTime(true); $last_index->setDate($this->settings->getLastIndexTime()); $last_index->setInfo($this->lng->txt('lucene_last_index_time_info')); $this->form->addItem($last_index); return true; }
/** * Init setting form */ function initSettingsForm() { global $ilUser, $lng, $ilCtrl, $ilSetting, $ilTabs; $ilTabs->clearTargets(); $news_set = new ilSetting("news"); $enable_internal_rss = $news_set->get("enable_rss_for_internal"); $public = ilBlockSetting::_lookup($this->getBlockType(), "public_notifications", 0, $this->block_id); $public_feed = ilBlockSetting::_lookup($this->getBlockType(), "public_feed", 0, $this->block_id); $hide_block = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_block", 0, $this->block_id); $hide_news_per_date = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_per_date", 0, $this->block_id); $hide_news_date = ilBlockSetting::_lookup($this->getBlockType(), "hide_news_date", 0, $this->block_id); if ($hide_news_date != "") { $hide_news_date = explode(" ", $hide_news_date); } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->settings_form = new ilPropertyFormGUI(); $this->settings_form->setTitle($lng->txt("news_settings")); $this->settings_form->setTitleIcon(ilUtil::getImagePath("icon_news.png")); // hide news block for learners if ($this->getProperty("hide_news_block_option")) { $ch = new ilCheckboxInputGUI($lng->txt("news_hide_news_block"), "hide_news_block"); $ch->setInfo($lng->txt("news_hide_news_block_info")); $ch->setChecked($hide_block); $this->settings_form->addItem($ch); $hnpd = new ilCheckboxInputGUI($lng->txt("news_hide_news_per_date"), "hide_news_per_date"); $hnpd->setInfo($lng->txt("news_hide_news_per_date_info")); $hnpd->setChecked($hide_news_per_date); $dt_prop = new ilDateTimeInputGUI($lng->txt("news_hide_news_date"), "hide_news_date"); if ($hide_news_date != "") { $dt_prop->setDate(new ilDateTime($hide_news_date[0] . ' ' . $hide_news_date[1], IL_CAL_DATETIME)); } #$dt_prop->setDate($hide_news_date[0]); #$dt_prop->setTime($hide_news_date[1]); $dt_prop->setShowTime(true); //$dt_prop->setInfo($lng->txt("news_hide_news_date_info")); $hnpd->addSubItem($dt_prop); $this->settings_form->addItem($hnpd); } // default visibility if ($this->getProperty("default_visibility_option") && $enable_internal_rss) { $default_visibility = ilBlockSetting::_lookup($this->getBlockType(), "default_visibility", 0, $this->block_id); if ($default_visibility == "") { $default_visibility = ilNewsItem::_getDefaultVisibilityForRefId($_GET["ref_id"]); } // Default Visibility $radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "default_visibility"); $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "users"); $radio_group->addOption($radio_option); $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "public"); $radio_group->addOption($radio_option); $radio_group->setInfo($lng->txt("news_news_item_visibility_info")); $radio_group->setRequired(false); $radio_group->setValue($default_visibility); $this->settings_form->addItem($radio_group); } // public notifications if ($this->getProperty("public_notifications_option") && $enable_internal_rss) { $ch = new ilCheckboxInputGUI($lng->txt("news_notifications_public"), "notifications_public"); $ch->setInfo($lng->txt("news_notifications_public_info")); $ch->setChecked($public); $this->settings_form->addItem($ch); } // extra rss feed if ($enable_internal_rss) { $ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"), "notifications_public_feed"); $ch->setInfo($lng->txt("news_public_feed_info")); $ch->setChecked($public_feed); $this->settings_form->addItem($ch); } //$this->settings_form->addCheckboxProperty($lng->txt("news_public_feed"), "notifications_public_feed", // "1", $public_feed, $lng->txt("news_public_feed_info")); //if ($this->getProperty("public_notifications_option")) //{ // $this->settings_form->addCheckboxProperty($lng->txt("news_notifications_public"), "notifications_public", // "1", $public, $lng->txt("news_notifications_public_info")); //} $this->settings_form->addCommandButton("saveSettings", $lng->txt("save")); $this->settings_form->addCommandButton("cancelSettings", $lng->txt("cancel")); $this->settings_form->setFormAction($ilCtrl->getFormaction($this)); }
/** * Show special form for ecs start * * @access private * @param object ilAdvMDFieldDefinition */ private function showECSStart($def) { global $ilUser; $this->lng->loadLanguageModule('ecs'); include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php'; $value_start = ilAdvancedMDValue::_getInstance($this->obj_id, $def->getFieldId()); $unixtime = $value_start->getValue() ? $value_start->getValue() : mktime(8, 0, 0, date('m'), date('d'), date('Y')); $time = new ilDateTimeInputGUI($this->lng->txt('ecs_event_appointment'), 'md[' . $def->getFieldId() . ']'); $time->setShowTime(true); $time->setDate(new ilDateTime($unixtime, IL_CAL_UNIX)); $time->enableDateActivation($this->lng->txt('enabled'), 'md_activated[' . $def->getFieldId() . ']', $value_start->getValue() ? true : false); $time->setDisabled($value_start->isDisabled()); $mapping = ilECSDataMappingSettings::_getInstance(); if ($field_id = $mapping->getMappingByECSName('end')) { $value_end = ilAdvancedMDValue::_getInstance($this->obj_id, $field_id); list($hours, $minutes) = $this->parseDuration($value_start->getValue(), $value_end->getValue()); $duration = new ilDurationInputGUI($this->lng->txt('ecs_duration'), 'ecs_duration'); $duration->setHours($hours); $duration->setMinutes($minutes); #$duration->setInfo($this->lng->txt('ecs_duration_info')); $duration->setShowHours(true); $duration->setShowMinutes(true); $time->addSubItem($duration); } if ($field_id = $mapping->getMappingByECSName('cycle')) { $value = ilAdvancedMDValue::_getInstance($this->obj_id, $field_id); $cycle_def = ilAdvancedMDFieldDefinition::getInstance($field_id); switch ($cycle_def->getFieldType()) { case ilAdvancedMDFieldDefinition::TYPE_TEXT: $text = new ilTextInputGUI($cycle_def->getTitle(), 'md[' . $cycle_def->getFieldId() . ']'); $text->setValue($value->getValue()); $text->setSize(20); $text->setMaxLength(512); $text->setDisabled($value->isDisabled()); $time->addSubItem($text); break; case ilAdvancedMDFieldDefinition::TYPE_SELECT: $select = new ilSelectInputGUI($cycle_def->getTitle(), 'md[' . $cycle_def->getFieldId() . ']'); $select->setOptions($cycle_def->getFieldValuesForSelect()); $select->setValue($value->getValue()); $select->setDisabled($value->isDisabled()); $time->addSubItem($select); break; } } if ($field_id = $mapping->getMappingByECSName('room')) { $value = ilAdvancedMDValue::_getInstance($this->obj_id, $field_id); $room_def = ilAdvancedMDFieldDefinition::getInstance($field_id); switch ($room_def->getFieldType()) { case ilAdvancedMDFieldDefinition::TYPE_TEXT: $text = new ilTextInputGUI($room_def->getTitle(), 'md[' . $room_def->getFieldId() . ']'); $text->setValue($value->getValue()); $text->setSize(20); $text->setMaxLength(512); $text->setDisabled($value->isDisabled()); $time->addSubItem($text); break; case ilAdvancedMDFieldDefinition::TYPE_SELECT: $select = new ilSelectInputGUI($room_def->getTitle(), 'md[' . $room_def->getFieldId() . ']'); $select->setOptions($cycle_def->getFieldValuesForSelect()); $select->setValue($value->getValue()); $select->setDisabled($value->isDisabled()); $time->addSubItem($select); break; } } $this->form->addItem($time); }
/** * init form * * @access protected * @param string mode ('edit' | 'create') * @return */ protected function initForm($a_mode, $a_as_milestone = false, $a_edit_single_app = false) { global $ilUser, $tpl; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/Calendar/classes/class.ilCalendarRecurrenceGUI.php'; include_once './Services/Calendar/classes/class.ilCalendarCategories.php'; include_once './Services/Calendar/classes/class.ilCalendarCategoryAssignments.php'; include_once './Services/Calendar/classes/class.ilCalendarCategory.php'; $this->form = new ilPropertyFormGUI(); include_once './Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initDomEvent(); $resp_info = false; switch ($a_mode) { case 'create': $this->ctrl->saveParameter($this, array('seed', 'idate')); $this->form->setFormAction($this->ctrl->getFormAction($this)); if ($a_as_milestone) { $this->form->setTitle($this->lng->txt('cal_new_ms')); $this->form->addCommandButton('saveMilestone', $this->lng->txt('cal_add_milestone')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); } else { $this->form->setTitle($this->lng->txt('cal_new_app')); $this->form->addCommandButton('save', $this->lng->txt('cal_add_appointment')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); } break; case 'edit': if ($a_as_milestone) { $this->form->setTitle($this->lng->txt('cal_edit_milestone')); } else { $this->form->setTitle($this->lng->txt('cal_edit_appointment')); } $this->ctrl->saveParameter($this, array('seed', 'app_id', 'idate')); $this->form->setFormAction($this->ctrl->getFormAction($this)); $ass = new ilCalendarCategoryAssignments($this->app->getEntryId()); $cat = $ass->getFirstAssignment(); include_once './Services/Calendar/classes/class.ilCalendarCategory.php'; $cat_info = ilCalendarCategories::_getInstance()->getCategoryInfo($cat); $type = ilObject::_lookupType($cat_info['obj_id']); if ($a_as_milestone && $cat_info['type'] == ilCalendarCategory::TYPE_OBJ && ($type == "grp" || $type == "crs")) { $resp_info = true; $this->form->addCommandButton('editResponsibleUsers', $this->lng->txt('cal_change_responsible_users')); } $this->form->addCommandButton('update', $this->lng->txt('save')); // $this->form->addCommandButton('askDelete',$this->lng->txt('delete')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); break; } // title $title = new ilTextInputGUI($this->lng->txt('title'), 'title'); $title->setValue($this->app->getTitle()); $title->setRequired(true); $title->setMaxLength(128); $title->setSize(32); $this->form->addItem($title); // calendar selection $calendar = new ilSelectInputGUI($this->lng->txt('cal_category_selection'), 'calendar'); if ($_POST['category']) { $calendar->setValue((int) $_POST['calendar']); $selected_calendar = (int) $_POST['calendar']; } else { if ($_GET['category_id']) { $calendar->setValue((int) $_GET['category_id']); $selected_calendar = (int) $_GET['category_id']; } elseif ($a_mode == 'edit') { $ass = new ilCalendarCategoryAssignments($this->app->getEntryId()); $cat = $ass->getFirstAssignment(); $calendar->setValue($cat); $selected_calendar = $cat; } elseif (isset($_GET['ref_id'])) { include_once './Services/Calendar/classes/class.ilCalendarCategories.php'; $obj_cal = ilObject::_lookupObjId($_GET['ref_id']); $calendar->setValue(ilCalendarCategories::_lookupCategoryIdByObjId($obj_cal)); $selected_calendar = ilCalendarCategories::_lookupCategoryIdByObjId($obj_cal); } } $calendar->setRequired(true); $cats = ilCalendarCategories::_getInstance($ilUser->getId()); $calendar->setOptions($cats->prepareCategoriesOfUserForSelection()); include_once './Services/Calendar/classes/class.ilCalendarSettings.php'; if (ilCalendarSettings::_getInstance()->isNotificationEnabled()) { $notification_cals = $cats->getNotificationCalendars(); $notification_cals = count($notification_cals) ? implode(',', $notification_cals) : ''; $calendar->addCustomAttribute("onchange=\"ilToggleNotification(new Array(" . $notification_cals . "));\""); } $this->form->addItem($calendar); if (!$a_as_milestone) { include_once './Services/Form/classes/class.ilDateDurationInputGUI.php'; $tpl->addJavaScript('./Services/Form/js/date_duration.js'); $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'event'); $dur->setStartText($this->lng->txt('cal_start')); $dur->setEndText($this->lng->txt('cal_end')); $dur->enableToggleFullTime($this->lng->txt('cal_fullday_title'), $this->app->isFullday() ? true : false); $dur->setShowTime(true); $dur->setStart($this->app->getStart()); $dur->setEnd($this->app->getEnd()); $this->form->addItem($dur); // recurrence include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php'; $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence'); $rec->setRecurrence($this->rec); $this->form->addItem($rec); // location $where = new ilTextInputGUI($this->lng->txt('cal_where'), 'location'); $where->setValue($this->app->getLocation()); $where->setMaxLength(128); $where->setSize(32); $this->form->addItem($where); } else { $deadline = new ilDateTimeInputGUI($this->lng->txt('cal_deadline'), 'event[start]'); $deadline->setDate($this->app->getStart()); $deadline->setShowTime(false); $deadline->setMinuteStepSize(5); $this->form->addItem($deadline); // completion $completion_vals = array(); for ($i = 0; $i <= 100; $i += 5) { $completion_vals[$i] = $i . " %"; } $compl = new ilSelectInputGUI($this->lng->txt('cal_task_completion'), 'completion'); $compl->setOptions($completion_vals); $compl->setValue($this->app->getCompletion()); $this->form->addItem($compl); } $desc = new ilTextAreaInputGUI($this->lng->txt('description'), 'description'); $desc->setValue($this->app->getDescription()); $desc->setRows(5); $this->form->addItem($desc); if ($a_as_milestone && $a_mode == "edit" && $resp_info) { // users responsible $users = $this->app->readResponsibleUsers(); $resp = new ilNonEditableValueGUI($this->lng->txt('cal_responsible'), $users); $delim = ""; foreach ($users as $r) { $value .= $delim . $r["lastname"] . ", " . $r["firstname"] . " [" . $r["login"] . "]"; $delim = "<br />"; } if (count($users) > 0) { $resp->setValue($value); } else { $resp->setValue("-"); } $this->form->addItem($resp); } if (ilCalendarSettings::_getInstance()->isUserNotificationEnabled()) { $notu = new ilTextWizardInputGUI($this->lng->txt('cal_user_notification'), 'notu'); $notu->setInfo($this->lng->txt('cal_user_notification_info')); $notu->setSize(20); $notu->setMaxLength(64); $values = array(); foreach ($this->notification->getRecipients() as $rcp) { switch ($rcp['type']) { case ilCalendarUserNotification::TYPE_USER: $values[] = ilObjUser::_lookupLogin($rcp['usr_id']); break; case ilCalendarUserNotification::TYPE_EMAIL: $values[] = $rcp['email']; break; } } if (count($values)) { $notu->setValues($values); } else { $notu->setValues(array('')); } $this->form->addItem($notu); } // Notifications include_once './Services/Calendar/classes/class.ilCalendarSettings.php'; if (ilCalendarSettings::_getInstance()->isNotificationEnabled() and count($cats->getNotificationCalendars())) { $selected_cal = new ilCalendarCategory($selected_calendar); $disabled = true; if ($selected_cal->getType() == ilCalendarCategory::TYPE_OBJ) { if (ilObject::_lookupType($selected_cal->getObjId()) == 'crs' or ilObject::_lookupType($selected_cal->getObjId()) == 'grp') { $disabled = false; } } $tpl->addJavaScript('./Services/Calendar/js/toggle_notification.js'); $not = new ilCheckboxInputGUI($this->lng->txt('cal_cg_notification'), 'not'); $not->setInfo($this->lng->txt('cal_notification_info')); $not->setValue(1); $not->setChecked($this->app->isNotificationEnabled()); $not->setDisabled($disabled); $this->form->addItem($not); } }
/** * Display and fill the properties form of the test * * @access public */ function propertiesObject($checkonly = FALSE) { global $ilAccess; if (!$ilAccess->checkAccess("write", "", $this->ref_id)) { // allow only write access ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true); $this->ctrl->redirect($this, "infoScreen"); } // using template? $template_settings = null; $template = $this->object->getTemplate(); if ($template) { include_once "Services/Administration/classes/class.ilSettingsTemplate.php"; $template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig()); $template_settings = $template->getSettings(); $hide_rte_switch = $template_settings["rte_switch"]["hide"]; } $save = strcmp($this->ctrl->getCmd(), "saveProperties") == 0 ? TRUE : FALSE; $total = $this->object->evalTotalPersons(); $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js"); include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTableWidth("100%"); $form->setId("test_properties"); if (!$template || $template && $this->formShowGeneralSection($template_settings)) { // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("tst_general_properties")); $form->addItem($header); } // title & description (meta data) include_once 'Services/MetaData/classes/class.ilMD.php'; $md_obj = new ilMD($this->object->getId(), 0, "tst"); $md_section = $md_obj->getGeneral(); $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); $title->setValue($md_section->getTitle()); $form->addItem($title); $ids = $md_section->getDescriptionIds(); if ($ids) { $desc_obj = $md_section->getDescription(array_pop($ids)); $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description"); $desc->setCols(50); $desc->setRows(4); $desc->setValue($desc_obj->getDescription()); $form->addItem($desc); } // anonymity $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity'); if ($total) { $anonymity->setDisabled(true); } $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0); $anonymity->addOption($rb); $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1); $anonymity->addOption($rb); $anonymity->setValue((int) $this->object->getAnonymity()); $form->addItem($anonymity); // random selection of questions $random = new ilCheckboxInputGUI($this->lng->txt("tst_random_selection"), "random_test"); $random->setValue(1); if ($total) { $random->setDisabled(true); } $random->setChecked($this->object->isRandomTest()); $info = $this->lng->txt("tst_random_test_description"); if ($this->object->hasQuestionsWithoutQuestionpool()) { $info .= $this->lng->txt("tst_random_test_description_warning"); } $random->setInfo($info); $form->addItem($random); // pool usage $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool"); $pool_usage->setValue(1); $pool_usage->setChecked($this->object->getPoolUsage()); $form->addItem($pool_usage); // activation/availability (no template support yet) include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setChecked($this->object->isOnline()); $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info); $form->addItem($online); $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type'); $act_type->setInfo($act_ref_info); $act_type->setValue($this->object->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED); $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED); $opt->setInfo($this->lng->txt('tst_availability_limitless_info')); $act_type->addOption($opt); $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION); $opt->setInfo($this->lng->txt('tst_availability_until_info')); $date = $this->object->getActivationStartingTime(); $start = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_start'), 'act_starting_time'); #$start->setMode(ilDateTimeInputGUI::MODE_INPUT); $start->setShowTime(true); $start->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($start); $date = $this->object->getActivationEndingTime(); $end = new ilDateTimeInputGUI($this->lng->txt('rep_activation_limited_end'), 'act_ending_time'); #$end->setMode(ilDateTimeInputGUI::MODE_INPUT); $end->setShowTime(true); $end->setDate(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $opt->addSubItem($end); $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility'); $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info')); $visible->setChecked($this->object->getActivationVisibility()); $opt->addSubItem($visible); $act_type->addOption($opt); $form->addItem($act_type); if (!$template || $template && $this->formShowBeginningEndingInformation($template_settings)) { // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("tst_beginning_ending_information")); $form->addItem($header); } // introduction $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction"), "introduction"); $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction())); $intro->setRows(10); $intro->setCols(80); $intro->setUseRte(TRUE); $intro->addPlugin("latex"); $intro->addButton("latex"); $intro->setRTESupport($this->object->getId(), "tst", 'assessment', null, false, '3.4.7'); $intro->setRteTagSet('full'); $intro->setInfo($this->lng->txt('intro_desc')); // showinfo $showinfo = new ilCheckboxInputGUI('', "showinfo"); $showinfo->setValue(1); $showinfo->setChecked($this->object->getShowInfo()); $showinfo->setOptionTitle($this->lng->txt("showinfo")); $showinfo->setInfo($this->lng->txt("showinfo_desc")); $intro->addSubItem($showinfo); $form->addItem($intro); // final statement $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement"); $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getFinalStatement())); $finalstatement->setRows(10); $finalstatement->setCols(80); $finalstatement->setUseRte(TRUE); $finalstatement->addPlugin("latex"); $finalstatement->addButton("latex"); $finalstatement->setRTESupport($this->object->getId(), "tst", "assessment", null, false, '3.4.7'); $finalstatement->setRteTagSet('full'); // show final statement $showfinal = new ilCheckboxInputGUI('', "showfinalstatement"); $showfinal->setValue(1); $showfinal->setChecked($this->object->getShowFinalStatement()); $showfinal->setOptionTitle($this->lng->txt("final_statement_show")); $showfinal->setInfo($this->lng->txt("final_statement_show_desc")); $finalstatement->addSubItem($showfinal); $form->addItem($finalstatement); if (!$template || $template && $this->formShowSessionSection($template_settings)) { // session properties $sessionheader = new ilFormSectionHeaderGUI(); $sessionheader->setTitle($this->lng->txt("tst_session_settings")); $form->addItem($sessionheader); } // max. number of passes $nr_of_tries = new ilTextInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries"); $nr_of_tries->setSize(3); $nr_of_tries->setValue($this->object->getNrOfTries()); $nr_of_tries->setRequired(true); $nr_of_tries->setSuffix($this->lng->txt("0_unlimited")); if ($total) { $nr_of_tries->setDisabled(true); } $form->addItem($nr_of_tries); // enable max. processing time $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time"); $processing->setValue(1); //$processing->setOptionTitle($this->lng->txt("enabled")); if ($template_settings && $template_settings['chb_processing_time'] && $template_settings['chb_processing_time']['value']) { $processing->setChecked(true); } else { $processing->setChecked($this->object->getEnableProcessingTime()); } // max. processing time $processingtime = new ilDurationInputGUI('', 'processing_time'); $ptime = $this->object->getProcessingTimeAsArray(); $processingtime->setHours($ptime['hh']); $processingtime->setMinutes($ptime['mm']); $processingtime->setSeconds($ptime['ss']); $processingtime->setShowMonths(false); $processingtime->setShowDays(false); $processingtime->setShowHours(true); $processingtime->setShowMinutes(true); $processingtime->setShowSeconds(true); $processingtime->setInfo($this->lng->txt("tst_processing_time_desc")); $processing->addSubItem($processingtime); // reset max. processing time $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time"); $resetprocessing->setValue(1); $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time")); $resetprocessing->setChecked($this->object->getResetProcessingTime()); $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc")); $processing->addSubItem($resetprocessing); $form->addItem($processing); // enable starting time $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("tst_starting_time"), "chb_starting_time"); $enablestartingtime->setValue(1); //$enablestartingtime->setOptionTitle($this->lng->txt("enabled")); if ($template_settings && $template_settings['chb_starting_time'] && $template_settings['chb_starting_time']['value']) { $enablestartingtime->setChecked(true); } else { $enablestartingtime->setChecked(strlen($this->object->getStartingTime())); } // starting time $startingtime = new ilDateTimeInputGUI('', 'starting_time'); $startingtime->setShowDate(true); $startingtime->setShowTime(true); if (strlen($this->object->getStartingTime())) { $startingtime->setDate(new ilDateTime($this->object->getStartingTime(), IL_CAL_TIMESTAMP)); } else { $startingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $enablestartingtime->addSubItem($startingtime); if ($total) { $enablestartingtime->setDisabled(true); } if ($total) { $startingtime->setDisabled(true); } $form->addItem($enablestartingtime); // enable ending time $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("tst_ending_time"), "chb_ending_time"); $enableendingtime->setValue(1); //$enableendingtime->setOptionTitle($this->lng->txt("enabled")); if ($template_settings && $template_settings['chb_ending_time'] && $template_settings['chb_ending_time']['value']) { $enableendingtime->setChecked(true); } else { $enableendingtime->setChecked(strlen($this->object->getEndingTime())); } // ending time $endingtime = new ilDateTimeInputGUI('', 'ending_time'); $endingtime->setShowDate(true); $endingtime->setShowTime(true); if (strlen($this->object->getEndingTime())) { $endingtime->setDate(new ilDateTime($this->object->getEndingTime(), IL_CAL_TIMESTAMP)); } else { $endingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $enableendingtime->addSubItem($endingtime); $form->addItem($enableendingtime); // test password $password = new ilTextInputGUI($this->lng->txt("tst_password"), "password"); $password->setSize(20); $password->setValue($this->object->getPassword()); $password->setInfo($this->lng->txt("tst_password_details")); $form->addItem($password); if (!$template || $template && $this->formShowPresentationSection($template_settings)) { // sequence properties $seqheader = new ilFormSectionHeaderGUI(); $seqheader->setTitle($this->lng->txt("tst_presentation_properties")); $form->addItem($seqheader); } // use previous answers $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers"); $prevanswers->setValue(1); $prevanswers->setChecked($this->object->getUsePreviousAnswers()); $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description")); $form->addItem($prevanswers); // force js $forcejs = new ilCheckboxInputGUI($this->lng->txt("forcejs_short"), "forcejs"); $forcejs->setValue(1); $forcejs->setChecked($this->object->getForceJS()); $forcejs->setOptionTitle($this->lng->txt("forcejs")); $forcejs->setInfo($this->lng->txt("forcejs_desc")); $form->addItem($forcejs); // question title output $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output"); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, '')); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, '')); $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, '')); $title_output->setValue($this->object->getTitleOutput()); $title_output->setInfo($this->lng->txt("tst_title_output_description")); $form->addItem($title_output); // Autosave $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave'); $autosave_output->setValue(1); $autosave_output->setChecked($this->object->getAutosave()); $autosave_output->setInfo($this->lng->txt('autosave_info')); $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival'); $autosave_interval->setSize(10); $autosave_interval->setValue($this->object->getAutosaveIval()); $autosave_interval->setInfo($this->lng->txt('autosave_ival_info')); $autosave_output->addSubItem($autosave_interval); $form->addItem($autosave_output); if (!$template || $template && $this->formShowSequenceSection($template_settings)) { // sequence properties $seqheader = new ilFormSectionHeaderGUI(); $seqheader->setTitle($this->lng->txt("tst_sequence_properties")); $form->addItem($seqheader); } // postpone questions $postpone = new ilCheckboxInputGUI($this->lng->txt("tst_postpone"), "chb_postpone"); $postpone->setValue(1); $postpone->setChecked($this->object->getSequenceSettings()); $postpone->setInfo($this->lng->txt("tst_postpone_description")); $form->addItem($postpone); // shuffle questions $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions"); $shuffle->setValue(1); $shuffle->setChecked($this->object->getShuffleQuestions()); $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description")); $form->addItem($shuffle); // show list of questions $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions"); //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary")); $list_of_questions->setValue(1); $list_of_questions->setChecked($this->object->getListOfQuestions()); $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description")); $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options"); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', '')); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', '')); $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', '')); $values = array(); if ($this->object->getListOfQuestionsStart()) { array_push($values, 'chb_list_of_questions_start'); } if ($this->object->getListOfQuestionsEnd()) { array_push($values, 'chb_list_of_questions_end'); } if ($this->object->getListOfQuestionsDescription()) { array_push($values, 'chb_list_of_questions_with_description'); } $list_of_questions_options->setValue($values); $list_of_questions->addSubItem($list_of_questions_options); $form->addItem($list_of_questions); // show question marking $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker"); $marking->setValue(1); $marking->setChecked($this->object->getShowMarker()); $marking->setInfo($this->lng->txt("question_marking_description")); $form->addItem($marking); // show suspend test $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel"); $cancel->setValue(1); $cancel->setChecked($this->object->getShowCancel()); $cancel->setInfo($this->lng->txt("tst_show_cancel_description")); $form->addItem($cancel); if (!$template || $template && $this->formShowNotificationSection($template_settings)) { // notifications $notifications = new ilFormSectionHeaderGUI(); $notifications->setTitle($this->lng->txt("tst_mail_notification")); $form->addItem($notifications); } // mail notification $mailnotification = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification"); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_no"), 0, '')); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, '')); $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, '')); $mailnotification->setValue($this->object->getMailNotification()); $form->addItem($mailnotification); $mailnottype = new ilCheckboxInputGUI('', "mailnottype"); $mailnottype->setValue(1); $mailnottype->setOptionTitle($this->lng->txt("mailnottype")); $mailnottype->setChecked($this->object->getMailNotificationType()); $form->addItem($mailnottype); /* This options always active (?) */ $highscore_head = new ilFormSectionHeaderGUI(); $highscore_head->setTitle($this->lng->txt("tst_highscore_options")); $form->addItem($highscore_head); $highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled"); $highscore->setValue(1); $highscore->setChecked($this->object->getHighscoreEnabled()); $highscore->setInfo($this->lng->txt("tst_highscore_description")); $form->addItem($highscore); $highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon"); $highscore_anon->setValue(1); $highscore_anon->setChecked($this->object->getHighscoreAnon()); $highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description")); $highscore->addSubItem($highscore_anon); $highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts"); $highscore_achieved_ts->setValue(1); $highscore_achieved_ts->setChecked($this->object->getHighscoreAchievedTS()); $highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description")); $highscore->addSubItem($highscore_achieved_ts); $highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score"); $highscore_score->setValue(1); $highscore_score->setChecked($this->object->getHighscoreScore()); $highscore_score->setInfo($this->lng->txt("tst_highscore_score_description")); $highscore->addSubItem($highscore_score); $highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage"); $highscore_percentage->setValue(1); $highscore_percentage->setChecked($this->object->getHighscorePercentage()); $highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description")); $highscore->addSubItem($highscore_percentage); $highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints"); $highscore_hints->setValue(1); $highscore_hints->setChecked($this->object->getHighscoreHints()); $highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description")); $highscore->addSubItem($highscore_hints); $highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime"); $highscore_wtime->setValue(1); $highscore_wtime->setChecked($this->object->getHighscoreWTime()); $highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description")); $highscore->addSubItem($highscore_wtime); $highscore_own_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_own_table"), "highscore_own_table"); $highscore_own_table->setValue(1); $highscore_own_table->setChecked($this->object->getHighscoreOwnTable()); $highscore_own_table->setInfo($this->lng->txt("tst_highscore_own_table_description")); $highscore->addSubItem($highscore_own_table); $highscore_top_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_top_table"), "highscore_top_table"); $highscore_top_table->setValue(1); $highscore_top_table->setChecked($this->object->getHighscoreTopTable()); $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_table_description")); $highscore->addSubItem($highscore_top_table); $highscore_top_num = new ilTextInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num"); $highscore_top_num->setSize(4); $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit")); $highscore_top_num->setValue($this->object->getHighscoreTopNum()); $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_num_description")); $highscore->addSubItem($highscore_top_num); if (!$template || $template && $this->formShowKioskSection($template_settings)) { // kiosk mode properties $kioskheader = new ilFormSectionHeaderGUI(); $kioskheader->setTitle($this->lng->txt("kiosk")); $form->addItem($kioskheader); } // kiosk mode $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk"); $kiosk->setValue(1); $kiosk->setChecked($this->object->getKioskMode()); $kiosk->setInfo($this->lng->txt("kiosk_description")); // kiosk mode options $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options"); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', '')); $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', '')); $values = array(); if ($this->object->getShowKioskModeTitle()) { array_push($values, 'kiosk_title'); } if ($this->object->getShowKioskModeParticipant()) { array_push($values, 'kiosk_participant'); } $kiosktitle->setValue($values); $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc")); $kiosk->addSubItem($kiosktitle); $form->addItem($kiosk); if (!$template || $template && $this->formShowParticipantSection($template_settings)) { // participants properties $restrictions = new ilFormSectionHeaderGUI(); $restrictions->setTitle($this->lng->txt("tst_max_allowed_users")); $form->addItem($restrictions); } $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants"); $fixedparticipants->setValue(1); $fixedparticipants->setChecked($this->object->getFixedParticipants()); $fixedparticipants->setOptionTitle($this->lng->txt("tst_allow_fixed_participants")); $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description")); $invited_users = $this->object->getInvitedUsers(); if ($total && count($invited_users) == 0) { $fixedparticipants->setDisabled(true); } $form->addItem($fixedparticipants); // simultaneous users $simul = new ilTextInputGUI($this->lng->txt("tst_allowed_users"), "allowedUsers"); $simul->setSize(3); $simul->setValue($this->object->getAllowedUsers() ? $this->object->getAllowedUsers() : ''); $form->addItem($simul); // idle time $idle = new ilTextInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap"); $idle->setSize(4); $idle->setSuffix($this->lng->txt("seconds")); $idle->setValue($this->object->getAllowedUsersTimeGap() ? $this->object->getAllowedUsersTimeGap() : ''); $form->addItem($idle); // Edit ecs export settings include_once 'Modules/Test/classes/class.ilECSTestSettings.php'; $ecs = new ilECSTestSettings($this->object); $ecs->addSettingsToForm($form, 'tst'); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $form->addCommandButton("saveProperties", $this->lng->txt("save")); } // remove items when using template if ($template_settings) { foreach ($template_settings as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } $errors = false; if ($save) { $errors = !$form->checkInput(); $form->setValuesByPost(); if ($online->getChecked() && !$this->object->isComplete()) { $online->setAlert($this->lng->txt("cannot_switch_to_online_no_questions_andor_no_mark_steps")); ilUtil::sendFailure($this->lng->txt('form_input_not_valid')); $errors = true; } if ($errors) { $checkonly = false; } } if (!$checkonly) { // using template? $message = ""; if ($template) { global $tpl; $link = $this->ctrl->getLinkTarget($this, "confirmResetTemplate"); $link = "<a href=\"" . $link . "\">" . $this->lng->txt("test_using_template_link") . "</a>"; $message = "<div style=\"margin-top:10px\">" . $tpl->getMessageHTML(sprintf($this->lng->txt("test_using_template"), $template->getTitle(), $link), "info") . "</div>"; } $this->tpl->setVariable("ADM_CONTENT", $form->getHTML() . $message); } return $errors; }
/** * @param arEditField $field * * @return ilDateTimeInputGUI */ protected function addDateTimeInputField(arEditField $field) { $date_input = new ilDateTimeInputGUI($this->txt($field->getTxt()), $field->getName()); $date_input->setDate(new ilDate(date('Y-m-d H:i:s'), IL_CAL_DATE)); $date_input->setShowTime(true); return $date_input; }
/** * 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; }
/** * Display and fill the scoring settings form of the test * * @access public */ function scoringObject($checkonly = FALSE) { global $ilAccess; if (!$ilAccess->checkAccess("write", "", $this->ref_id)) { // allow only write access ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true); $this->ctrl->redirect($this, "infoScreen"); } // using template? $template_settings = null; $template = $this->object->getTemplate(); if ($template) { include_once "Services/Administration/classes/class.ilSettingsTemplate.php"; include_once "Modules/Test/classes/class.ilObjAssessmentFolderGUI.php"; $template = new ilSettingsTemplate($template, ilObjAssessmentFolderGUI::getSettingsTemplateConfig()); $template_settings = $template->getSettings(); } $save = strcmp($this->ctrl->getCmd(), "saveScoring") == 0 ? TRUE : FALSE; $total = $this->object->evalTotalPersons(); $this->tpl->addJavascript("./Services/JavaScript/js/Basic.js"); // Determine settings availability $setting_available = true; // In general, the scoring settings are available. if ($total != 0) { $setting_available = false; // Unless there are results from users. } if ($this->object->getScoreReporting() == 4) { $setting_available = true; // But if the results are not public since they will never be } if ($this->object->getScoreReporting() == 3 && $this->object->getReportingDate() > time()) { $setting_available = true; // or the presentation date is not reached, then we can still edit them. } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTableWidth("100%"); $form->setId("test_properties_scoring"); // scoring properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("test_scoring")); $form->addItem($header); // scoring system $count_system = new ilRadioGroupInputGUI($this->lng->txt("tst_text_count_system"), "count_system"); $count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_partial_solutions"), 0, '')); $count_system->addOption(new ilRadioOption($this->lng->txt("tst_count_correct_solutions"), 1, '')); $count_system->setValue($this->object->getCountSystem()); $count_system->setInfo($this->lng->txt("tst_count_system_description")); $count_system->setDisabled(!$setting_available); $form->addItem($count_system); // mc questions $mc_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_score_mcmr_questions"), "mc_scoring"); $mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_zero_points_when_unanswered"), 0, '')); $mc_scoring->addOption(new ilRadioOption($this->lng->txt("tst_score_mcmr_use_scoring_system"), 1, '')); $mc_scoring->setValue($this->object->getMCScoring()); $mc_scoring->setInfo($this->lng->txt("tst_score_mcmr_questions_description")); $mc_scoring->setDisabled(!$setting_available); $form->addItem($mc_scoring); // score cutting $score_cutting = new ilRadioGroupInputGUI($this->lng->txt("tst_score_cutting"), "score_cutting"); $score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_question"), 0, '')); $score_cutting->addOption(new ilRadioOption($this->lng->txt("tst_score_cut_test"), 1, '')); $score_cutting->setValue($this->object->getScoreCutting()); $score_cutting->setInfo($this->lng->txt("tst_score_cutting_description")); $score_cutting->setDisabled(!$setting_available); $form->addItem($score_cutting); // pass scoring $pass_scoring = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_scoring"), "pass_scoring"); $pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_last_pass"), 0, '')); $pass_scoring->addOption(new ilRadioOption($this->lng->txt("tst_pass_best_pass"), 1, '')); $pass_scoring->setValue($this->object->getPassScoring()); $pass_scoring->setInfo($this->lng->txt("tst_pass_scoring_description")); $pass_scoring->setDisabled(!$setting_available); $form->addItem($pass_scoring); // test presentation $header_tp = new ilFormSectionHeaderGUI(); $header_tp->setTitle($this->lng->txt("test_presentation")); $form->addItem($header_tp); // enable obligations $checkBoxEnableObligations = new ilCheckboxInputGUI($this->lng->txt("tst_setting_enable_obligations_label"), "obligations_enabled"); $checkBoxEnableObligations->setChecked($this->object->areObligationsEnabled()); $checkBoxEnableObligations->setInfo($this->lng->txt("tst_setting_enable_obligations_info")); if ($total) { $checkBoxEnableObligations->setDisabled(true); } $form->addItem($checkBoxEnableObligations); // offer hints $checkBoxOfferHints = new ilCheckboxInputGUI($this->lng->txt("tst_setting_offer_hints_label"), "offer_hints"); $checkBoxOfferHints->setChecked($this->object->isOfferingQuestionHintsEnabled()); $checkBoxOfferHints->setInfo($this->lng->txt("tst_setting_offer_hints_info")); if ($total) { $checkBoxOfferHints->setDisabled(true); } $form->addItem($checkBoxOfferHints); // instant feedback $instant_feedback = new ilCheckboxGroupInputGUI($this->lng->txt("tst_instant_feedback"), "instant_feedback"); $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_answer_specific"), 'instant_feedback_specific', '')); $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_answer_generic"), 'instant_feedback_generic', '')); $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_results"), 'instant_feedback_points', '')); $instant_feedback->addOption(new ilCheckboxOption($this->lng->txt("tst_instant_feedback_solution"), 'instant_feedback_solution', '')); $values = array(); if ($this->object->getSpecificAnswerFeedback()) { array_push($values, 'instant_feedback_specific'); } if ($this->object->getGenericAnswerFeedback()) { array_push($values, 'instant_feedback_generic'); } if ($this->object->getAnswerFeedbackPoints()) { array_push($values, 'instant_feedback_points'); } if ($this->object->getInstantFeedbackSolution()) { array_push($values, 'instant_feedback_solution'); } $instant_feedback->setValue($values); $instant_feedback->setInfo($this->lng->txt("tst_instant_feedback_description")); $form->addItem($instant_feedback); // scoring properties $header_tr = new ilFormSectionHeaderGUI(); $header_tr->setTitle($this->lng->txt("test_results")); $form->addItem($header_tr); // access to test results $results_access = new ilRadioGroupInputGUI($this->lng->txt("tst_results_access"), "results_access"); $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_always"), 2, '')); $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_finished"), 1, '')); $results_access_date_limitation = new ilRadioOption($this->lng->txt("tst_results_access_date"), 3, ''); $results_access->addOption($results_access_date_limitation); $results_access->addOption(new ilRadioOption($this->lng->txt("tst_results_access_never"), 4, '')); $results_access->setValue($this->object->getScoreReporting()); $results_access->setInfo($this->lng->txt("tst_results_access_description")); // access date $reporting_date = new ilDateTimeInputGUI('', 'reporting_date'); $reporting_date->setShowDate(true); $reporting_date->setShowTime(true); if (strlen($this->object->getReportingDate())) { $reporting_date->setDate(new ilDateTime($this->object->getReportingDate(), IL_CAL_TIMESTAMP)); } else { $reporting_date->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $results_access_date_limitation->addSubItem($reporting_date); $form->addItem($results_access); $results_print_best_solution = new ilCheckboxInputGUI($this->lng->txt("tst_results_print_best_solution"), "print_bs_with_res"); $results_print_best_solution->setInfo($this->lng->txt('tst_results_print_best_solution_info')); $results_print_best_solution->setValue(1); $results_print_best_solution->setChecked((bool) $this->object->isBestSolutionPrintedWithResult()); $form->addItem($results_print_best_solution); // results presentation $results_presentation = new ilCheckboxGroupInputGUI($this->lng->txt("tst_results_presentation"), "results_presentation"); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_pass_details"), 'pass_details', '')); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_details"), 'solution_details', '')); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_printview"), 'solution_printview', '')); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_compare"), 'solution_compare', '')); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_feedback"), 'solution_feedback', '')); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_answers_only"), 'solution_answers_only', '')); $signatureOption = new ilCheckboxOption($this->lng->txt("tst_show_solution_signature"), 'solution_signature', ''); $results_presentation->addOption($signatureOption); $results_presentation->addOption(new ilCheckboxOption($this->lng->txt("tst_show_solution_suggested"), 'solution_suggested', '')); $values = array(); if ($this->object->getShowPassDetails()) { array_push($values, 'pass_details'); } if ($this->object->getShowSolutionDetails()) { array_push($values, 'solution_details'); } if ($this->object->getShowSolutionPrintview()) { array_push($values, 'solution_printview'); } if ($this->object->getShowSolutionFeedback()) { array_push($values, 'solution_feedback'); } if ($this->object->getShowSolutionAnswersOnly()) { array_push($values, 'solution_answers_only'); } if ($this->object->getShowSolutionSignature()) { array_push($values, 'solution_signature'); } if ($this->object->getShowSolutionSuggested()) { array_push($values, 'solution_suggested'); } if ($this->object->getShowSolutionListComparison()) { array_push($values, 'solution_compare'); } $results_presentation->setValue($values); $results_presentation->setInfo($this->lng->txt("tst_results_presentation_description")); if ($this->object->getAnonymity()) { $signatureOption->setDisabled(true); } $form->addItem($results_presentation); // misc properties $header_misc = new ilFormSectionHeaderGUI(); $header_misc->setTitle($this->lng->txt("misc")); $form->addItem($header_misc); // deletion of test results $passDeletion = new ilRadioGroupInputGUI($this->lng->txt("tst_pass_deletion"), "pass_deletion_allowed"); $passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_not_allowed"), 0, '')); $passDeletion->addOption(new ilRadioOption($this->lng->txt("tst_pass_deletion_allowed"), 1, '')); $passDeletion->setValue($this->object->isPassDeletionAllowed()); $form->addItem($passDeletion); // export settings $export_settings = new ilCheckboxGroupInputGUI($this->lng->txt("tst_export_settings"), "export_settings"); $export_settings->addOption(new ilCheckboxOption($this->lng->txt("tst_exp_sc_short"), 'exp_sc_short', '')); $values = array(); if ($this->object->getExportSettingsSingleChoiceShort()) { array_push($values, 'exp_sc_short'); } $export_settings->setValue($values); $form->addItem($export_settings); if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && $total == 0) { $form->addCommandButton("saveScoring", $this->lng->txt("save")); } if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && $total != 0) { $form->addCommandButton("confirmScoring", $this->lng->txt("save")); } // remove items when using template if ($template_settings) { foreach ($template_settings as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } $errors = false; if ($save) { $errors = !$form->checkInput(); $form->setValuesByPost(); if ($errors) { $checkonly = false; } } if (!$checkonly) { $this->tpl->setVariable("ADM_CONTENT", $form->getHTML()); } return $errors; }
/** * build selection for ending date * * @access protected * @param object tpl * @return */ protected function buildUntilSelection($tpl) { if ($this->isUnlimitedRecurrenceAllowed()) { $tpl->setVariable('TXT_NO_ENDING', $this->lng->txt('cal_no_ending')); } $tpl->setVariable('TXT_UNTIL_CREATE', $this->lng->txt('cal_create')); $tpl->setVariable('TXT_APPOINTMENTS', $this->lng->txt('cal_appointments')); $tpl->setVariable('VAL_COUNT', $this->recurrence->getFrequenceUntilCount() ? $this->recurrence->getFrequenceUntilCount() : 2); if ($this->recurrence->getFrequenceUntilDate()) { $tpl->setVariable('UNTIL_END_CHECKED', 'checked="checked"'); } elseif ($this->recurrence->getFrequenceUntilCount() or !$this->isUnlimitedRecurrenceAllowed()) { $tpl->setVariable('UNTIL_COUNT_CHECKED', 'checked="checked"'); } else { $tpl->setVariable('UNTIL_NO_CHECKED', 'checked="checked"'); } $tpl->setVariable('TXT_UNTIL_END', $this->lng->txt('cal_repeat_until')); $dt = new ilDateTimeInputGUI('', 'until_end'); $dt->setDate($this->recurrence->getFrequenceUntilDate() ? $this->recurrence->getFrequenceUntilDate() : new ilDate(time(), IL_CAL_UNIX)); $tpl->setVariable('UNTIL_END_DATE', $dt->getTableFilterHTML()); }
/** * build selection for ending date * * @access protected * @param object tpl * @return */ protected function buildUntilSelection($tpl) { $tpl->setVariable('TXT_NO_ENDING', $this->lng->txt('cal_no_ending')); $tpl->setVariable('TXT_UNTIL_CREATE', $this->lng->txt('cal_create')); $tpl->setVariable('TXT_APPOINTMENTS', $this->lng->txt('cal_appointments')); if ($this->freq_end instanceof ilDate) { $tpl->setVariable('UNTIL_END_CHECKED', 'checked="checked"'); } else { $tpl->setVariable('UNTIL_NO_CHECKED', 'checked="checked"'); } $tpl->setVariable('TXT_UNTIL_END', $this->lng->txt('cal_repeat_until')); $dt = new ilDateTimeInputGUI('', 'until_end'); $dt->setDate($this->freq_end instanceof ilDate ? $this->freq_end : new ilDate(time(), IL_CAL_UNIX)); $tpl->setVariable('UNTIL_END_DATE', $dt->getTableFilterHTML()); }
private function createDateTimeInput($a_title, $a_postvar, $a_date) { $date_time_input = new ilDateTimeInputGUI($a_title, $a_postvar); if (isset($a_date)) { $date_time_input->setDate(new ilDateTime($a_date, IL_CAL_DATETIME)); } $date_time_input->setMinuteStepSize(5); $date_time_input->setShowTime(true); return $date_time_input; }
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; }
/** * Get input GUI depending on identifier * * @return ilFormPropertyGUI|null */ protected function getInputByIdentifier() { $name = 'default_value'; $title = $this->pl->txt('default_value'); switch ($this->identifier) { case srCertificateTypeSetting::IDENTIFIER_DEFAULT_LANG: $input = new ilSelectInputGUI($title, $name); $options = array(); foreach ($this->type->getLanguages() as $lang) { $options[$lang] = $this->lng->txt("meta_l_{$lang}"); } $input->setOptions($options); $input->setValue($this->setting->getValue()); break; case srCertificateTypeSetting::IDENTIFIER_GENERATION: $input = new ilRadioGroupInputGUI($title, $name); $option = new ilRadioOption($this->pl->txt('setting_generation_auto'), srCertificateTypeSetting::GENERATION_AUTO); $input->addOption($option); $option = new ilRadioOption($this->pl->txt('setting_generation_manually'), srCertificateTypeSetting::GENERATION_MANUAL); $input->addOption($option); $input->setValue($this->setting->getValue()); break; case srCertificateTypeSetting::IDENTIFIER_VALIDITY_TYPE: $input = new ilRadioGroupInputGUI($title, $name); $option = new ilRadioOption($this->pl->txt('always'), srCertificateTypeSetting::VALIDITY_TYPE_ALWAYS); $input->addOption($option); $option = new ilRadioOption($this->pl->txt('setting_validity_range'), srCertificateTypeSetting::VALIDITY_TYPE_DATE_RANGE); $input->addOption($option); $option = new ilRadioOption($this->pl->txt('setting_validity_date'), srCertificateTypeSetting::VALIDITY_TYPE_DATE); $input->addOption($option); $input->setValue($this->setting->getValue()); break; case srCertificateTypeSetting::IDENTIFIER_VALIDITY: $validity_value = $this->setting->getValue(); switch ($this->type->getSettingByIdentifier(srCertificateTypeSetting::IDENTIFIER_VALIDITY_TYPE)->getValue()) { case srCertificateTypeSetting::VALIDITY_TYPE_DATE_RANGE: $input = new ilDurationInputGUI($title, $name); $input->setShowMinutes(false); $input->setShowHours(false); $input->setShowDays(true); $input->setShowMonths(true); if ($validity_value) { $range_array = json_decode($validity_value, true); $data = array(); $data[$input->getPostVar()]['MM'] = $range_array['m']; $data[$input->getPostVar()]['dd'] = $range_array['d']; $input->setValueByArray($data); } break; case srCertificateTypeSetting::VALIDITY_TYPE_DATE: $input = new ilDateTimeInputGUI($title, $name); $input->setMode(ilDateTimeInputGUI::MODE_INPUT); if ($validity_value) { $input->setDate(new ilDateTime($validity_value, IL_CAL_DATE)); } break; case srCertificateTypeSetting::VALIDITY_TYPE_ALWAYS: // Makes no sence to configure this further $input = null; break; default: $input = new ilTextInputGUI($title, $name); } break; case srCertificateTypeSetting::IDENTIFIER_DOWNLOADABLE: case srCertificateTypeSetting::IDENTIFIER_SCORM_TIMING: case srCertificateTypeSetting::IDENTIFIER_NOTIFICATION_USER: $input = new ilCheckboxInputGUI($title, $name); if ($this->setting->getValue()) { $input->setChecked(true); } break; default: $input = new ilTextInputGUI($title, $name); $input->setValue($this->setting->getValue()); } return $input; }
/** * display assessment folder logs form */ public function logsObject($p_from = null, $p_until = null, $p_test = null) { global $ilTabs; $ilTabs->activateTab('logs'); $template = new ilTemplate("tpl.assessment_logs.html", TRUE, TRUE, "Modules/Test"); include_once "./Modules/Test/classes/class.ilObjTest.php"; include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php"; $available_tests =& ilObjTest::_getAvailableTests(1); if (count($available_tests) == 0) { ilUtil::sendInfo($this->lng->txt('assessment_log_no_data')); return; } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTableWidth("100%"); $form->setId("logs"); $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("assessment_log")); $form->addItem($header); // from $from = new ilDateTimeInputGUI($this->lng->txt('cal_from'), "log_from"); $from->setShowTime(true); $now = getdate(); $fromdate = $p_from ? $p_from : ($_GET['log_from'] ? $_GET['log_from'] : mktime(0, 0, 0, 1, 1, $now['year'])); $from->setDate(new ilDateTime($fromdate, IL_CAL_UNIX)); $form->addItem($from); // until $until = new ilDateTimeInputGUI($this->lng->txt('cal_until'), "log_until"); $until->setShowTime(true); $untildate = $p_until ? $p_until : ($_GET['log_until'] ? $_GET['log_until'] : time()); $until->setDate(new ilDateTime($untildate, IL_CAL_UNIX)); $form->addItem($until); // tests $fortest = new ilSelectInputGUI($this->lng->txt('assessment_log_for_test'), "sel_test"); $sorted_options = array(); foreach ($available_tests as $key => $value) { $sorted_options[] = array('title' => ilUtil::prepareFormOutput($value) . " [" . $this->object->getNrOfLogEntries($key) . " " . $this->lng->txt("assessment_log_log_entries") . "]", 'key' => $key); } $sorted_options = ilUtil::sortArray($sorted_options, 'title', 'asc'); $options = array(); foreach ($sorted_options as $option) { $options[$option['key']] = $option['title']; } $fortest->setOptions($options); $p_test = $p_test ? $p_test : $_GET['sel_test']; if ($p_test) { $fortest->setValue($p_test); } $form->addItem($fortest); $this->ctrl->setParameter($this, 'sel_test', $p_test); $this->ctrl->setParameter($this, 'log_until', $untildate); $this->ctrl->setParameter($this, 'log_from', $fromdate); $form->addCommandButton("showLog", $this->lng->txt("show")); $form->addCommandButton("exportLog", $this->lng->txt("export")); $template->setVariable("FORM", $form->getHTML()); if ($p_test) { include_once "./Modules/Test/classes/tables/class.ilAssessmentFolderLogTableGUI.php"; $table_gui = new ilAssessmentFolderLogTableGUI($this, 'logs'); $log_output =& $this->object->getLog($fromdate, $untildate, $p_test); $table_gui->setData($log_output); $template->setVariable('LOG', $table_gui->getHTML()); } $this->tpl->setVariable("ADM_CONTENT", $template->get()); }
/** * @param ilPropertyFormGUI $form */ private function addTestAccessProperties(ilPropertyFormGUI $form) { $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("tst_settings_header_execution")); $form->addItem($header); // enable starting time $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("tst_starting_time"), "chb_starting_time"); $enablestartingtime->setInfo($this->lng->txt("tst_starting_time_desc")); $enablestartingtime->setChecked($this->testOBJ->isStartingTimeEnabled()); // starting time $startingtime = new ilDateTimeInputGUI('', 'starting_time'); $startingtime->setShowTime(true); if (strlen($this->testOBJ->getStartingTime())) { $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_TIMESTAMP)); } else { $startingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $enablestartingtime->addSubItem($startingtime); $form->addItem($enablestartingtime); if ($this->testOBJ->participantDataExist()) { $enablestartingtime->setDisabled(true); $startingtime->setDisabled(true); } // enable ending time $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("tst_ending_time"), "chb_ending_time"); $enableendingtime->setInfo($this->lng->txt("tst_ending_time_desc")); $enableendingtime->setChecked($this->testOBJ->isEndingTimeEnabled()); // ending time $endingtime = new ilDateTimeInputGUI('', 'ending_time'); $endingtime->setShowTime(true); if (strlen($this->testOBJ->getEndingTime())) { $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_TIMESTAMP)); } else { $endingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $enableendingtime->addSubItem($endingtime); $form->addItem($enableendingtime); // test password $pwEnabled = new ilCheckboxInputGUI($this->lng->txt('tst_password'), 'password_enabled'); $pwEnabled->setChecked($this->testOBJ->isPasswordEnabled()); $pwEnabled->setInfo($this->lng->txt("tst_password_details")); $password = new ilTextInputGUI($this->lng->txt("tst_password_enter"), "password"); $password->setRequired(true); $password->setSize(20); $password->setValue($this->testOBJ->getPassword()); $pwEnabled->addSubItem($password); $form->addItem($pwEnabled); // fixed participants $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants"); $fixedparticipants->setValue(1); $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants()); $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description")); $invited_users = $this->testOBJ->getInvitedUsers(); if ($this->testOBJ->participantDataExist() && count($invited_users) == 0) { $fixedparticipants->setDisabled(true); } $form->addItem($fixedparticipants); // simultaneous users $simulLimited = new ilCheckboxInputGUI($this->lng->txt("tst_allowed_users"), 'limitUsers'); $simulLimited->setInfo($this->lng->txt("tst_allowed_users_desc")); $simulLimited->setChecked($this->testOBJ->isLimitUsersEnabled()); // allowed simultaneous users $simul = new ilNumberInputGUI($this->lng->txt("tst_allowed_users_max"), "allowedUsers"); $simul->setRequired(true); $simul->allowDecimals(false); $simul->setMinValue(1); $simul->setMinvalueShouldBeGreater(false); $simul->setSize(4); $simul->setValue($this->testOBJ->getAllowedUsers() ? $this->testOBJ->getAllowedUsers() : ''); $simulLimited->addSubItem($simul); // idle time $idle = new ilNumberInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap"); $idle->setInfo($this->lng->txt("tst_allowed_users_time_gap_desc")); $idle->setSize(4); $idle->setSuffix($this->lng->txt("seconds")); $idle->setValue($this->testOBJ->getAllowedUsersTimeGap() ? $this->testOBJ->getAllowedUsersTimeGap() : 300); $simulLimited->addSubItem($idle); $form->addItem($simulLimited); return $header; }
public function initCreateForm($item) { global $ilUser; $settings = ilAdobeConnectServer::_getInstance(); //Login User - this creates a user if he not exists. if ($settings->getAuthMode() == ilAdobeConnectServer::AUTH_MODE_SWITCHAAI) { $this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php'); $ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId()); $ilAdobeConnectUser->loginUser(); } $this->pluginObj->includeClass('class.ilObjAdobeConnect.php'); if (isset($_POST['tpl_id']) && (int) $_POST['tpl_id'] > 0) { $item['id'] = $_POST['tpl_id']; } $template_settings = array(); if ($item['id']) { include_once "Services/Administration/classes/class.ilSettingsTemplate.php"; $template = new ilSettingsTemplate($item['id']); $template_settings = $template->getSettings(); } $form = new ilPropertyFormGUI(); $form->setTitle($this->pluginObj->txt($item['title'])); // login to ac-server $this->pluginObj->includeClass('class.ilAdobeConnectServer.php'); // title $title = new ilTextInputGUI($this->pluginObj->txt("title"), "title"); $title->setRequired(true); // description $description = new ilTextAreaInputGUI($this->pluginObj->txt("description"), "desc"); // contact_info_val $civ = array(); if ($ilUser->getPref('public_profile') == "y") { if ($ilUser->getPref('public_title')) { $civ_title = $ilUser->getUTitle() . ' '; } $civ[] = $civ_title . $ilUser->getFirstname() . ' ' . $ilUser->getLastname(); if ($ilUser->getPref('public_email')) { $civ[] = $ilUser->getEmail(); } if ($ilUser->getPref('public_phone_office') && strlen($ilUser->getPhoneOffice()) > 1) { $civ[] = $this->pluginObj->txt('office') . ': ' . $ilUser->getPhoneOffice(); } if ($ilUser->getPref('public_phone_mobile') && strlen($ilUser->getPhoneMobile()) > 1) { $civ[] = $this->pluginObj->txt('mobile') . ': ' . $ilUser->getPhoneMobile(); } } $contact_info_value = implode(', ', $civ); // owner $owner = new ilTextInputGUI($this->lng->txt("owner"), "owner"); $owner->setInfo($this->pluginObj->txt('owner_info')); $owner->setValue(ilObjUser::_lookupLogin($ilUser->getId())); $radio_time_type = new ilRadioGroupInputGUI($this->pluginObj->txt('time_type_selection'), 'time_type_selection'); // option: permanent room if (ilAdobeConnectServer::getSetting('enable_perm_room', '1')) { $permanent_room = new ilRadioOption($this->pluginObj->txt('permanent_room'), 'permanent_room'); $permanent_room->setInfo($this->pluginObj->txt('permanent_room_info')); $radio_time_type->addOption($permanent_room); $radio_time_type->setValue('permanent_room'); } // option: date selection $opt_date = new ilRadioOption($this->pluginObj->txt('start_date'), 'date_selection'); if ($template_settings['start_date']['hide'] == '0') { // start date $sd = new ilDateTimeInputGUI($this->pluginObj->txt("start_date"), "start_date"); $serverConfig = ilAdobeConnectServer::_getInstance(); $now = strtotime('+3 minutes'); $minTime = new ilDateTime($now + $serverConfig->getScheduleLeadTime() * 60 * 60, IL_CAL_UNIX); $sd->setDate($minTime); $sd->setShowTime(true); $sd->setRequired(true); $opt_date->addSubItem($sd); } if ($template_settings['duration']['hide'] == '0') { $duration = new ilDurationInputGUI($this->pluginObj->txt("duration"), "duration"); $duration->setRequired(true); $duration->setHours('2'); $opt_date->addSubItem($duration); } $radio_time_type->addOption($opt_date); $radio_time_type->setRequired(true); if (!ilAdobeConnectServer::getSetting('enable_perm_room', '1')) { $radio_time_type->setValue('date_selection'); } // access-level of the meeting room $radio_access_level = new ilRadioGroupInputGUI($this->pluginObj->txt('access'), 'access_level'); $opt_private = new ilRadioOption($this->pluginObj->txt('private_room'), ilObjAdobeConnect::ACCESS_LEVEL_PRIVATE); $opt_protected = new ilRadioOption($this->pluginObj->txt('protected_room'), ilObjAdobeConnect::ACCESS_LEVEL_PROTECTED); $opt_public = new ilRadioOption($this->pluginObj->txt('public_room'), ilObjAdobeConnect::ACCESS_LEVEL_PUBLIC); $radio_access_level->addOption($opt_private); $radio_access_level->addOption($opt_protected); $radio_access_level->addOption($opt_public); $radio_access_level->setValue(ilObjAdobeConnect::ACCESS_LEVEL_PROTECTED); $this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php'); $ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId()); $ilAdobeConnectUser->ensureAccountExistance(); $xavc_login = $ilAdobeConnectUser->getXAVCLogin(); $folder_id = $ilAdobeConnectUser->ensureUserFolderExistance($xavc_login); if ($template_settings['reuse_existing_rooms']['hide'] == '0') { $all_scos = (array) ilObjAdobeConnect::getScosByFolderId($folder_id); $local_scos = (array) ilObjAdobeConnect::getLocalScos(); $free_scos = array(); if ($all_scos) { foreach ($all_scos as $sco) { $sco_ids[] = $sco['sco_id']; } $free_scos = array_diff($sco_ids, $local_scos); } if (!$free_scos) { $hidden_creation_type = new ilHiddenInputGUI('creation_type'); $hidden_creation_type->setValue('new_vc'); $form->addItem($hidden_creation_type); $advanced_form_item = $form; $afi_add_method = 'addItem'; } else { $radio_grp = new ilRadioGroupInputGUI($this->pluginObj->txt('choose_creation_type'), 'creation_type'); $radio_grp->setRequired(true); $radio_new = new ilRadioOption($this->pluginObj->txt('create_new'), 'new_vc'); $radio_existing = new ilRadioOption($this->pluginObj->txt('select_existing'), 'existing_vc'); $radio_grp->setValue('new_vc'); $radio_grp->addOption($radio_new); $advanced_form_item = $radio_new; $afi_add_method = 'addSubItem'; } $advanced_form_item->{$afi_add_method}($title); $advanced_form_item->{$afi_add_method}($description); $contact_info = new ilTextAreaInputGUI($this->pluginObj->txt("contact_information"), "contact_info"); $contact_info->setRows(self::CREATION_FORM_TA_ROWS); $contact_info->setValue($contact_info_value); $advanced_form_item->{$afi_add_method}($contact_info); $instructions = new ilTextAreaInputGUI($this->lng->txt('exc_instruction'), 'instructions'); $instructions->setRows(self::CREATION_FORM_TA_ROWS); $advanced_form_item->{$afi_add_method}($instructions); if ($template_settings['access_level']['hide'] == 0) { $advanced_form_item->{$afi_add_method}($radio_access_level); } $advanced_form_item->{$afi_add_method}($radio_time_type); $advanced_form_item->{$afi_add_method}($owner); if ($free_scos && $radio_existing) { $radio_existing = new ilRadioOption($this->pluginObj->txt('select_existing'), 'existing_vc'); $radio_grp->addOption($radio_existing); $form->addItem($radio_grp); foreach ($free_scos as $fs) { $options[$fs] = $all_scos[$fs]['sco_name']; } $available_rooms = new ilSelectInputGUI($this->pluginObj->txt('available_rooms'), 'available_rooms'); $available_rooms->setOptions($options); $available_rooms->setInfo($this->pluginObj->txt('choose_existing_room')); $radio_existing->addSubItem($available_rooms); $instructions_3 = new ilTextAreaInputGUI($this->lng->txt('exc_instruction'), 'instructions_3'); $instructions_3->setRows(self::CREATION_FORM_TA_ROWS); $radio_existing->addSubItem($instructions_3); $contact_info_3 = new ilTextAreaInputGUI($this->pluginObj->txt("contact_information"), "contact_info_3"); $contact_info_3->setValue($contact_info_value); $contact_info_3->setRows(self::CREATION_FORM_TA_ROWS); $radio_existing->addSubItem($contact_info_3); } else { //$info = new ilNonEditableValueGUI($this->pluginObj->txt('no_available_rooms')); //$radio_existing->addSubItem($info); } } else { $form->addItem($title); $form->addItem($description); $contact_info_2 = new ilTextAreaInputGUI($this->pluginObj->txt("contact_information"), "contact_info_2"); $contact_info_2->setRows(self::CREATION_FORM_TA_ROWS); $contact_info_2->setValue($contact_info_value); $form->addItem($contact_info_2); if ($template_settings['access_level']['hide'] == 0) { $form->addItem($radio_access_level); } $instructions_2 = new ilTextAreaInputGUI($this->lng->txt('exc_instruction'), 'instructions_2'); $instructions_2->setRows(self::CREATION_FORM_TA_ROWS); $form->addItem($instructions_2); if (ilAdobeConnectServer::getSetting('default_perm_room') && ilAdobeConnectServer::getSetting('enable_perm_room', '1')) { $info_text = $this->pluginObj->txt('smpl_permanent_room_enabled'); } else { $time = date('H:i', strtotime('+2 hours')); $info_text = sprintf($this->pluginObj->txt('smpl_permanent_room_disabled'), $time); } $info = new ilNonEditableValueGUI($this->lng->txt('info'), 'info_text'); $info->setValue($info_text); $form->addItem($info); } $tpl_id = new ilHiddenInputGUI('tpl_id'); $tpl_id->setValue($item['id']); $form->addItem($tpl_id); $form->addCommandButton("save", $this->pluginObj->txt($this->getType() . "_add")); $form->addCommandButton("cancelCreation", $this->lng->txt("cancel")); $form->setFormAction($this->ctrl->getFormAction($this)); return $form; }
/** * 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(); }
/** * Generate and set date time input field * * @param string $a_title * @param string $a_postvar * @param string $a_date in the format YYYY-MM-DD HH:MM:SS * * @return \ilDateTimeInputGUI */ private function createAndSetDateTimeInput($a_title, $a_postvar, $a_date) { $date_time_input = new ilDateTimeInputGUI($a_title, $a_postvar); if (isset($a_date)) { $date_time_input->setDate(new ilDateTime($a_date, IL_CAL_DATETIME)); } $date_time_input->setMinuteStepSize(5); $date_time_input->setShowTime(true); if ($this->mode == 'show') { $date_time_input->setDisabled(true); } return $date_time_input; }
private function addResultSettingsFormSection(ilPropertyFormGUI $form) { // HEADER: result settings $header_tr = new ilFormSectionHeaderGUI(); $header_tr->setTitle($this->lng->txt('test_results')); $form->addItem($header_tr); // access to test results $resultsAccessEnabled = new ilCheckboxInputGUI($this->lng->txt('tst_results_access_enabled'), 'results_access_enabled'); $resultsAccessEnabled->setInfo($this->lng->txt('tst_results_access_enabled_desc')); $resultsAccessEnabled->setChecked($this->testOBJ->isScoreReportingEnabled()); $resultsAccessSetting = new ilRadioGroupInputGUI($this->lng->txt('tst_results_access_setting'), 'results_access_setting'); $resultsAccessSetting->setRequired(true); $optAlways = new ilRadioOption($this->lng->txt('tst_results_access_always'), 2, ''); $optAlways->setInfo($this->lng->txt('tst_results_access_always_desc')); $resultsAccessSetting->addOption($optAlways); $optFinished = $opt = new ilRadioOption($this->lng->txt('tst_results_access_finished'), 1, ''); $optFinished->setInfo($this->lng->txt('tst_results_access_finished_desc')); $resultsAccessSetting->addOption($optFinished); $optionDate = new ilRadioOption($this->lng->txt('tst_results_access_date'), 3, ''); $optionDate->setInfo($this->lng->txt('tst_results_access_date_desc')); // access date $reportingDate = new ilDateTimeInputGUI($this->lng->txt('tst_reporting_date'), 'reporting_date'); $reportingDate->setShowTime(true); if (strlen($this->testOBJ->getReportingDate())) { $reportingDate->setDate(new ilDateTime($this->testOBJ->getReportingDate(), IL_CAL_TIMESTAMP)); } else { $reportingDate->setDate(new ilDateTime(time(), IL_CAL_UNIX)); } $optionDate->addSubItem($reportingDate); $resultsAccessSetting->addOption($optionDate); $resultsAccessValue = $this->testOBJ->getScoreReporting(); $resultsAccessSetting->setValue($resultsAccessValue > 0 && $resultsAccessValue < 4 ? $resultsAccessValue : 2); $resultsAccessEnabled->addSubItem($resultsAccessSetting); // show pass details $showPassDetails = new ilCheckboxInputGUI($this->lng->txt('tst_show_pass_details'), 'pass_details'); $showPassDetails->setInfo($this->lng->txt('tst_show_pass_details_desc')); $showPassDetails->setChecked($this->testOBJ->getShowPassDetails()); $resultsAccessEnabled->addSubItem($showPassDetails); $form->addItem($resultsAccessEnabled); // grading $chb_only_passed_failed = new ilCheckboxInputGUI($this->lng->txt('tst_results_grading_opt_show_status'), 'grading_status'); $chb_only_passed_failed->setInfo($this->lng->txt('tst_results_grading_opt_show_status_desc')); $chb_only_passed_failed->setValue(1); $chb_only_passed_failed->setChecked($this->testOBJ->isShowGradingStatusEnabled()); $form->addItem($chb_only_passed_failed); $chb_resulting_mark_only = new ilCheckboxInputGUI($this->lng->txt('tst_results_grading_opt_show_mark'), 'grading_mark'); $chb_resulting_mark_only->setInfo($this->lng->txt('tst_results_grading_opt_show_mark_desc')); $chb_resulting_mark_only->setValue(1); $chb_resulting_mark_only->setChecked($this->testOBJ->isShowGradingMarkEnabled()); $form->addItem($chb_resulting_mark_only); }
/** * Init survey settings form * * @return ilPropertyFormGUI */ function initPropertiesForm() { $template_settings = $hide_rte_switch = null; $template = $this->object->getTemplate(); if ($template) { include_once "Services/Administration/classes/class.ilSettingsTemplate.php"; $template = new ilSettingsTemplate($template); $template_settings = $template->getSettings(); $hide_rte_switch = $template_settings["rte_switch"]["hide"]; } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $form->setTableWidth("100%"); $form->setId("survey_properties"); // general properties $header = new ilFormSectionHeaderGUI(); $header->setTitle($this->lng->txt("settings")); $form->addItem($header); // title & description (meta data) include_once 'Services/MetaData/classes/class.ilMD.php'; $md_obj = new ilMD($this->object->getId(), 0, "svy"); $md_section = $md_obj->getGeneral(); $title = new ilTextInputGUI($this->lng->txt("title"), "title"); $title->setRequired(true); $title->setValue($md_section->getTitle()); $form->addItem($title); $ids = $md_section->getDescriptionIds(); if ($ids) { $desc_obj = $md_section->getDescription(array_pop($ids)); $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description"); $desc->setCols(50); $desc->setRows(4); $desc->setValue($desc_obj->getDescription()); $form->addItem($desc); } // pool usage $pool_usage = new ilRadioGroupInputGUI($this->lng->txt("survey_question_pool_usage"), "use_pool"); $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_active"), 1); $opt->setInfo($this->lng->txt("survey_question_pool_usage_active_info")); $pool_usage->addOption($opt); $opt = new ilRadioOption($this->lng->txt("survey_question_pool_usage_inactive"), 0); $opt->setInfo($this->lng->txt("survey_question_pool_usage_inactive_info")); $pool_usage->addOption($opt); $pool_usage->setValue($this->object->getPoolUsage()); $form->addItem($pool_usage); // 360°: appraisees if ($this->object->get360Mode()) { $self_eval = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_evaluation"), "self_eval"); $self_eval->setInfo($this->lng->txt("survey_360_self_evaluation_info")); $self_eval->setChecked($this->object->get360SelfEvaluation()); $form->addItem($self_eval); $self_rate = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_raters"), "self_rate"); $self_rate->setInfo($this->lng->txt("survey_360_self_raters_info")); $self_rate->setChecked($this->object->get360SelfRaters()); $form->addItem($self_rate); $self_appr = new ilCheckboxInputGUI($this->lng->txt("survey_360_self_appraisee"), "self_appr"); $self_appr->setInfo($this->lng->txt("survey_360_self_appraisee_info")); $self_appr->setChecked($this->object->get360SelfAppraisee()); $form->addItem($self_appr); } // activation include_once "Services/Object/classes/class.ilObjectActivation.php"; $this->lng->loadLanguageModule('rep'); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('rep_activation_availability')); $form->addItem($section); // additional info only with multiple references $act_obj_info = $act_ref_info = ""; if (sizeof(ilObject::_getAllReferences($this->object->getId())) > 1) { $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info'); $act_ref_info = $this->lng->txt('rep_activation_access_ref_info'); } $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online'); $online->setInfo($this->lng->txt('svy_activation_online_info') . $act_obj_info); $online->setChecked($this->object->isOnline()); $form->addItem($online); $act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type'); // $act_type->setInfo($this->lng->txt('svy_availability_until_info')); $act_type->setChecked($this->object->isActivationLimited()); $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); $date = $this->object->getActivationStartDate(); $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX)); $dur->setStartText($this->lng->txt('rep_activation_limited_start')); $date = $this->object->getActivationEndDate(); $dur->setEnd(new ilDateTime($date ? $date : time(), 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'), 'access_visiblity'); $visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info')); $visible->setChecked($this->object->getActivationVisibility()); $act_type->addSubItem($visible); $form->addItem($act_type); // before start $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_before_start')); $form->addItem($section); // introduction $intro = new ilTextAreaInputGUI($this->lng->txt("introduction"), "introduction"); $intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction())); $intro->setRows(10); $intro->setCols(80); $intro->setUseRte(TRUE); $intro->setInfo($this->lng->txt("survey_introduction_info")); include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey")); $intro->addPlugin("latex"); $intro->addButton("latex"); $intro->addButton("pastelatex"); $intro->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch); $form->addItem($intro); // access $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_access')); $form->addItem($section); // enable start date $start = $this->object->getStartDate(); $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("start_date"), "enabled_start_date"); $enablestartingtime->setValue(1); // $enablestartingtime->setOptionTitle($this->lng->txt("enabled")); $enablestartingtime->setChecked($start); // start date $startingtime = new ilDateTimeInputGUI('', 'start_date'); $startingtime->setShowTime(true); if ($start) { $startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP)); } $enablestartingtime->addSubItem($startingtime); $form->addItem($enablestartingtime); // enable end date $end = $this->object->getEndDate(); $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("end_date"), "enabled_end_date"); $enableendingtime->setValue(1); // $enableendingtime->setOptionTitle($this->lng->txt("enabled")); $enableendingtime->setChecked($end); // end date $endingtime = new ilDateTimeInputGUI('', 'end_date'); $endingtime->setShowTime(true); if ($end) { $endingtime->setDate(new ilDate($end, IL_CAL_TIMESTAMP)); } $enableendingtime->addSubItem($endingtime); $form->addItem($enableendingtime); // anonymization if (!$this->object->get360Mode()) { $codes = new ilCheckboxInputGUI($this->lng->txt("survey_access_codes"), "acc_codes"); $codes->setInfo($this->lng->txt("survey_access_codes_info")); $codes->setChecked(!$this->object->isAccessibleWithoutCode()); $form->addItem($codes); if ($this->object->_hasDatasets($this->object->getSurveyId())) { $codes->setDisabled(true); } } // question behaviour $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('svy_settings_section_question_behaviour')); $form->addItem($section); // show question titles $show_question_titles = new ilCheckboxInputGUI($this->lng->txt("svy_show_questiontitles"), "show_question_titles"); $show_question_titles->setValue(1); $show_question_titles->setChecked($this->object->getShowQuestionTitles()); $form->addItem($show_question_titles); // finishing $info = new ilFormSectionHeaderGUI(); $info->setTitle($this->lng->txt("svy_settings_section_finishing")); $form->addItem($info); $view_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_view_own"), "view_own"); $view_own->setInfo($this->lng->txt("svy_results_view_own_info")); $view_own->setChecked($this->object->hasViewOwnResults()); $form->addItem($view_own); $mail_own = new ilCheckboxInputGUI($this->lng->txt("svy_results_mail_own"), "mail_own"); $mail_own->setInfo($this->lng->txt("svy_results_mail_own_info")); $mail_own->setChecked($this->object->hasMailOwnResults()); $form->addItem($mail_own); // final statement $finalstatement = new ilTextAreaInputGUI($this->lng->txt("outro"), "outro"); $finalstatement->setValue($this->object->prepareTextareaOutput($this->object->getOutro())); $finalstatement->setRows(10); $finalstatement->setCols(80); $finalstatement->setUseRte(TRUE); $finalstatement->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey")); $finalstatement->addPlugin("latex"); $finalstatement->addButton("latex"); $finalstatement->addButton("pastelatex"); $finalstatement->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch); $form->addItem($finalstatement); // mail notification $mailnotification = new ilCheckboxInputGUI($this->lng->txt("mailnotification"), "mailnotification"); // $mailnotification->setOptionTitle($this->lng->txt("activate")); $mailnotification->setInfo($this->lng->txt("svy_result_mail_notification_info")); // #11762 $mailnotification->setValue(1); $mailnotification->setChecked($this->object->getMailNotification()); // addresses $mailaddresses = new ilTextInputGUI($this->lng->txt("mailaddresses"), "mailaddresses"); $mailaddresses->setValue($this->object->getMailAddresses()); $mailaddresses->setSize(80); $mailaddresses->setInfo($this->lng->txt('mailaddresses_info')); $mailaddresses->setRequired(true); // participant data $participantdata = new ilTextAreaInputGUI($this->lng->txt("mailparticipantdata"), "mailparticipantdata"); $participantdata->setValue($this->object->getMailParticipantData()); $participantdata->setRows(6); $participantdata->setCols(80); $participantdata->setUseRte(false); $participantdata->setInfo($this->lng->txt("mailparticipantdata_info")); // #12755 - because of privacy concerns we restrict user data to a minimum $placeholders = array("FIRST_NAME" => "firstname", "LAST_NAME" => "lastname", "LOGIN" => "login"); $txt = array(); foreach ($placeholders as $placeholder => $caption) { $txt[] = "[" . strtoupper($placeholder) . "]: " . $this->lng->txt($caption); } $txt = implode("<br />", $txt); $participantdatainfo = new ilNonEditableValueGUI($this->lng->txt("mailparticipantdata_placeholder"), "", true); $participantdatainfo->setValue($txt); $mailnotification->addSubItem($mailaddresses); $mailnotification->addSubItem($participantdata); $mailnotification->addSubItem($participantdatainfo); $form->addItem($mailnotification); // tutor notification - currently not available for 360° if (!$this->object->get360Mode()) { // parent course? global $tree; $has_parent = $tree->checkForParentType($this->object->getRefId(), "grp"); if (!$has_parent) { $has_parent = $tree->checkForParentType($this->object->getRefId(), "crs"); } $num_inv = sizeof($this->object->getInvitedUsers()); // notification $tut = new ilCheckboxInputGUI($this->lng->txt("survey_notification_tutor_setting"), "tut"); $tut->setChecked($this->object->getTutorNotificationStatus()); $form->addItem($tut); $tut_logins = array(); $tuts = $this->object->getTutorNotificationRecipients(); if ($tuts) { foreach ($tuts as $tut_id) { $tmp = ilObjUser::_lookupName($tut_id); if ($tmp["login"]) { $tut_logins[] = $tmp["login"]; } } } $tut_ids = new ilTextInputGUI($this->lng->txt("survey_notification_tutor_recipients"), "tut_ids"); $tut_ids->setDataSource($this->ctrl->getLinkTarget($this, "doAutoComplete", "", true)); $tut_ids->setRequired(true); $tut_ids->setMulti(true); $tut_ids->setMultiValues($tut_logins); $tut_ids->setValue(array_shift($tut_logins)); $tut->addSubItem($tut_ids); $tut_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "tut_grp"); $tut_grp->setRequired(true); $tut_grp->setValue($this->object->getTutorNotificationTarget()); $tut->addSubItem($tut_grp); $tut_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE); if (!$has_parent) { $tut_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive")); } $tut_grp->addOption($tut_grp_crs); $tut_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS); $tut_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv)); $tut_grp->addOption($tut_grp_inv); } // reminders // reminder - currently not available for 360° if (!$this->object->get360Mode()) { $info = new ilFormSectionHeaderGUI(); $info->setTitle($this->lng->txt("svy_settings_section_reminders")); $form->addItem($info); $rmd = new ilCheckboxInputGUI($this->lng->txt("survey_reminder_setting"), "rmd"); $rmd->setChecked($this->object->getReminderStatus()); $form->addItem($rmd); $rmd_start = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_start"), "rmd_start"); $rmd_start->setRequired(true); $start = $this->object->getReminderStart(); if ($start) { $rmd_start->setDate($start); } $rmd->addSubItem($rmd_start); $end = $this->object->getReminderEnd(); $rmd_end = new ilDateTimeInputGUI($this->lng->txt("survey_reminder_end"), "rmd_end"); $rmd_end->enableDateActivation("", "rmd_end_tgl", (bool) $end); if ($end) { $rmd_end->setDate($end); } $rmd->addSubItem($rmd_end); $rmd_freq = new ilNumberInputGUI($this->lng->txt("survey_reminder_frequency"), "rmd_freq"); $rmd_freq->setRequired(true); $rmd_freq->setSize(3); $rmd_freq->setSuffix($this->lng->txt("survey_reminder_frequency_days")); $rmd_freq->setValue($this->object->getReminderFrequency()); $rmd_freq->setMinValue(1); $rmd->addSubItem($rmd_freq); $rmd_grp = new ilRadioGroupInputGUI($this->lng->txt("survey_notification_target_group"), "rmd_grp"); $rmd_grp->setRequired(true); $rmd_grp->setValue($this->object->getReminderTarget()); $rmd->addSubItem($rmd_grp); $rmd_grp_crs = new ilRadioOption($this->lng->txt("survey_notification_target_group_parent_course"), ilObjSurvey::NOTIFICATION_PARENT_COURSE); if (!$has_parent) { $rmd_grp_crs->setInfo($this->lng->txt("survey_notification_target_group_parent_course_inactive")); } $rmd_grp->addOption($rmd_grp_crs); $rmd_grp_inv = new ilRadioOption($this->lng->txt("survey_notification_target_group_invited"), ilObjSurvey::NOTIFICATION_INVITED_USERS); $rmd_grp_inv->setInfo(sprintf($this->lng->txt("survey_notification_target_group_invited_info"), $num_inv)); $rmd_grp->addOption($rmd_grp_inv); } // results $results = new ilFormSectionHeaderGUI(); $results->setTitle($this->lng->txt("results")); $form->addItem($results); // evaluation access if (!$this->object->get360Mode()) { $evaluation_access = new ilRadioGroupInputGUI($this->lng->txt('evaluation_access'), "evaluation_access"); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_off"), ilObjSurvey::EVALUATION_ACCESS_OFF, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_off_info")); $evaluation_access->addOption($option); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_all"), ilObjSurvey::EVALUATION_ACCESS_ALL, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_all_info")); $evaluation_access->addOption($option); $option = new ilCheckboxOption($this->lng->txt("evaluation_access_participants"), ilObjSurvey::EVALUATION_ACCESS_PARTICIPANTS, ''); $option->setInfo($this->lng->txt("svy_evaluation_access_participants_info")); $evaluation_access->addOption($option); $evaluation_access->setValue($this->object->getEvaluationAccess()); $form->addItem($evaluation_access); $anonymization_options = new ilRadioGroupInputGUI($this->lng->txt("survey_results_anonymization"), "anonymization_options"); $option = new ilCheckboxOption($this->lng->txt("survey_results_personalized"), "statpers"); $option->setInfo($this->lng->txt("survey_results_personalized_info")); $anonymization_options->addOption($option); $option = new ilCheckboxOption($this->lng->txt("survey_results_anonymized"), "statanon"); $option->setInfo($this->lng->txt("survey_results_anonymized_info")); $anonymization_options->addOption($option); $anonymization_options->setValue($this->object->hasAnonymizedResults() ? "statanon" : "statpers"); $form->addItem($anonymization_options); if ($this->object->_hasDatasets($this->object->getSurveyId())) { $anonymization_options->setDisabled(true); } } else { $ts_results = new ilRadioGroupInputGUI($this->lng->txt("survey_360_results"), "ts_res"); $ts_results->setValue($this->object->get360Results()); $option = new ilRadioOption($this->lng->txt("survey_360_results_none"), ilObjSurvey::RESULTS_360_NONE); $option->setInfo($this->lng->txt("survey_360_results_none_info")); $ts_results->addOption($option); $option = new ilRadioOption($this->lng->txt("survey_360_results_own"), ilObjSurvey::RESULTS_360_OWN); $option->setInfo($this->lng->txt("survey_360_results_own_info")); $ts_results->addOption($option); $option = new ilRadioOption($this->lng->txt("survey_360_results_all"), ilObjSurvey::RESULTS_360_ALL); $option->setInfo($this->lng->txt("survey_360_results_all_info")); $ts_results->addOption($option); $form->addItem($ts_results); } // competence service activation for 360 mode include_once "./Services/Skill/classes/class.ilSkillManagementSettings.php"; $skmg_set = new ilSkillManagementSettings(); if ($this->object->get360Mode() && $skmg_set->isActivated()) { $other = new ilFormSectionHeaderGUI(); $other->setTitle($this->lng->txt("other")); $form->addItem($other); $skill_service = new ilCheckboxInputGUI($this->lng->txt("survey_activate_skill_service"), "skill_service"); $skill_service->setInfo($this->lng->txt("survey_activate_skill_service_info")); $skill_service->setChecked($this->object->get360SkillService()); $form->addItem($skill_service); } $form->addCommandButton("saveProperties", $this->lng->txt("save")); // remove items when using template if ($template_settings) { foreach ($template_settings as $id => $item) { if ($item["hide"]) { $form->removeItemByPostVar($id); } } } return $form; }
protected function periodic($a_export = false) { global $tpl, $ilToolbar, $ilCtrl, $ilTabs, $lng; $ilTabs->activateSubTab("periodic"); // current start if (!$_REQUEST["sst"]) { $_REQUEST["sst"] = date("Y-m-d"); } else { $org = $_REQUEST["sst"]["date"]; $_REQUEST["sst"] = $org["y"] . "-" . str_pad($org["m"], 2, "0", STR_PAD_LEFT) . "-" . str_pad($org["d"], 2, "0", STR_PAD_LEFT); } $start = $_REQUEST["sst"]; // current end if (!$_REQUEST["sto"]) { $_REQUEST["sto"] = date("Y-m-d", strtotime("-7 days")); } else { $org = $_REQUEST["sto"]["date"]; $_REQUEST["sto"] = $org["y"] . "-" . str_pad($org["m"], 2, "0", STR_PAD_LEFT) . "-" . str_pad($org["d"], 2, "0", STR_PAD_LEFT); } $end = $_REQUEST["sto"]; $time_to = mktime(23, 59, 59, substr($start, 5, 2), substr($start, 8, 2), substr($start, 0, 4)); $time_from = mktime(0, 0, 1, substr($end, 5, 2), substr($end, 8, 2), substr($end, 0, 4)); // mixed up dates? if ($time_to < $time_from) { $tmp = $time_to; $time_to = $time_from; $time_from = $tmp; } $title = $lng->txt("trac_periodic_system_load"); $data = $this->buildData($time_from, $time_to, $title); if (!$a_export) { // toolbar include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $ilToolbar->setFormAction($ilCtrl->getFormAction($this, "periodic")); $end_selector = new ilDateTimeInputGUI($lng->txt("trac_begin_at"), "sto"); $end_selector->setDate(new ilDate($end, IL_CAL_DATE)); $ilToolbar->addInputItem($end_selector, true); $start_selector = new ilDateTimeInputGUI($lng->txt("trac_end_at"), "sst"); $start_selector->setDate(new ilDate($start, IL_CAL_DATE)); $ilToolbar->addInputItem($start_selector, true); $ilToolbar->addFormButton($lng->txt("ok"), "periodic"); if (sizeof($data["active"])) { $ilToolbar->addSeparator(); $ilToolbar->addFormButton($lng->txt("export"), "periodicExport"); } $tpl->setContent($this->render($data, self::SCALE_PERIODIC_WEEK)); } else { $this->exportCSV($data, self::SCALE_PERIODIC_WEEK); } }
public function editPriceObject() { $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); $price_id = $_GET['price_id'] ? $_GET['price_id'] : $_POST['price_id']; $price = ilPaymentPrices::_getPrice($price_id); $this->ctrl->setParameter($this, 'pobject_id', (int) $_GET['pobject_id']); $tmp_pobject = ilPaymentObject::_getObjectData($_GET['pobject_id']); include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this)); $tmp_obj = ilObjectFactory::getInstanceByRefId($tmp_pobject['ref_id'], false); if ($tmp_obj) { $form->setTitle($tmp_obj->getTitle()); } else { $form->setTitle($this->lng->txt('object_not_found')); } //price_type $radio_group = new ilRadioGroupInputGUI('', 'price_type'); $radio_group->setTitle($this->lng->txt('duration')); $radio_group->setRequired(true); $radio_group->setValue($price['price_type']); $radio_group->setPostVar('price_type'); $radio_option_1 = new ilRadioOption($this->lng->txt('duration_month'), ilPaymentPrices::TYPE_DURATION_MONTH); // duration month $oDuration = new ilNumberInputGUI(); $oDuration->setTitle($this->lng->txt('paya_months')); $oDuration->setSize('20%'); $oDuration->setValue($price['duration']); $oDuration->setPostVar('duration_month'); $radio_option_1->addSubItem($oDuration); $radio_group->addOption($radio_option_1); $radio_option_3 = new ilRadioOption($this->lng->txt('duration_date'), ilPaymentPrices::TYPE_DURATION_DATE); // duration_date from $o_date_from = new ilDateTimeInputGUI(); $o_date_from->setTitle($this->lng->txt('cal_from')); $o_date_from->setDate(new ilDate($price['duration_from'], IL_CAL_DATE)); $o_date_from->setPostVar('duration_date_from'); $radio_option_3->addSubItem($o_date_from); // duration_date until $o_date_until = new ilDateTimeInputGUI(); $o_date_until->setTitle($this->lng->txt('cal_until')); $o_date_until->setDate(new ilDate($price['duration_until'], IL_CAL_DATE)); $o_date_until->setPostVar('duration_date_until'); $radio_option_3->addSubItem($o_date_until); $radio_group->addOption($radio_option_3); $radio_option_2 = new ilRadioOption($this->lng->txt('unlimited_duration'), ilPaymentPrices::TYPE_UNLIMITED_DURATION); $radio_group->addOption($radio_option_2); $form->addItem($radio_group); // description $oDescription = new ilTextAreaInputGUI($this->lng->txt('description'), 'description'); $oDescription->setRows(4); $oDescription->setCols(35); $oDescription->setValue($price['description']); $form->addItem($oDescription); // price $oPrice = new ilNumberInputGUI(); $oPrice->setTitle($this->lng->txt('price_a')); $oPrice->setSize('20%'); $oPrice->setRequired(true); $oPrice->setValue($price['price']); include_once './Services/Payment/classes/class.ilPaymentSettings.php'; $genSet = ilPaymentSettings::_getInstance(); $oPrice->setInfo($genSet->get('currency_unit')); $oPrice->setPostVar('price'); $oPrice->allowDecimals(true); $form->addItem($oPrice); //extension $oExtension = new ilCheckboxInputGUI($this->lng->txt('extension_price'), 'extension'); $oExtension->setChecked($price['extension']); $form->addItem($oExtension); $o_hidden_1 = new ilHiddenInputGUI('pobject_id'); $o_hidden_1->setValue((int) $_GET['pobject_id']); $o_hidden_1->setPostVar('pobject_id'); $o_hidden_2 = new ilHiddenInputGUI('price_id'); $o_hidden_2->setValue((int) $_GET['price_id']); $o_hidden_2->setPostVar('price_id'); $form->addItem($o_hidden_1); $form->addItem($o_hidden_2); $form->addCommandButton('updatePrice', $this->lng->txt('save')); $form->addCommandButton('editPrices', $this->lng->txt('cancel')); $this->tpl->setVariable('FORM', $form->getHTML()); }
/** * Show lucene settings form * @param * @return */ protected function initFormLuceneSettings() { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/Search/classes/class.ilSearchSettings.php'; $this->settings = ilSearchSettings::getInstance(); $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this, 'cancel')); $this->form->setTitle($this->lng->txt('lucene_settings_title')); $this->form->addCommandButton('saveLuceneSettings', $this->lng->txt('save')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); // Offline filter /* $offline = new ilCheckboxInputGUI($this->lng->txt('lucene_offline_filter_setting'),'offline_filter'); $offline->setInfo($this->lng->txt('lucene_offline_filter_setting_info')); $offline->setValue(1); $offline->setChecked($this->settings->isLuceneOfflineFilterEnabled()); $this->form->addItem($offline); */ $numFrag = new ilNumberInputGUI($this->lng->txt('lucene_num_fragments'), 'fragmentCount'); $numFrag->setRequired(true); $numFrag->setSize(2); $numFrag->setMaxLength(2); $numFrag->setMinValue(1); $numFrag->setMaxValue(10); $numFrag->setInfo($this->lng->txt('lucene_num_frag_info')); $numFrag->setValue($this->settings->getFragmentCount()); $this->form->addItem($numFrag); $sizeFrag = new ilNumberInputGUI($this->lng->txt('lucene_size_fragments'), 'fragmentSize'); $sizeFrag->setRequired(true); $sizeFrag->setSize(2); $sizeFrag->setMaxLength(4); $sizeFrag->setMinValue(10); $sizeFrag->setMaxValue(1000); $sizeFrag->setInfo($this->lng->txt('lucene_size_frag_info')); $sizeFrag->setValue($this->settings->getFragmentSize()); $this->form->addItem($sizeFrag); $maxSub = new ilNumberInputGUI($this->lng->txt('lucene_max_sub'), 'maxSubitems'); $maxSub->setRequired(true); $maxSub->setSize(2); $maxSub->setMaxLength(2); $maxSub->setMinValue(1); $maxSub->setMaxValue(10); $maxSub->setInfo($this->lng->txt('lucene_max_sub_info')); $maxSub->setValue($this->settings->getMaxSubitems()); $this->form->addItem($maxSub); $relevance = new ilCheckboxInputGUI($this->lng->txt('lucene_relevance'), 'relevance'); $relevance->setOptionTitle($this->lng->txt('lucene_show_relevance')); $relevance->setInfo($this->lng->txt('lucene_show_relevance_info')); $relevance->setValue(1); $relevance->setChecked($this->settings->isRelevanceVisible()); $this->form->addItem($relevance); $last_index = new ilDateTimeInputGUI($this->lng->txt('lucene_last_index_time'), 'last_index'); $last_index->setShowTime(true); $last_index->setDate($this->settings->getLastIndexTime()); $last_index->setInfo($this->lng->txt('lucene_last_index_time_info')); $this->form->addItem($last_index); return true; }