public function addCustomSettingsToForm(ilPropertyFormGUI $a_form) { global $lng, $rbacreview, $ilObjDataCache, $ilSetting; include_once 'Services/Form/classes/class.ilMultiSelectInputGUI.php'; $sub_mlist = new ilMultiSelectInputGUI($lng->txt('delete_inactive_user_accounts_include_roles'), 'cron_inactive_user_delete_include_roles'); $sub_mlist->setInfo($lng->txt('delete_inactive_user_accounts_include_roles_desc')); $roles = array(); foreach ($rbacreview->getGlobalRoles() as $role_id) { if ($role_id != ANONYMOUS_ROLE_ID) { $roles[$role_id] = $ilObjDataCache->lookupTitle($role_id); } } $sub_mlist->setOptions($roles); $setting = $ilSetting->get('cron_inactive_user_delete_include_roles', null); if ($setting === null) { $setting = array(); } else { $setting = explode(',', $setting); } $sub_mlist->setValue($setting); $sub_mlist->setWidth(300); #$sub_mlist->setHeight(100); $a_form->addItem($sub_mlist); $default_setting = self::DEFAULT_INACTIVITY_PERIOD; $sub_text = new ilTextInputGUI($lng->txt('delete_inactive_user_accounts_period'), 'cron_inactive_user_delete_period'); $sub_text->setInfo($lng->txt('delete_inactive_user_accounts_period_desc')); $sub_text->setValue($ilSetting->get("cron_inactive_user_delete_period", $default_setting)); $sub_text->setSize(2); $sub_text->setMaxLength(3); $sub_text->setRequired(true); $a_form->addItem($sub_text); /* $default_setting = ilCronDeleteInactiveUserAccounts::DEFAULT_SETTING_INCLUDE_ADMINS; $sub_cb = new ilCheckboxInputGUI($lng->txt('delete_inactive_user_accounts_include_admins'),'cron_inactive_user_delete_include_admins'); $sub_cb->setChecked($ilSetting->get("cron_inactive_user_delete_include_admins", $default_setting) ? 1 : 0 ); //$sub_cb->setOptionTitle($lng->txt('delete_inactive_user_accounts_include_admins')); $sub_cb->setInfo($lng->txt('delete_inactive_user_accounts_include_admins_desc')); $a_form->addItem($sub_cb); */ }
/** * Init cron jobs form. */ public function initCronJobsForm() { global $lng, $ilSetting, $rbacreview, $ilObjDataCache; include_once "Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $cls = new ilNonEditableValueGUI($this->lng->txt('cronjob_last_start'), 'cronjob_last_start'); if ($ilSetting->get('last_cronjob_start_ts')) { include_once './Services/Calendar/classes/class.ilDatePresentation.php'; $cls->setInfo(ilDatePresentation::formatDate(new ilDateTime($ilSetting->get('last_cronjob_start_ts'), IL_CAL_UNIX))); } else { $cls->setInfo($this->lng->txt('cronjob_last_start_unknown')); } $this->form->addItem($cls); // check user accounts $cb = new ilCheckboxInputGUI($this->lng->txt("check_user_accounts"), "cron_user_check"); $cb->setInfo($this->lng->txt("check_user_accounts_desc")); if ($ilSetting->get("cron_user_check")) { $cb->setChecked(true); } $this->form->addItem($cb); // delete inactive user accounts require_once 'Services/User/classes/class.ilCronDeleteInactiveUserAccounts.php'; $cb = new ilCheckboxInputGUI($this->lng->txt("delete_inactive_user_accounts"), "cron_inactive_user_delete"); $cb->setInfo($this->lng->txt("delete_inactive_user_accounts_desc")); if ($ilSetting->get("cron_inactive_user_delete", false)) { $cb->setChecked(true); } $sub_list = new ilSelectInputGUI($this->lng->txt('delete_inactive_user_accounts_interval'), 'cron_inactive_user_delete_interval'); $sub_list->setInfo($this->lng->txt('delete_inactive_user_accounts_interval_desc')); $sub_list->setOptions(ilCronDeleteInactiveUserAccounts::getPossibleIntervalsArray()); $sub_list->setValue($ilSetting->get('cron_inactive_user_delete_interval', ilCronDeleteInactiveUserAccounts::getDefaultIntervalKey())); $cb->addSubItem($sub_list); include_once 'Services/Form/classes/class.ilMultiSelectInputGUI.php'; $sub_mlist = new ilMultiSelectInputGUI($this->lng->txt('delete_inactive_user_accounts_include_roles'), 'cron_inactive_user_delete_include_roles'); $sub_mlist->setInfo($this->lng->txt('delete_inactive_user_accounts_include_roles_desc')); $roles = array(); foreach ($rbacreview->getGlobalRoles() as $role_id) { if ($role_id != ANONYMOUS_ROLE_ID) { $roles[$role_id] = $ilObjDataCache->lookupTitle($role_id); } } $sub_mlist->setOptions($roles); $setting = $ilSetting->get('cron_inactive_user_delete_include_roles', null); if ($setting === null) { $setting = array(); } else { $setting = explode(',', $setting); } $sub_mlist->setValue($setting); $sub_mlist->setWidth(300); #$sub_mlist->setHeight(100); $cb->addSubItem($sub_mlist); $default_setting = ilCronDeleteInactiveUserAccounts::DEFAULT_INACTIVITY_PERIOD; $sub_text = new ilTextInputGUI($this->lng->txt('delete_inactive_user_accounts_period'), 'cron_inactive_user_delete_period'); $sub_text->setInfo($this->lng->txt('delete_inactive_user_accounts_period_desc')); $sub_text->setValue($ilSetting->get("cron_inactive_user_delete_period", $default_setting)); $sub_text->setSize(2); $sub_text->setMaxLength(3); $cb->addSubItem($sub_text); /* $default_setting = ilCronDeleteInactiveUserAccounts::DEFAULT_SETTING_INCLUDE_ADMINS; $sub_cb = new ilCheckboxInputGUI($this->lng->txt('delete_inactive_user_accounts_include_admins'),'cron_inactive_user_delete_include_admins'); $sub_cb->setChecked($ilSetting->get("cron_inactive_user_delete_include_admins", $default_setting) ? 1 : 0 ); //$sub_cb->setOptionTitle($this->lng->txt('delete_inactive_user_accounts_include_admins')); $sub_cb->setInfo($this->lng->txt('delete_inactive_user_accounts_include_admins_desc')); $cb->addSubItem($sub_cb); */ $this->form->addItem($cb); // delete inactivated user accounts require_once 'Services/User/classes/class.ilCronDeleteInactivatedUserAccounts.php'; $cb = new ilCheckboxInputGUI($this->lng->txt("delete_inactivated_user_accounts"), "cron_inactivated_user_delete"); $cb->setInfo($this->lng->txt("delete_inactivated_user_accounts_desc")); if ($ilSetting->get("cron_inactivated_user_delete", false)) { $cb->setChecked(true); } $sub_list = new ilSelectInputGUI($this->lng->txt('delete_inactivated_user_accounts_interval'), 'cron_inactivated_user_delete_interval'); $sub_list->setInfo($this->lng->txt('delete_inactivated_user_accounts_interval_desc')); $sub_list->setOptions(ilCronDeleteInactiveUserAccounts::getPossibleIntervalsArray()); $sub_list->setValue($ilSetting->get('cron_inactivated_user_delete_interval', ilCronDeleteInactiveUserAccounts::getDefaultIntervalKey())); $cb->addSubItem($sub_list); include_once 'Services/Form/classes/class.ilMultiSelectInputGUI.php'; $sub_mlist = new ilMultiSelectInputGUI($this->lng->txt('delete_inactivated_user_accounts_include_roles'), 'cron_inactivated_user_delete_include_roles'); $sub_mlist->setInfo($this->lng->txt('delete_inactivated_user_accounts_include_roles_desc')); $roles = array(); foreach ($rbacreview->getGlobalRoles() as $role_id) { if ($role_id != ANONYMOUS_ROLE_ID) { $roles[$role_id] = $ilObjDataCache->lookupTitle($role_id); } } $sub_mlist->setOptions($roles); $setting = $ilSetting->get('cron_inactivated_user_delete_include_roles', null); if ($setting === null) { $setting = array(); } else { $setting = explode(',', $setting); } $sub_mlist->setValue($setting); $sub_mlist->setWidth(300); #$sub_mlist->setHeight(100); $cb->addSubItem($sub_mlist); $default_setting = ilCronDeleteInactiveUserAccounts::DEFAULT_INACTIVITY_PERIOD; $sub_text = new ilTextInputGUI($this->lng->txt('delete_inactivated_user_accounts_period'), 'cron_inactivated_user_delete_period'); $sub_text->setInfo($this->lng->txt('delete_inactivated_user_accounts_period_desc')); $sub_text->setValue($ilSetting->get("cron_inactivated_user_delete_period", $default_setting)); $sub_text->setSize(2); $sub_text->setMaxLength(3); $cb->addSubItem($sub_text); /* $default_setting = ilCronDeleteInactiveUserAccounts::DEFAULT_SETTING_INCLUDE_ADMINS; $sub_cb = new ilCheckboxInputGUI($this->lng->txt('delete_inactivated_user_accounts_include_admins'),'cron_inactivated_user_delete_include_admins'); $sub_cb->setChecked($ilSetting->get("cron_inactivated_user_delete_include_admins", $default_setting) ? 1 : 0 ); //$sub_cb->setOptionTitle($this->lng->txt('delete_inactivated_user_accounts_include_admins')); $sub_cb->setInfo($this->lng->txt('delete_inactivated_user_accounts_include_admins_desc')); $cb->addSubItem($sub_cb); */ $this->form->addItem($cb); // link check $cb = new ilCheckboxInputGUI($this->lng->txt("check_link"), "cron_link_check"); $cb->setInfo($this->lng->txt("check_link_desc")); if ($ilSetting->get("cron_link_check")) { $cb->setChecked(true); } $this->form->addItem($cb); // check web resources $options = array("0" => $lng->txt("never"), "1" => $lng->txt("daily"), "2" => $lng->txt("weekly"), "3" => $lng->txt("monthly"), "4" => $lng->txt("quarterly")); $si = new ilSelectInputGUI($this->lng->txt("check_web_resources"), "cron_web_resource_check"); $si->setOptions($options); $si->setInfo($this->lng->txt("check_web_resources_desc")); $si->setValue($ilSetting->get("cron_web_resource_check")); $this->form->addItem($si); // update lucene $cb = new ilCheckboxInputGUI($this->lng->txt("cron_lucene_index"), "cron_lucene_index"); $cb->setInfo($this->lng->txt("cron_lucene_index_info")); if ($ilSetting->get("cron_lucene_index")) { $cb->setChecked(true); } $this->form->addItem($cb); // forum notifications $options = array("0" => $lng->txt("cron_forum_notification_never"), "1" => $lng->txt("cron_forum_notification_directly"), "2" => $lng->txt("cron_forum_notification_cron")); $si = new ilSelectInputGUI($this->lng->txt("cron_forum_notification"), "forum_notification"); $si->setOptions($options); $si->setInfo($this->lng->txt("cron_forum_notification_desc")); $si->setValue($ilSetting->get("forum_notification")); $this->form->addItem($si); // mail notifications $options = array("0" => $lng->txt("cron_mail_notification_never"), "1" => $lng->txt("cron_mail_notification_cron")); $si = new ilSelectInputGUI($this->lng->txt("cron_mail_notification"), "mail_notification"); $si->setOptions($options); $si->setInfo($this->lng->txt("cron_mail_notification_desc")); $si->setValue($ilSetting->get("mail_notification")); $this->form->addItem($si); if ($ilSetting->get("mail_notification") == '1') { $cb = new ilCheckboxInputGUI($this->lng->txt("cron_mail_notification_message"), "mail_notification_message"); $cb->setInfo($this->lng->txt("cron_mail_notification_message_info")); if ($ilSetting->get("mail_notification_message")) { $cb->setChecked(true); } $this->form->addItem($cb); } // disk quota and disk quota reminder mail $dq_settings = new ilSetting('disk_quota'); $cb = new ilCheckboxInputGUI($this->lng->txt("enable_disk_quota"), "enable_disk_quota"); $cb->setInfo($this->lng->txt("enable_disk_quota_info")); if ($dq_settings->get('enabled')) { $cb->setChecked(true); } $this->form->addItem($cb); $cb_reminder = new ilCheckboxInputGUI($this->lng->txt("enable_disk_quota_reminder_mail"), "enable_disk_quota_reminder_mail"); $cb_reminder->setInfo($this->lng->txt("disk_quota_reminder_mail_desc")); if ($dq_settings->get('reminder_mail_enabled')) { $cb_reminder->setChecked(true); } $cb->addSubItem($cb_reminder); // Enable summary mail for certain users $cb_prop_summary = new ilCheckboxInputGUI($lng->txt("enable_disk_quota_summary_mail"), "enable_disk_quota_summary_mail"); $cb_prop_summary->setValue(1); $cb_prop_summary->setChecked((int) $dq_settings->get('summary_mail_enabled', 0) == 1); $cb_prop_summary->setInfo($lng->txt('enable_disk_quota_summary_mail_desc')); $cb->addSubItem($cb_prop_summary); // Edit disk quota recipients $summary_rcpt = new ilTextInputGUI($lng->txt("disk_quota_summary_rctp"), "disk_quota_summary_rctp"); $summary_rcpt->setValue($dq_settings->get('summary_rcpt', '')); $summary_rcpt->setInfo($lng->txt('disk_quota_summary_rctp_desc')); $cb_prop_summary->addSubItem($summary_rcpt); // Enable payment notifications $payment_noti = new ilCheckboxInputGUI($lng->txt("payment_notification"), "payment_notification"); $payment_noti->setValue(1); $payment_noti->setChecked((int) $ilSetting->get('payment_notification', 0) == 1); $payment_noti->setInfo($lng->txt('payment_notification_desc')); $num_days = new ilNumberInputGUI($this->lng->txt('payment_notification_days'), 'payment_notification_days'); $num_days->setSize(3); $num_days->setMinValue(0); $num_days->setMaxValue(120); $num_days->setRequired(true); $num_days->setValue($ilSetting->get('payment_notification_days')); $num_days->setInfo($lng->txt('payment_notification_days_desc')); $payment_noti->addSubItem($num_days); $this->form->addItem($payment_noti); // reset payment incremental invoice number $inv_options = array("1" => $lng->txt("yearly"), "2" => $lng->txt("monthly")); include_once './Services/Payment/classes/class.ilUserDefinedInvoiceNumber.php'; if (ilUserDefinedInvoiceNumber::_isUDInvoiceNumberActive()) { $inv_reset = new ilSelectInputGUI($this->lng->txt("invoice_number_reset_period"), "invoice_number_reset_period"); $inv_reset->setOptions($inv_options); $inv_reset->setInfo($this->lng->txt("invoice_number_reset_period_desc")); $inv_reset->setValue(ilUserDefinedInvoiceNumber::_getResetPeriod()); $this->form->addItem($inv_reset); } else { $inv_info = new ilNonEditableValueGUI($this->lng->txt('invoice_number_reset_period'), 'invoice_number_reset_period'); $inv_info->setInfo($lng->txt('payment_userdefined_invoice_number_not_activated')); $this->form->addItem($inv_info); } // course/group notifications $crsgrp_ntf = new ilCheckboxInputGUI($this->lng->txt("enable_course_group_notifications"), "crsgrp_ntf"); $crsgrp_ntf->setInfo($this->lng->txt("enable_course_group_notifications_desc")); if ($ilSetting->get('crsgrp_ntf')) { $crsgrp_ntf->setChecked(true); } $this->form->addItem($crsgrp_ntf); $this->form->addCommandButton("saveCronJobs", $lng->txt("save")); $this->form->setTitle($lng->txt("cron_jobs")); $this->form->setDescription($lng->txt("cron_jobs_desc")); $this->form->setFormAction($this->ctrl->getFormAction($this)); }
/** * Init form */ protected function initForm() { $this->setFormAction($this->ctrl->getFormAction($this->parent_gui)); $title = $this->isNew ? $this->pl->txt('add_new_type') : $this->pl->txt('edit_type'); $this->setTitle($title); $item = new ilTextInputGUI($this->lng->txt('title'), 'title'); $item->setRequired(true); $item->setValue($this->type->getTitle()); $this->addItem($item); $item = new ilTextAreaInputGUI($this->lng->txt('description'), 'description'); $item->setValue($this->type->getDescription()); $this->addItem($item); $item = new ilMultiSelectInputGUI($this->lng->txt('languages'), 'languages'); $item->setWidth(self::WIDTH_MULTISELECT_INPUT); $langs = $this->lng->getInstalledLanguages(); $options = array(); foreach ($langs as $lang_code) { $options[$lang_code] = $this->lng->txt("meta_l_{$lang_code}"); } $item->setOptions($options); $item->setValue($this->type->getLanguages()); $item->setRequired(true); $this->addItem($item); $item = new ilMultiSelectInputGUI($this->lng->txt('roles'), 'roles'); $item->setWidth(self::WIDTH_MULTISELECT_INPUT); $roles = $this->rbac->getRolesByFilter(ilRbacReview::FILTER_ALL, 0, ''); $options = array(); $hide_roles = array(14, 5); foreach ($roles as $role) { if (strpos($role['title'], 'il_') === 0 || in_array($role['obj_id'], $hide_roles)) { // Don't show auto-generated roles. If this takes to much performance, write query... continue; } $options[$role['obj_id']] = $role['title']; } $item->setOptions($options); $item->setValue($this->type->getRoles()); $item->setInfo($this->pl->txt('roles_info')); $this->addItem($item); $item = new ilMultiSelectInputGUI($this->pl->txt('available_objects'), 'available_objects'); $item->setWidth(self::WIDTH_MULTISELECT_INPUT); $options = array(); foreach (srCertificateType::getAllAvailableObjectTypes() as $type) { $options[$type] = $type; } $item->setOptions($options); $item->setValue($this->type->getAvailableObjects()); $item->setRequired(true); $item->setInfo($this->pl->txt('available_objects_info')); $this->addItem($item); $this->addCommandButton('saveType', $this->lng->txt('save')); }
protected function initForm() { global $rbacreview, $ilUser; $this->setTitle($this->txt('title')); // Course templates $item = new ilCheckboxInputGUI($this->txt('course_templates'), 'course_templates'); $item->setInfo($this->txt('course_templates_info')); $subitem = new ilTextAreaInputGUI($this->txt('course_templates_ref_ids'), 'course_templates_ref_ids'); $subitem->setInfo($this->txt('course_templates_ref_ids_info')); $item->addSubItem($subitem); $this->addItem($item); // UTC $item = new ilCheckboxInputGUI($this->txt('time_format_utc'), 'time_format_utc'); $item->setInfo($this->txt('time_format_utc')); $this->addItem($item); // Date format $item = new ilTextInputGUI($this->txt('str_format_date'), 'str_format_date'); $item->setInfo($this->txt('str_format_date_info')); $item->setRequired(true); $this->addItem($item); // Datetime format $item = new ilTextInputGUI($this->txt('str_format_datetime'), 'str_format_datetime'); $item->setInfo($this->txt('str_format_datetime_info')); $item->setRequired(true); $this->addItem($item); // Max diff LP seconds $item = new ilNumberInputGUI($this->txt('max_diff_lp_seconds'), 'max_diff_lp_seconds'); $item->setInfo($this->txt('max_diff_lp_seconds_info')); $this->addItem($item); // Hook class $item = new ilTextInputGUI($this->txt('path_hook_class'), 'path_hook_class'); $item->setInfo($this->txt('path_hook_class_info')); $this->addItem($item); //Call Back email $item = new ilTextInputGUI($this->txt('callback_email'), 'callback_email'); $item->setInfo($this->txt('callback_email_info')); $this->addItem($item); //disk space Warning $item = new ilTextInputGUI($this->txt('disk_space_warning'), 'disk_space_warning'); $item->setInfo($this->txt('disk_space_warning_info')); $this->addItem($item); $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->txt('permission_settings')); $this->addItem($section); /** @var ilRbacReview $rbacreview $roles */ $roles = array(); foreach ($rbacreview->getGlobalRoles() as $role_id) { $roles[$role_id] = ilObject::_lookupTitle($role_id); } // Administrate types $item = new ilMultiSelectInputGUI($this->txt('roles_administrate_certificate_types'), 'roles_administrate_certificate_types'); $item->setOptions($roles); $item->setInfo($this->txt('roles_administrate_certificate_types_info')); $item->setWidth(272); $item->setHeight(165); $this->addItem($item); // Administrate certificates $item = new ilMultiSelectInputGUI($this->txt('roles_administrate_certificates'), 'roles_administrate_certificates'); $item->setOptions($roles); $item->setInfo($this->txt('roles_administrate_certificates_info')); $item->setWidth(272); $item->setHeight(165); $this->addItem($item); // Jasper Reports $section = new ilFormSectionHeaderGUI(); $section->setTitle('Jasper Reports'); $this->addItem($section); $item = new ilTextInputGUI($this->txt('jasper_locale'), 'jasper_locale'); $item->setInfo($this->txt('jasper_locale_info')); $this->addItem($item); $item = new ilTextInputGUI($this->txt('jasper_path_java'), 'jasper_path_java'); $this->addItem($item); // Notification $section = new ilFormSectionHeaderGUI(); $section->setTitle($this->lng->txt('notifications')); $this->addItem($section); $item = new ilTextInputGUI($this->txt('notification_user_subject'), 'notification_user_subject'); $this->addItem($item); $item = new ilTextAreaInputGUI($this->txt('notification_user_body'), 'notification_user_body'); $item->setRows(10); $item->setCols(100); $this->addItem($item); $item = new ilTextInputGUI($this->txt('notification_others_subject'), 'notification_others_subject'); $this->addItem($item); $item = new ilTextAreaInputGUI($this->txt('notification_others_body'), 'notification_others_body'); $item->setRows(10); $item->setCols(100); $this->addItem($item); $this->addCommandButtons(); }