function initAddCodesForm() { global $ilCtrl, $lng; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form_gui = new ilPropertyFormGUI(); $this->form_gui->setFormAction($ilCtrl->getFormAction($this, 'createCodes')); $this->form_gui->setTitle($lng->txt('user_account_codes_edit_header')); $count = new ilNumberInputGUI($lng->txt('user_account_codes_number'), 'acc_codes_number'); $count->setSize(4); $count->setMaxLength(4); $count->setMinValue(1); $count->setMaxValue(1000); $count->setRequired(true); $this->form_gui->addItem($count); $valid = new ilRadioGroupInputGUI($lng->txt('user_account_code_valid_until'), 'valid_type'); $valid->setRequired(true); $unl = new ilRadioOption($lng->txt('user_account_code_valid_until_unlimited'), 'valid_unlimited'); $valid->addOption($unl); $st = new ilRadioOption($lng->txt('user_account_code_valid_until_static'), 'valid_static'); $valid->addOption($st); $dt = new ilDateTimeInputGUI($lng->txt('date'), 'valid_date'); $dt->setRequired(true); $st->addSubItem($dt); $dyn = new ilRadioOption($lng->txt('user_account_code_valid_until_dynamic'), 'valid_dynamic'); $valid->addOption($dyn); $ds = new ilNumberInputGUI($lng->txt('days'), 'valid_days'); $ds->setSize(5); $ds->setRequired(true); $dyn->addSubItem($ds); $this->form_gui->addItem($valid); $this->form_gui->addCommandButton('createCodes', $lng->txt('create')); $this->form_gui->addCommandButton('listCodes', $lng->txt('cancel')); }
public function addToForm() { global $lng; if ($this->getForm() instanceof ilPropertyFormGUI) { // :TODO: use DateDurationInputGUI ?! if (!(bool) $this->text_input) { $check = new ilCheckboxInputGUI($this->getTitle(), $this->addToElementId("tgl")); $check->setValue(1); $checked = false; } else { $check = new ilCustomInputGUI($this->getTitle()); } $date_from = new ilDateTimeInputGUI($lng->txt('from'), $this->addToElementId("lower")); $date_from->setShowTime(true); $check->addSubItem($date_from); if ($this->getLowerADT()->getDate() && !$this->getLowerADT()->isNull()) { $date_from->setDate($this->getLowerADT()->getDate()); $checked = true; } $date_until = new ilDateTimeInputGUI($lng->txt('until'), $this->addToElementId("upper")); $date_until->setShowTime(true); $check->addSubItem($date_until); if ($this->getUpperADT()->getDate() && !$this->getUpperADT()->isNull()) { $date_until->setDate($this->getUpperADT()->getDate()); $checked = true; } if (!(bool) $this->text_input) { $check->setChecked($checked); } else { $date_from->setMode(ilDateTimeInputGUI::MODE_INPUT); $date_until->setMode(ilDateTimeInputGUI::MODE_INPUT); } $this->addToParentElement($check); } else { // see ilTable2GUI::addFilterItemByMetaType() include_once "./Services/Form/classes/class.ilCombinationInputGUI.php"; include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php"; $item = new ilCombinationInputGUI($this->getTitle(), $this->getElementId()); $lower = new ilDateTimeInputGUI("", $this->addToElementId("lower")); $lower->setShowTime(true); $item->addCombinationItem("lower", $lower, $lng->txt("from")); if ($this->getLowerADT()->getDate() && !$this->getLowerADT()->isNull()) { $lower->setDate($this->getLowerADT()->getDate()); } $upper = new ilDateTimeInputGUI("", $this->addToElementId("upper")); $upper->setShowTime(true); $item->addCombinationItem("upper", $upper, $lng->txt("to")); if ($this->getUpperADT()->getDate() && !$this->getUpperADT()->isNull()) { $upper->setDate($this->getUpperADT()->getDate()); } $item->setComparisonMode(ilCombinationInputGUI::COMPARISON_ASCENDING); $item->setMode(ilDateTimeInputGUI::MODE_INPUT); $this->addToParentElement($item); } }
public function addToForm() { $adt_date = $this->getADT()->getDate(); $date = new ilDateTimeInputGUI($this->getTitle(), $this->getElementId()); $date->setShowTime(false); $this->addBasicFieldProperties($date, $this->getADT()->getCopyOfDefinition()); if ((bool) $this->text_input) { $date->setMode(ilDateTimeInputGUI::MODE_INPUT); } else { if (!$this->isRequired()) { $date->enableDateActivation("", $this->getElementId() . "_tgl", !(!$adt_date || $adt_date->isNull())); } } $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); }
/** * Set value by array * * @param array $a_values value array */ function setValueByArray($a_values) { if (isset($a_values[$this->getPostVar()]["date"]) && is_array($a_values[$this->getPostVar()]["date"])) { if (@checkdate($a_values[$this->getPostVar()]["date"]['m'], $a_values[$this->getPostVar()]["date"]['d'], $a_values[$this->getPostVar()]["date"]['y'])) { parent::setValueByArray($a_values); return; } } elseif (is_array($a_values[$this->getPostVar()]) && isset($a_values[$this->getPostVar()]["date"]) && !is_array($a_values[$this->getPostVar()]["date"])) { $this->setDate(new ilDate($a_values[$this->getPostVar()]["date"], IL_CAL_DATE)); } else { if (!is_array($a_values[$this->getPostVar()]) && strlen($a_values[$this->getPostVar()])) { $this->setDate(new ilDate($a_values[$this->getPostVar()], IL_CAL_DATE)); } else { $this->date = null; } } foreach ($this->getSubItems() as $item) { $item->setValueByArray($a_values); } }
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); }
function initDateForm() { global $lng, $ilCtrl; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $form = new ilPropertyFormGUI(); $form->setFormAction($ilCtrl->getFormAction($this)); $form->setTitle($lng->txt('blog_edit_date')); $date = new ilDateTimeInputGUI($lng->txt("date"), "date"); $date->setRequired(true); $date->setShowTime(true); $date->setInfo($lng->txt('blog_edit_date_info')); $form->addItem($date); $date->setDate($this->getPageObject()->getCreated()); $form->addCommandButton('updateDate', $lng->txt('save')); $form->addCommandButton('preview', $lng->txt('cancel')); return $form; }
/** * 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")); } }
protected function initAccessRestrictionForm($a_from_search = false) { $user_ids = $this->getActionUserIds(); if (!$user_ids) { ilUtil::sendFailure($this->lng->txt('select_one')); return $this->viewObject(); } include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setTitle($this->lng->txt("time_limit_add_time_limit_for_selected")); $form->setFormAction($this->ctrl->getFormAction($this, "confirmaccessRestrict")); $from = new ilDateTimeInputGUI($this->lng->txt("access_from"), "from"); $from->setShowTime(true); $from->setRequired(true); $form->addItem($from); $to = new ilDateTimeInputGUI($this->lng->txt("access_until"), "to"); $to->setRequired(true); $to->setShowTime(true); $form->addItem($to); $form->addCommandButton("confirmaccessRestrict", $this->lng->txt("confirm")); $form->addCommandButton("view", $this->lng->txt("cancel")); foreach ($user_ids as $user_id) { $ufield = new ilHiddenInputGUI("id[]"); $ufield->setValue($user_id); $form->addItem($ufield); } // return to search? if ($a_from_search || $_POST["frsrch"]) { $field = new ilHiddenInputGUI("frsrch"); $field->setValue(1); $form->addItem($field); } return $form; }
/** * init form edit * * @access protected * @return */ protected function initFormEdit() { global $tree; include_once "Services/Object/classes/class.ilObjectActivation.php"; include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); $title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->getItemId())); $this->form->setTitle($title . ': ' . $this->lng->txt('crs_edit_timings')); $timings = new ilRadioGroupInputGUI($this->lng->txt('timings'), 'timing_type'); // opt deactivated $dea = new ilRadioOption($this->lng->txt('crs_timings_disabled'), ilObjectActivation::TIMINGS_DEACTIVATED); $dea->setInfo($this->lng->txt('crs_timings_disabled_info')); $timings->addOption($dea); // Visiblity $vis = new ilRadioOption($this->lng->txt('crs_timings_availability_enabled'), ilObjectActivation::TIMINGS_ACTIVATION); #$vis->setInfo($this->lng->txt('crs_timings_visibility')); $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_start'), 'timing_start'); $start->setShowTime(true); #$start->setMinuteStepSize(5); $vis->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_end'), 'timing_end'); $end->setShowTime(true); #$end->setMinuteStepSize(5); $vis->addSubItem($end); $isv = new ilCheckboxInputGUI($this->lng->txt('crs_timings_visibility_short'), 'visible'); $isv->setInfo($this->lng->txt('crs_timings_visibility')); $isv->setValue(1); $vis->addSubItem($isv); $timings->addOption($vis); // Timings $tim = new ilRadioOption($this->lng->txt('crs_timings_presetting'), ilObjectActivation::TIMINGS_PRESETTING); $tim->setInfo($this->lng->txt('crs_item_presetting_info')); $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_begin'), 'sug_start'); $tim->addSubItem($start); $end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_end'), 'sug_end'); $tim->addSubItem($end); if ($tree->checkForParentType($this->parent_ref_id, 'crs')) { $cha = new ilCheckboxInputGUI($this->lng->txt('crs_timings_changeable'), 'changeable'); $tim->addSubItem($cha); $start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_early_begin'), 'early_start'); $tim->addSubItem($start); $late = new ilDateTimeInputGUI($this->lng->txt('crs_timings_short_limit_start_end'), 'late_end'); $tim->addSubItem($late); } $timings->addOption($tim); $this->form->addItem($timings); $this->form->addCommandButton('update', $this->lng->txt('save')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); }
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; }
/** * @param $type_id * @param ilDataCollectionField $field * @return ilCheckboxInputGUI|ilDateTimeInputGUI|ilFileInputGUI|ilTextInputGUI|NULL */ static function getInputField(ilDataCollectionField $field) { global $lng; $type_id = $field->getDatatypeId(); $title = $field->getTitle(); switch ($type_id) { case ilDataCollectionDatatype::INPUTFORMAT_TEXT: $input = new ilTextInputGUI($title, 'field_' . $field->getId()); if ($field->getTextArea()) { $input = new ilTextAreaInputGUI($title, 'field_' . $field->getId()); } if ($field->getLength()) { $input->setInfo($lng->txt("dcl_max_text_length") . ": " . $field->getLength()); if (!$field->getTextArea()) { $input->setMaxLength($field->getLength()); } } break; case ilDataCollectionDatatype::INPUTFORMAT_NUMBER: $input = new ilTextInputGUI($title, 'field_' . $field->getId()); break; case ilDataCollectionDatatype::INPUTFORMAT_BOOLEAN: $input = new ilCheckboxInputGUI($title, 'field_' . $field->getId()); break; case ilDataCollectionDatatype::INPUTFORMAT_DATETIME: $input = new ilDateTimeInputGUI($title, 'field_' . $field->getId()); $input->setStartYear(date("Y") - 100); break; case ilDataCollectionDatatype::INPUTFORMAT_FILE: $input = new ilFileInputGUI($title, 'field_' . $field->getId()); break; case ilDataCollectionDatatype::INPUTFORMAT_REFERENCE: if (!$field->isNRef()) { $input = new ilSelectInputGUI($title, 'field_' . $field->getId()); } else { $input = new ilMultiSelectInputGUI($title, 'field_' . $field->getId()); } break; case ilDataCollectionDatatype::INPUTFORMAT_RATING: $input = new ilTextInputGUI($title, 'field_' . $field->getId()); $input->setValue($lng->txt("dcl_editable_in_table_gui")); $input->setDisabled(true); break; case ilDataCollectionDatatype::INPUTFORMAT_ILIAS_REF: $input = new ilDataCollectionTreePickInputGUI($title, 'field_' . $field->getId()); break; case ilDataCollectionDatatype::INPUTFORMAT_MOB: $input = new ilImageFileInputGUI($title, 'field_' . $field->getId()); $input->setAllowDeletion(true); break; } if ($field->getDescription()) { $input->setInfo($field->getDescription() . ($input->getInfo() ? "<br>" . $input->getInfo() : "")); } return $input; }
/** * Init activation form */ function initActivationForm() { global $ilCtrl, $lng; include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($ilCtrl->getFormAction($this)); $this->form->setTitle($lng->txt("cont_page_activation")); // activation type radio $rad = new ilRadioGroupInputGUI($lng->txt("cont_activation"), "activation"); $rad_op1 = new ilRadioOption($lng->txt("cont_activated"), "activated"); $rad->addOption($rad_op1); $rad_op2 = new ilRadioOption($lng->txt("cont_deactivated"), "deactivated"); $rad->addOption($rad_op2); $rad_op3 = new ilRadioOption($lng->txt("cont_scheduled_activation"), "scheduled"); $dt_prop = new ilDateTimeInputGUI($lng->txt("cont_start"), "start"); $dt_prop->setShowTime(true); $rad_op3->addSubItem($dt_prop); $dt_prop2 = new ilDateTimeInputGUI($lng->txt("cont_end"), "end"); $dt_prop2->setShowTime(true); $rad_op3->addSubItem($dt_prop2); // show activation information $cb = new ilCheckboxInputGUI($this->lng->txt("cont_show_activation_info"), "show_activation_info"); $cb->setInfo($this->lng->txt("cont_show_activation_info_info")); $rad_op3->addSubItem($cb); $rad->addOption($rad_op3); $this->form->addCommandButton("saveActivation", $lng->txt("save")); $this->form->addItem($rad); }
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; }
/** * 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); }
/** * Add filter by standard type * * @param string $id * @param int $type * @param bool $a_optional * @param string $caption * @return object */ function addFilterItemByMetaType($id, $type = self::FILTER_TEXT, $a_optional = false, $caption = NULL) { global $lng; if (!$caption) { $caption = $lng->txt($id); } include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; switch ($type) { case self::FILTER_SELECT: include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $item = new ilSelectInputGUI($caption, $id); break; case self::FILTER_DATE: include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php"; $item = new ilDateTimeInputGUI($caption, $id); $item->setMode(ilDateTimeInputGUI::MODE_INPUT); break; case self::FILTER_TEXT: include_once "./Services/Form/classes/class.ilTextInputGUI.php"; $item = new ilTextInputGUI($caption, $id); $item->setMaxLength(64); $item->setSize(20); // $item->setSubmitFormOnEnter(true); break; case self::FILTER_LANGUAGE: $lng->loadLanguageModule("meta"); include_once "./Services/Form/classes/class.ilSelectInputGUI.php"; $item = new ilSelectInputGUI($caption, $id); $options = array("" => $lng->txt("trac_all")); foreach ($lng->getInstalledLanguages() as $lang_key) { $options[$lang_key] = $lng->txt("meta_l_" . $lang_key); } $item->setOptions($options); break; case self::FILTER_NUMBER_RANGE: include_once "./Services/Form/classes/class.ilCombinationInputGUI.php"; include_once "./Services/Form/classes/class.ilNumberInputGUI.php"; $item = new ilCombinationInputGUI($caption, $id); $combi_item = new ilNumberInputGUI("", $id . "_from"); $item->addCombinationItem("from", $combi_item, $lng->txt("from")); $combi_item = new ilNumberInputGUI("", $id . "_to"); $item->addCombinationItem("to", $combi_item, $lng->txt("to")); $item->setComparisonMode(ilCombinationInputGUI::COMPARISON_ASCENDING); $item->setMaxLength(7); $item->setSize(20); break; case self::FILTER_DATE_RANGE: include_once "./Services/Form/classes/class.ilCombinationInputGUI.php"; include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php"; $item = new ilCombinationInputGUI($caption, $id); $combi_item = new ilDateTimeInputGUI("", $id . "_from"); $item->addCombinationItem("from", $combi_item, $lng->txt("from")); $combi_item = new ilDateTimeInputGUI("", $id . "_to"); $item->addCombinationItem("to", $combi_item, $lng->txt("to")); $item->setComparisonMode(ilCombinationInputGUI::COMPARISON_ASCENDING); $item->setMode(ilDateTimeInputGUI::MODE_INPUT); break; case self::FILTER_DATETIME_RANGE: include_once "./Services/Form/classes/class.ilCombinationInputGUI.php"; include_once "./Services/Form/classes/class.ilDateTimeInputGUI.php"; $item = new ilCombinationInputGUI($caption, $id); $combi_item = new ilDateTimeInputGUI("", $id . "_from"); $combi_item->setShowTime(true); $item->addCombinationItem("from", $combi_item, $lng->txt("from")); $combi_item = new ilDateTimeInputGUI("", $id . "_to"); $combi_item->setShowTime(true); $item->addCombinationItem("to", $combi_item, $lng->txt("to")); $item->setComparisonMode(ilCombinationInputGUI::COMPARISON_ASCENDING); $item->setMode(ilDateTimeInputGUI::MODE_INPUT); break; case self::FILTER_DURATION_RANGE: $lng->loadLanguageModule("form"); include_once "./Services/Form/classes/class.ilCombinationInputGUI.php"; include_once "./Services/Form/classes/class.ilDurationInputGUI.php"; $item = new ilCombinationInputGUI($caption, $id); $combi_item = new ilDurationInputGUI("", $id . "_from"); $combi_item->setShowMonths(false); $combi_item->setShowDays(true); $combi_item->setShowSeconds(true); $item->addCombinationItem("from", $combi_item, $lng->txt("from")); $combi_item = new ilDurationInputGUI("", $id . "_to"); $combi_item->setShowMonths(false); $combi_item->setShowDays(true); $combi_item->setShowSeconds(true); $item->addCombinationItem("to", $combi_item, $lng->txt("to")); $item->setComparisonMode(ilCombinationInputGUI::COMPARISON_ASCENDING); break; default: return false; } $this->addFilterItem($item, $a_optional); $item->readFromSession(); return $item; }
public function initAssignmentForm($a_mode = "create") { global $lng, $ilCtrl, $ilSetting; // init form include_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setTitle($a_mode == "edit" ? $this->txt("edit_assignment") : $this->txt("new_assignment")); $this->form->setFormAction($ilCtrl->getFormAction($this)); // title $title = new ilTextInputGUI($this->txt("title"), "title"); $title->setMaxLength(200); $title->setRequired(true); $this->form->addItem($title); // start time y/n $check_start_time = new ilCheckboxInputGUI($this->txt("start_time"), "start_time_cb"); $this->form->addItem($check_start_time); // start time $start_time = new ilDateTimeInputGUI("", "start_time"); $start_time->setShowTime(true); $check_start_time->addSubItem($start_time); // Deadline $deadline = new ilDateTimeInputGUI($this->txt("deadline"), "deadline"); $deadline->setShowTime(true); $deadline->setRequired(true); $this->form->addItem($deadline); // mandatory $mandatory = new ilCheckboxInputGUI($this->txt("mandatory"), "mandatory"); $mandatory->setInfo($this->txt("mandatory_info")); $mandatory->setChecked(true); $this->form->addItem($mandatory); // Work Instructions $instruction = new ilTextAreaInputGUI($this->txt("instruction"), "instruction"); $instruction->setCols(39); $instruction->setRows(4); $instruction->setRequired(true); $this->form->addItem($instruction); // files if ($a_mode == "create") { $files = new ilFileWizardInputGUI($this->txt('files'), 'files'); $files->setFilenames(array(0 => '')); $this->form->addItem($files); $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")); } }
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 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)); }
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); }
/** * 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; }
public function showStatistics() { global $rbacsystem, $ilToolbar, $ilObjDataCache; // MINIMUM ACCESS LEVEL = 'read' /* if(!$rbacsystem->checkAccess('read', $this->getRefId())) { $this->ilias->raiseError($this->lng->txt('msg_no_perm_read'),$this->ilias->error_obj->MESSAGE); } */ $ilToolbar->addButton($this->lng->txt('paya_add_customer'), $this->ctrl->getLinkTarget($this, 'showObjectSelector')); if (!$_POST['show_filter'] && $_POST['updateView'] == '1') { $this->resetFilter(); } else { if ($_POST['updateView'] == 1) { $_SESSION['pay_statistics']['show_filter'] = $_POST['show_filter']; $_SESSION['pay_statistics']['updateView'] = true; $_SESSION['pay_statistics']['until_check'] = $_POST['until_check']; $_SESSION['pay_statistics']['from_check'] = $_POST['from_check']; $_SESSION['pay_statistics']['transaction_type'] = isset($_POST['transaction_type']) ? $_POST['transaction_type'] : ''; $_SESSION['pay_statistics']['transaction_value'] = isset($_POST['transaction_value']) ? $_POST['transaction_value'] : ''; $_SESSION['pay_statistics']['filter_title_id'] = (int) $_POST['filter_title_id']; if ($_SESSION['pay_statistics']['from_check'] == '1') { $_SESSION['pay_statistics']['from']['date']['d'] = $_POST['from']['date']['d']; $_SESSION['pay_statistics']['from']['date']['m'] = $_POST['from']['date']['m']; $_SESSION['pay_statistics']['from']['date']['y'] = $_POST['from']['date']['y']; } else { $_SESSION['pay_statistics']['from']['date']['d'] = ''; $_SESSION['pay_statistics']['from']['date']['m'] = ''; $_SESSION['pay_statistics']['from']['date']['y'] = ''; } if ($_SESSION['pay_statistics']['until_check'] == '1') { $_SESSION['pay_statistics']['til']['date']['d'] = $_POST['til']['date']['d']; $_SESSION['pay_statistics']['til']['date']['m'] = $_POST['til']['date']['m']; $_SESSION['pay_statistics']['til']['date']['y'] = $_POST['til']['date']['y']; } else { $_SESSION['pay_statistics']['til']['date']['d'] = ''; $_SESSION['pay_statistics']['til']['date']['m'] = ''; $_SESSION['pay_statistics']['til']['date']['y'] = ''; } $_SESSION['pay_statistics']['payed'] = $_POST['payed']; $_SESSION['pay_statistics']['access'] = $_POST['access']; $_SESSION['pay_statistics']['pay_method'] = $_POST['pay_method']; $_SESSION['pay_statistics']['customer'] = isset($_POST['customer']) ? $_POST['customer'] : ''; $_SESSION['pay_statistics']['vendor'] = isset($_POST['vendor']) ? $_POST['vendor'] : ''; } } $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; // FILTER FORM $filter_form = new ilPropertyFormGUI(); $filter_form->setFormAction($this->ctrl->getFormAction($this)); $filter_form->setTitle($this->lng->txt('pay_filter')); $filter_form->setId('formular'); $filter_form->setTableWidth('100 %'); $o_hide_check = new ilCheckBoxInputGUI($this->lng->txt('show_filter'), 'show_filter'); $o_hide_check->setValue(1); $o_hide_check->setChecked($_SESSION['pay_statistics']['show_filter'] ? 1 : 0); $o_hidden = new ilHiddenInputGUI('updateView'); $o_hidden->setValue(1); $o_hidden->setPostVar('updateView'); $o_hide_check->addSubItem($o_hidden); $o_transaction_type = new ilSelectInputGUI(); $trans_option = array($this->lng->txt('pay_starting'), $this->lng->txt('pay_ending')); $trans_value = array('0', '1'); $o_transaction_type->setTitle($this->lng->txt('paya_transaction')); $o_transaction_type->setOptions($trans_option); $o_transaction_type->setValue($_SESSION['pay_statistics']['transaction_type']); $o_transaction_type->setPostVar('transaction_type'); $o_hide_check->addSubItem($o_transaction_type); $o_transaction_val = new ilTextInputGUI(); $o_transaction_val->setValue($_SESSION['pay_statistics']['transaction_value']); $o_transaction_val->setPostVar('transaction_value'); $o_hide_check->addSubItem($o_transaction_val); $o_customer = new ilTextInputGUI(); $o_customer->setTitle($this->lng->txt('paya_customer')); $o_customer->setValue($_SESSION['pay_statistics']['customer']); $o_customer->setPostVar('customer'); $o_hide_check->addSubItem($o_customer); $o_vendor = new ilTextInputGUI(); $o_vendor->setTitle($this->lng->txt('paya_vendor')); $o_vendor->setValue($_SESSION['pay_statistics']['vendor']); $o_vendor->setPostVar('vendor'); $o_hide_check->addSubItem($o_vendor); $o_from_check = new ilCheckBoxInputGUI($this->lng->txt('pay_order_date_from'), 'from_check'); $o_from_check->setValue(1); $o_from_check->setChecked($_SESSION['pay_statistics']['from_check'] ? 1 : 0); $o_date_from = new ilDateTimeInputGUI(); $o_date_from->setPostVar('from'); $_POST['from'] = $_SESSION['pay_statistics']['from']; if ($_SESSION['pay_statistics']['from_check'] == '1') { $o_date_from->checkInput(); } $o_from_check->addSubItem($o_date_from); $o_hide_check->addSubItem($o_from_check); $o_until_check = new ilCheckBoxInputGUI($this->lng->txt('pay_order_date_til'), 'until_check'); $o_until_check->setValue(1); $o_until_check->setChecked($_SESSION['pay_statistics']['until_check'] ? 1 : 0); $o_date_until = new ilDateTimeInputGUI(); $o_date_until->setPostVar('til'); $_POST['til'] = $_SESSION['pay_statistics']['til']; if ($_SESSION['pay_statistics']['until_check'] == '1') { $o_date_until->checkInput(); } $o_until_check->addSubItem($o_date_until); $o_hide_check->addSubItem($o_until_check); // title filter $this->__initBookingObject(); $title_options['all'] = $this->lng->txt('pay_all'); $unique_titles = $this->booking_obj->getUniqueTitles(); if (is_array($unique_titles) && count($unique_titles)) { foreach ($unique_titles as $ref_id) { $title_options[$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($ref_id)); } } $o_object_title = new ilSelectInputGUI(); $o_object_title->setTitle($this->lng->txt('title')); $o_object_title->setOptions($title_options); $o_object_title->setValue($_SESSION["pay_statistics"]["filter_title_id"]); $o_object_title->setPostVar('filter_title_id'); $o_hide_check->addSubItem($o_object_title); $o_payed = new ilSelectInputGUI(); $payed_option = array('all' => $this->lng->txt('pay_all'), '1' => $this->lng->txt('yes'), '0' => $this->lng->txt('no')); $o_payed->setTitle($this->lng->txt('paya_payed')); $o_payed->setOptions($payed_option); $o_payed->setValue($_SESSION['pay_statistics']['payed']); $o_payed->setPostVar('payed'); $o_hide_check->addSubItem($o_payed); $o_access = new ilSelectInputGUI(); $access_option = array('all' => $this->lng->txt('pay_all'), '1' => $this->lng->txt('yes'), '0' => $this->lng->txt('no')); $o_access->setTitle($this->lng->txt('paya_access')); $o_access->setOptions($access_option); $o_access->setValue($_SESSION['pay_statistics']['access']); $o_access->setPostVar('access'); $o_hide_check->addSubItem($o_access); $o_paymethod = new ilSelectInputGUI(); $o_paymethod->setTitle($this->lng->txt('payment_system')); $o_paymethod->setOptions(ilPayMethods::getPayMethodsOptions('all')); $o_paymethod->setValue($_SESSION['pay_statistics']['pay_method']); $o_paymethod->setPostVar('pay_method'); $o_hide_check->addSubItem($o_paymethod); $filter_form->addCommandButton('showStatistics', $this->lng->txt('pay_update_view')); $filter_form->addCommandButton('resetFilter', $this->lng->txt('pay_reset_filter')); $filter_form->addItem($o_hide_check); $this->tpl->setVariable('FORM', $filter_form->getHTML()); // STATISTICS TABLE $this->__initBookingObject(); if (!count($bookings = $this->booking_obj->getBookings())) { ilUtil::sendInfo($this->lng->txt('paya_no_bookings')); return true; } # $this->__showButton('excelExport',$this->lng->txt('excel_export')); include_once 'Services/User/classes/class.ilObjUser.php'; $object_title_cache = array(); $user_title_cache = array(); $counter = 0; foreach ($bookings as $booking) { if (array_key_exists($booking['ref_id'], $object_title_cache)) { $tmp_obj = $object_title_cache[$booking['ref_id']]; } else { $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($booking['ref_id'])); $object_title_cache[$booking['ref_id']] = $tmp_obj; } if (array_key_exists($booking['b_vendor_id'], $user_title_cache)) { $tmp_vendor = $user_title_cache[$booking['b_vendor_id']]; } else { $tmp_vendor = ilObjUser::_lookupLogin($booking['b_vendor_id']); $user_title_cache[$booking['b_vendor_id']] = $tmp_vendor; } if (array_key_exists($booking['customer_id'], $user_title_cache)) { $tmp_purchaser = $user_title_cache[$booking['customer_id']]; } else { $tmp_purchaser = ilObjUser::_lookupLogin($booking['customer_id']); $user_title_cache[$booking['customer_id']] = $tmp_purchaser; } $transaction = $booking['transaction_extern']; $str_paymethod = ilPayMethods::getStringByPaymethod($booking['b_pay_method']); $transaction .= " (" . $str_paymethod . ")"; $f_result[$counter]['transaction'] = $transaction; $f_result[$counter]['object_title'] = $tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted'); $f_result[$counter]['vendor'] = $tmp_vendor != '' ? '[' . $tmp_vendor . ']' : $this->lng->txt('user_deleted'); $f_result[$counter]['customer'] = $tmp_purchaser != '' ? '[' . $tmp_purchaser . ']' : $this->lng->txt('user_deleted'); $f_result[$counter]['order_date'] = ilDatePresentation::formatDate(new ilDateTime($booking['order_date'], IL_CAL_UNIX)); if ($booking['duration'] == 0) { $booking['duration'] = $this->lng->txt('unlimited_duration'); } $f_result[$counter]['duration'] = $booking['duration']; $f_result[$counter]['price'] = ilFormat::_getLocalMoneyFormat($booking['price']) . ' ' . $booking['currency_unit']; $f_result[$counter]['discount'] = $booking['discount'] . ' ' . $booking['currency_unit']; $payed_access = $booking['payed'] ? $this->lng->txt('yes') : $this->lng->txt('no'); $payed_access .= '/'; $payed_access .= $booking['access_granted'] ? $this->lng->txt('yes') : $this->lng->txt('no'); $f_result[$counter]['payed_access'] = $payed_access; $this->ctrl->setParameter($this, "booking_id", $booking['booking_id']); $link_change = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"" . $this->ctrl->getLinkTarget($this, "editStatistic") . "\">" . $this->lng->txt("edit") . "</a></div>"; $f_result[$counter]['edit'] = $link_change; unset($tmp_obj); unset($tmp_vendor); unset($tmp_purchaser); ++$counter; } return $this->__showStatisticTable($f_result); }
/** * 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; }
/** * 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")); 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("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(5); $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); } // 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")); } }
/** * 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); }
/** * 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); } }
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()); }
/** * 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()); }
/** * Init form * @param int $a_mode * @return */ protected function initFormSequence($a_mode) { include_once './Services/Form/classes/class.ilPropertyFormGUI.php'; include_once './Services/YUI/classes/class.ilYuiUtil.php'; ilYuiUtil::initDomEvent(); $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($this->ctrl->getFormAction($this)); switch ($a_mode) { case self::MODE_CREATE: $this->form->setTitle($this->lng->txt('cal_ch_add_sequence')); $this->form->addCommandButton('saveSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; /* case self::MODE_UPDATE: $this->form->setTitle($this->lng->txt('cal_ch_edit_sequence')); $this->form->addCommandButton('updateSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; */ /* case self::MODE_UPDATE: $this->form->setTitle($this->lng->txt('cal_ch_edit_sequence')); $this->form->addCommandButton('updateSequence', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; */ case self::MODE_MULTI: $this->form->setTitle($this->lng->txt('cal_ch_multi_edit_sequence')); $this->form->addCommandButton('updateMulti', $this->lng->txt('save')); $this->form->addCommandButton('appointmentList', $this->lng->txt('cancel')); break; } // in case of existing groups show a selection include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourGroups.php'; if (count($options = ilConsultationHourGroups::getGroupSelectOptions($this->getUserId()))) { $group = new ilSelectInputGUI($this->lng->txt('cal_ch_grp_selection'), 'grp'); $group->setOptions($options); $group->setRequired(false); $this->form->addItem($group); } // Title $ti = new ilTextInputGUI($this->lng->txt('title'), 'ti'); $ti->setSize(32); $ti->setMaxLength(128); $ti->setRequired(true); $this->form->addItem($ti); if ($a_mode != self::MODE_MULTI) { // Start include_once './Services/Form/classes/class.ilDateTimeInputGUI.php'; $dur = new ilDateTimeInputGUI($this->lng->txt('cal_start'), 'st'); $dur->setShowTime(true); $dur->setMinuteStepSize(5); $this->form->addItem($dur); // Duration $du = new ilDurationInputGUI($this->lng->txt('cal_ch_duration'), 'du'); $du->setShowMinutes(true); $du->setShowHours(true); $this->form->addItem($du); // Number of appointments $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_appointments'), 'ap'); $nu->setInfo($this->lng->txt('cal_ch_num_appointments_info')); $nu->setSize(2); $nu->setMaxLength(2); $nu->setRequired(true); $nu->setMinValue(1); $this->form->addItem($nu); // Recurrence include_once './Services/Calendar/classes/Form/class.ilRecurrenceInputGUI.php'; $rec = new ilRecurrenceInputGUI($this->lng->txt('cal_recurrences'), 'frequence'); $rec->setEnabledSubForms(array(IL_CAL_FREQ_DAILY, IL_CAL_FREQ_WEEKLY, IL_CAL_FREQ_MONTHLY)); $this->form->addItem($rec); } // Number of bookings $nu = new ilNumberInputGUI($this->lng->txt('cal_ch_num_bookings'), 'bo'); $nu->setSize(2); $nu->setMaxLength(2); $nu->setMinValue(1); $nu->setRequired(true); $this->form->addItem($nu); // Deadline $dead = new ilDurationInputGUI($this->lng->txt('cal_ch_deadline'), 'dead'); $dead->setInfo($this->lng->txt('cal_ch_deadline_info')); $dead->setShowMinutes(false); $dead->setShowHours(true); $dead->setShowDays(true); $this->form->addItem($dead); // Location $lo = new ilTextInputGUI($this->lng->txt('cal_where'), 'lo'); $lo->setSize(32); $lo->setMaxLength(128); $this->form->addItem($lo); // Description $de = new ilTextAreaInputGUI($this->lng->txt('description'), 'de'); $de->setRows(10); $de->setCols(60); $this->form->addItem($de); // Target Object $tgt = new ilTextInputGUI($this->lng->txt('cal_ch_target_object'), 'tgt'); $tgt->setInfo($this->lng->txt('cal_ch_target_object_info')); $tgt->setSize(16); $tgt->setMaxLength(128); $this->form->addItem($tgt); }
/** * 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; }