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);
 }
Пример #2
0
 /**
  * Init assignment form.
  *
  * @param        int        $a_mode        "create"/"edit"
  */
 public function initAssignmentForm($a_mode = "create")
 {
     global $lng, $ilCtrl, $ilSetting;
     // init form
     $lng->loadLanguageModule("form");
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     $this->form->setTableWidth("600px");
     if ($a_mode == "edit") {
         $this->form->setTitle($lng->txt("exc_edit_assignment"));
     } else {
         $this->form->setTitle($lng->txt("exc_new_assignment"));
     }
     $this->form->setFormAction($ilCtrl->getFormAction($this));
     // type
     include_once "./Modules/Exercise/classes/class.ilExAssignment.php";
     $types = array(ilExAssignment::TYPE_UPLOAD => $this->lng->txt("exc_type_upload"), ilExAssignment::TYPE_UPLOAD_TEAM => $this->lng->txt("exc_type_upload_team"), ilExAssignment::TYPE_TEXT => $this->lng->txt("exc_type_text"));
     if (!$ilSetting->get('disable_wsp_blogs')) {
         $types[ilExAssignment::TYPE_BLOG] = $this->lng->txt("exc_type_blog");
     }
     if ($ilSetting->get('user_portfolios')) {
         $types[ilExAssignment::TYPE_PORTFOLIO] = $this->lng->txt("exc_type_portfolio");
     }
     if (sizeof($types) > 1) {
         $ty = new ilSelectInputGUI($this->lng->txt("exc_assignment_type"), "type");
         $ty->setOptions($types);
         $ty->setRequired(true);
     } else {
         $ty = new ilHiddenInputGUI("type");
         $ty->setValue(ilExAssignment::TYPE_UPLOAD);
     }
     $this->form->addItem($ty);
     // title
     $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
     $ti->setMaxLength(200);
     $ti->setRequired(true);
     $this->form->addItem($ti);
     // start time y/n
     $cb = new ilCheckboxInputGUI($this->lng->txt("exc_start_time"), "start_time_cb");
     $this->form->addItem($cb);
     // start time
     $edit_date = new ilDateTimeInputGUI("", "start_time");
     $edit_date->setShowTime(true);
     $cb->addSubItem($edit_date);
     // deadline y/n
     $dcb = new ilCheckboxInputGUI($this->lng->txt("exc_deadline"), "deadline_cb");
     $dcb->setChecked(true);
     $this->form->addItem($dcb);
     // Deadline
     $edit_date = new ilDateTimeInputGUI($lng->txt(""), "deadline");
     $edit_date->setShowTime(true);
     $dcb->addSubItem($edit_date);
     // mandatory
     $cb = new ilCheckboxInputGUI($this->lng->txt("exc_mandatory"), "mandatory");
     $cb->setInfo($this->lng->txt("exc_mandatory_info"));
     $cb->setChecked(true);
     $this->form->addItem($cb);
     // Work Instructions
     $desc_input = new ilTextAreaInputGUI($lng->txt("exc_instruction"), "instruction");
     $desc_input->setRows(20);
     $desc_input->setUseRte(true);
     $desc_input->setRteTagSet("mini");
     $this->form->addItem($desc_input);
     // files
     if ($a_mode == "create") {
         $files = new ilFileWizardInputGUI($this->lng->txt('objs_file'), 'files');
         $files->setFilenames(array(0 => ''));
         $this->form->addItem($files);
     }
     // peer review
     $peer = new ilCheckboxInputGUI($lng->txt("exc_peer_review"), "peer");
     $peer->setInfo($this->lng->txt("exc_peer_review_ass_setting_info"));
     $this->form->addItem($peer);
     if ($a_mode == "create") {
         $peer->setInfo($lng->txt("exc_peer_review_info"));
     }
     $peer_min = new ilNumberInputGUI($lng->txt("exc_peer_review_min_number"), "peer_min");
     $peer_min->setInfo($lng->txt("exc_peer_review_min_number_info"));
     $peer_min->setRequired(true);
     $peer_min->setValue(5);
     $peer_min->setSize(3);
     $peer_min->setValue(2);
     $peer->addSubItem($peer_min);
     $peer_dl = new ilDateTimeInputGUI($lng->txt("exc_peer_review_deadline"), "peer_dl");
     $peer_dl->setInfo($lng->txt("exc_peer_review_deadline_info"));
     $peer_dl->enableDateActivation("", "peer_dl_tgl");
     $peer_dl->setShowTime(true);
     $peer->addSubItem($peer_dl);
     $peer_file = new ilCheckboxInputGUI($lng->txt("exc_peer_review_file"), "peer_file");
     $peer_file->setInfo($lng->txt("exc_peer_review_file_info"));
     $peer->addSubItem($peer_file);
     $peer_prsl = new ilCheckboxInputGUI($lng->txt("exc_peer_review_personal"), "peer_prsl");
     $peer_prsl->setInfo($lng->txt("exc_peer_review_personal_info"));
     $peer->addSubItem($peer_prsl);
     if ($a_mode != "create" && $this->ass && $this->ass->getDeadline() && $this->ass->getDeadline() < time()) {
         $peer_prsl->setDisabled(true);
     }
     // global feedback
     $fb = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file"), "fb");
     $this->form->addItem($fb);
     $fb_file = new ilFileInputGUI($lng->txt("file"), "fb_file");
     // $fb_file->setRequired(true);
     $fb_file->setALlowDeletion(true);
     $fb->addSubItem($fb_file);
     $fb_date = new ilRadioGroupInputGUI($lng->txt("exc_global_feedback_file_date"), "fb_date");
     $fb_date->setRequired(true);
     $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_deadline"), ilExAssignment::FEEDBACK_DATE_DEADLINE));
     $fb_date->addOption(new ilRadioOption($lng->txt("exc_global_feedback_file_date_upload"), ilExAssignment::FEEDBACK_DATE_SUBMISSION));
     $fb->addSubItem($fb_date);
     $fb_cron = new ilCheckboxInputGUI($lng->txt("exc_global_feedback_file_cron"), "fb_cron");
     $fb_cron->setInfo($lng->txt("exc_global_feedback_file_cron_info"));
     $fb->addSubItem($fb_cron);
     // save and cancel commands
     if ($a_mode == "create") {
         $this->form->addCommandButton("saveAssignment", $lng->txt("save"));
         $this->form->addCommandButton("listAssignments", $lng->txt("cancel"));
     } else {
         $this->form->addCommandButton("updateAssignment", $lng->txt("save"));
         $this->form->addCommandButton("listAssignments", $lng->txt("cancel"));
     }
 }
Пример #3
0
 /**
  * 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;
 }
 /**
  * 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);
 }
 /**
  * Parse property for filter (table)
  *
  * @access private
  * 
  */
 private function parseFilter()
 {
     global $ilUser;
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
     if ($this->getSelectedOnly()) {
         $recs = ilAdvancedMDRecord::_getSelectedRecordsByObject($this->obj_type, $this->obj_id, $this->sub_type);
     } else {
         $recs = ilAdvancedMDRecord::_getActivatedRecordsByObjectType($this->obj_type, $this->sub_type);
     }
     foreach ($recs as $record_obj) {
         include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
         foreach (ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record_obj->getRecordId()) as $def) {
             if ($this->handleECSDefinitions($def)) {
                 continue;
             }
             include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php';
             switch ($def->getFieldType()) {
                 case ilAdvancedMDFieldDefinition::TYPE_TEXT:
                     $text = new ilTextInputGUI($def->getTitle(), 'md_' . $def->getFieldId());
                     $text->setSize(20);
                     $text->setMaxLength(512);
                     $text->setSubmitFormOnEnter(true);
                     $this->table_gui->addFilterItem($text);
                     $text->readFromSession();
                     $this->table_gui->filter['md_' . $def->getFieldId()] = $text->getValue();
                     break;
                 case ilAdvancedMDFieldDefinition::TYPE_SELECT:
                     include_once "./Services/Form/classes/class.ilSelectInputGUI.php";
                     $select = new ilSelectInputGUI($def->getTitle(), 'md_' . $def->getFieldId());
                     $select->setOptions($def->getFieldValuesForSelect());
                     $this->table_gui->addFilterItem($select);
                     $select->readFromSession();
                     $this->table_gui->filter['md_' . $def->getFieldId()] = $select->getValue();
                     break;
                 case ilAdvancedMDFieldDefinition::TYPE_DATE:
                     include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php";
                     $time = new ilDateTimeInputGUI($def->getTitle(), 'md_' . $def->getFieldId());
                     $time->setShowTime(false);
                     $time->enableDateActivation($this->lng->txt('enabled'), 'md_activated[' . $def->getFieldId() . ']', false);
                     $this->table_gui->addFilterItem($time);
                     $time->readFromSession();
                     $this->table_gui->filter['md_' . $def->getFieldId()] = $time->getDate();
                     break;
                 case ilAdvancedMDFieldDefinition::TYPE_DATETIME:
                     $time = new ilDateTimeInputGUI($def->getTitle(), 'md_' . $def->getFieldId());
                     $time->setShowTime(true);
                     $time->enableDateActivation($this->lng->txt('enabled'), 'md_activated[' . $def->getFieldId() . ']', false);
                     $this->table_gui->addFilterItem($time);
                     $time->readFromSession();
                     $this->table_gui->filter['md_' . $def->getFieldId()] = $time->getValue();
                     break;
             }
         }
     }
 }