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')); }
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 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; }
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")); } }
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; }
public function initCreateForm($item) { global $ilUser; $settings = ilAdobeConnectServer::_getInstance(); //Login User - this creates a user if he not exists. if ($settings->getAuthMode() == ilAdobeConnectServer::AUTH_MODE_SWITCHAAI) { $this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php'); $ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId()); $ilAdobeConnectUser->loginUser(); } $this->pluginObj->includeClass('class.ilObjAdobeConnect.php'); if (isset($_POST['tpl_id']) && (int) $_POST['tpl_id'] > 0) { $item['id'] = $_POST['tpl_id']; } $template_settings = array(); if ($item['id']) { include_once "Services/Administration/classes/class.ilSettingsTemplate.php"; $template = new ilSettingsTemplate($item['id']); $template_settings = $template->getSettings(); } $form = new ilPropertyFormGUI(); $form->setTitle($this->pluginObj->txt($item['title'])); // login to ac-server $this->pluginObj->includeClass('class.ilAdobeConnectServer.php'); // title $title = new ilTextInputGUI($this->pluginObj->txt("title"), "title"); $title->setRequired(true); // description $description = new ilTextAreaInputGUI($this->pluginObj->txt("description"), "desc"); // contact_info_val $civ = array(); if ($ilUser->getPref('public_profile') == "y") { if ($ilUser->getPref('public_title')) { $civ_title = $ilUser->getUTitle() . ' '; } $civ[] = $civ_title . $ilUser->getFirstname() . ' ' . $ilUser->getLastname(); if ($ilUser->getPref('public_email')) { $civ[] = $ilUser->getEmail(); } if ($ilUser->getPref('public_phone_office') && strlen($ilUser->getPhoneOffice()) > 1) { $civ[] = $this->pluginObj->txt('office') . ': ' . $ilUser->getPhoneOffice(); } if ($ilUser->getPref('public_phone_mobile') && strlen($ilUser->getPhoneMobile()) > 1) { $civ[] = $this->pluginObj->txt('mobile') . ': ' . $ilUser->getPhoneMobile(); } } $contact_info_value = implode(', ', $civ); // owner $owner = new ilTextInputGUI($this->lng->txt("owner"), "owner"); $owner->setInfo($this->pluginObj->txt('owner_info')); $owner->setValue(ilObjUser::_lookupLogin($ilUser->getId())); $radio_time_type = new ilRadioGroupInputGUI($this->pluginObj->txt('time_type_selection'), 'time_type_selection'); // option: permanent room if (ilAdobeConnectServer::getSetting('enable_perm_room', '1')) { $permanent_room = new ilRadioOption($this->pluginObj->txt('permanent_room'), 'permanent_room'); $permanent_room->setInfo($this->pluginObj->txt('permanent_room_info')); $radio_time_type->addOption($permanent_room); $radio_time_type->setValue('permanent_room'); } // option: date selection $opt_date = new ilRadioOption($this->pluginObj->txt('start_date'), 'date_selection'); if ($template_settings['start_date']['hide'] == '0') { // start date $sd = new ilDateTimeInputGUI($this->pluginObj->txt("start_date"), "start_date"); $serverConfig = ilAdobeConnectServer::_getInstance(); $now = strtotime('+3 minutes'); $minTime = new ilDateTime($now + $serverConfig->getScheduleLeadTime() * 60 * 60, IL_CAL_UNIX); $sd->setDate($minTime); $sd->setShowTime(true); $sd->setRequired(true); $opt_date->addSubItem($sd); } if ($template_settings['duration']['hide'] == '0') { $duration = new ilDurationInputGUI($this->pluginObj->txt("duration"), "duration"); $duration->setRequired(true); $duration->setHours('2'); $opt_date->addSubItem($duration); } $radio_time_type->addOption($opt_date); $radio_time_type->setRequired(true); if (!ilAdobeConnectServer::getSetting('enable_perm_room', '1')) { $radio_time_type->setValue('date_selection'); } // access-level of the meeting room $radio_access_level = new ilRadioGroupInputGUI($this->pluginObj->txt('access'), 'access_level'); $opt_private = new ilRadioOption($this->pluginObj->txt('private_room'), ilObjAdobeConnect::ACCESS_LEVEL_PRIVATE); $opt_protected = new ilRadioOption($this->pluginObj->txt('protected_room'), ilObjAdobeConnect::ACCESS_LEVEL_PROTECTED); $opt_public = new ilRadioOption($this->pluginObj->txt('public_room'), ilObjAdobeConnect::ACCESS_LEVEL_PUBLIC); $radio_access_level->addOption($opt_private); $radio_access_level->addOption($opt_protected); $radio_access_level->addOption($opt_public); $radio_access_level->setValue(ilObjAdobeConnect::ACCESS_LEVEL_PROTECTED); $this->pluginObj->includeClass('class.ilAdobeConnectUserUtil.php'); $ilAdobeConnectUser = new ilAdobeConnectUserUtil($this->user->getId()); $ilAdobeConnectUser->ensureAccountExistance(); $xavc_login = $ilAdobeConnectUser->getXAVCLogin(); $folder_id = $ilAdobeConnectUser->ensureUserFolderExistance($xavc_login); if ($template_settings['reuse_existing_rooms']['hide'] == '0') { $all_scos = (array) ilObjAdobeConnect::getScosByFolderId($folder_id); $local_scos = (array) ilObjAdobeConnect::getLocalScos(); $free_scos = array(); if ($all_scos) { foreach ($all_scos as $sco) { $sco_ids[] = $sco['sco_id']; } $free_scos = array_diff($sco_ids, $local_scos); } if (!$free_scos) { $hidden_creation_type = new ilHiddenInputGUI('creation_type'); $hidden_creation_type->setValue('new_vc'); $form->addItem($hidden_creation_type); $advanced_form_item = $form; $afi_add_method = 'addItem'; } else { $radio_grp = new ilRadioGroupInputGUI($this->pluginObj->txt('choose_creation_type'), 'creation_type'); $radio_grp->setRequired(true); $radio_new = new ilRadioOption($this->pluginObj->txt('create_new'), 'new_vc'); $radio_existing = new ilRadioOption($this->pluginObj->txt('select_existing'), 'existing_vc'); $radio_grp->setValue('new_vc'); $radio_grp->addOption($radio_new); $advanced_form_item = $radio_new; $afi_add_method = 'addSubItem'; } $advanced_form_item->{$afi_add_method}($title); $advanced_form_item->{$afi_add_method}($description); $contact_info = new ilTextAreaInputGUI($this->pluginObj->txt("contact_information"), "contact_info"); $contact_info->setRows(self::CREATION_FORM_TA_ROWS); $contact_info->setValue($contact_info_value); $advanced_form_item->{$afi_add_method}($contact_info); $instructions = new ilTextAreaInputGUI($this->lng->txt('exc_instruction'), 'instructions'); $instructions->setRows(self::CREATION_FORM_TA_ROWS); $advanced_form_item->{$afi_add_method}($instructions); if ($template_settings['access_level']['hide'] == 0) { $advanced_form_item->{$afi_add_method}($radio_access_level); } $advanced_form_item->{$afi_add_method}($radio_time_type); $advanced_form_item->{$afi_add_method}($owner); if ($free_scos && $radio_existing) { $radio_existing = new ilRadioOption($this->pluginObj->txt('select_existing'), 'existing_vc'); $radio_grp->addOption($radio_existing); $form->addItem($radio_grp); foreach ($free_scos as $fs) { $options[$fs] = $all_scos[$fs]['sco_name']; } $available_rooms = new ilSelectInputGUI($this->pluginObj->txt('available_rooms'), 'available_rooms'); $available_rooms->setOptions($options); $available_rooms->setInfo($this->pluginObj->txt('choose_existing_room')); $radio_existing->addSubItem($available_rooms); $instructions_3 = new ilTextAreaInputGUI($this->lng->txt('exc_instruction'), 'instructions_3'); $instructions_3->setRows(self::CREATION_FORM_TA_ROWS); $radio_existing->addSubItem($instructions_3); $contact_info_3 = new ilTextAreaInputGUI($this->pluginObj->txt("contact_information"), "contact_info_3"); $contact_info_3->setValue($contact_info_value); $contact_info_3->setRows(self::CREATION_FORM_TA_ROWS); $radio_existing->addSubItem($contact_info_3); } else { //$info = new ilNonEditableValueGUI($this->pluginObj->txt('no_available_rooms')); //$radio_existing->addSubItem($info); } } else { $form->addItem($title); $form->addItem($description); $contact_info_2 = new ilTextAreaInputGUI($this->pluginObj->txt("contact_information"), "contact_info_2"); $contact_info_2->setRows(self::CREATION_FORM_TA_ROWS); $contact_info_2->setValue($contact_info_value); $form->addItem($contact_info_2); if ($template_settings['access_level']['hide'] == 0) { $form->addItem($radio_access_level); } $instructions_2 = new ilTextAreaInputGUI($this->lng->txt('exc_instruction'), 'instructions_2'); $instructions_2->setRows(self::CREATION_FORM_TA_ROWS); $form->addItem($instructions_2); if (ilAdobeConnectServer::getSetting('default_perm_room') && ilAdobeConnectServer::getSetting('enable_perm_room', '1')) { $info_text = $this->pluginObj->txt('smpl_permanent_room_enabled'); } else { $time = date('H:i', strtotime('+2 hours')); $info_text = sprintf($this->pluginObj->txt('smpl_permanent_room_disabled'), $time); } $info = new ilNonEditableValueGUI($this->lng->txt('info'), 'info_text'); $info->setValue($info_text); $form->addItem($info); } $tpl_id = new ilHiddenInputGUI('tpl_id'); $tpl_id->setValue($item['id']); $form->addItem($tpl_id); $form->addCommandButton("save", $this->pluginObj->txt($this->getType() . "_add")); $form->addCommandButton("cancelCreation", $this->lng->txt("cancel")); $form->setFormAction($this->ctrl->getFormAction($this)); return $form; }
function initAddCodesForm() { global $rbacreview, $ilObjDataCache, $lng; include_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; $this->form_gui = new ilPropertyFormGUI(); $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'createCodes')); $this->form_gui->setTitle($this->lng->txt('registration_codes_edit_header')); $count = new ilNumberInputGUI($this->lng->txt('registration_codes_number'), 'reg_codes_number'); $count->setSize(4); $count->setMaxLength(4); $count->setMinValue(1); $count->setMaxValue(1000); $count->setRequired(true); $this->form_gui->addItem($count); $sec = new ilFormSectionHeaderGUI(); $sec->setTitle($this->lng->txt('registration_codes_roles_title')); $this->form_gui->addItem($sec); include_once './Services/AccessControl/classes/class.ilObjRole.php'; $options = array("" => $this->lng->txt('registration_codes_no_assigned_role')); foreach ($rbacreview->getGlobalRoles() as $role_id) { if (!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) { $options[$role_id] = $ilObjDataCache->lookupTitle($role_id); } } $roles = new ilSelectInputGUI($this->lng->txt("registration_codes_roles"), "reg_codes_role"); $roles->setInfo($this->lng->txt("registration_codes_override_info")); $roles->setOptions($options); $this->form_gui->addItem($roles); $local = new ilTextInputGUI($this->lng->txt("registration_codes_roles_local"), "reg_codes_local"); $local->setMulti(true); $local->setDataSource($this->ctrl->getLinkTarget($this, "getLocalRoleAutoComplete", "", true)); $this->form_gui->addItem($local); $sec = new ilFormSectionHeaderGUI(); $sec->setTitle($this->lng->txt('reg_access_limitations')); $this->form_gui->addItem($sec); $limit = new ilRadioGroupInputGUI($this->lng->txt("reg_access_limitation_mode"), "reg_limit"); $limit->setInfo($this->lng->txt("registration_codes_override_info")); $this->form_gui->addItem($limit); $opt = new ilRadioOption($this->lng->txt("registration_codes_roles_limitation_none"), "none"); $limit->addOption($opt); $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_none"), "unlimited"); $limit->addOption($opt); $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_absolute"), "absolute"); $limit->addOption($opt); $dt = new ilDateTimeInputGUI($this->lng->txt("reg_access_limitation_mode_absolute_target"), "abs_date"); $dt->setRequired(true); $opt->addSubItem($dt); $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_relative"), "relative"); $limit->addOption($opt); $days = new ilTextInputGUI("", "rel_date[d]"); $days->setSize(5); $days->setSuffix($this->lng->txt("days")); $mon = new ilTextInputGUI("", "rel_date[m]"); $mon->setSize(5); $mon->setSuffix($this->lng->txt("months")); $yr = new ilTextInputGUI("", "rel_date[y]"); $yr->setSize(5); $yr->setSuffix($this->lng->txt("years")); // custom input won't reload if (is_array($_POST["rel_date"])) { $days->setValue($_POST["rel_date"]["d"]); $mon->setValue($_POST["rel_date"]["m"]); $yr->setValue($_POST["rel_date"]["y"]); } $dur = new ilCustomInputGUI($this->lng->txt("reg_access_limitation_mode_relative_target")); $dur->setRequired(true); $dur->setHTML($days->getToolbarHTML() . " " . $mon->getToolbarHTML() . " " . $yr->getToolbarHTML()); $opt->addSubItem($dur); $this->form_gui->addCommandButton('createCodes', $this->lng->txt('create')); }
/** * Init object edit form * * @return ilPropertyFormGUI */ protected function initEditForm() { global $lng, $ilCtrl; $lng->loadLanguageModule($this->object->getType()); include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $form = new ilPropertyFormGUI(); $form->setFormAction($this->ctrl->getFormAction($this, "update")); $form->setTitle($this->lng->txt($this->object->getType() . "_edit")); // title $ti = new ilTextInputGUI($this->lng->txt("title"), "title"); $ti->setMaxLength(128); $ti->setSize(40); $ti->setRequired(true); $form->addItem($ti); $ti = new ilDateTimeInputGUI($this->lng->txt("title"), "datum"); $ti->setInfo("bitte ausfüllen"); $ti->setRequired(false); $form->addItem($ti); // description $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc"); $ta->setCols(40); $ta->setRows(2); $form->addItem($ta); $this->initEditCustomForm($form); $form->addCommandButton("update", $this->lng->txt("save")); //$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel")); return $form; }