39 $this->ctrl = $DIC->ctrl();
40 $this->lng = $DIC->language();
41 $this->lng->loadLanguageModule(
'orgu');
42 $this->tpl = $DIC->ui()->mainTemplate();
46 $this->ctrl->redirectByClass(ilObjOrgUnitGUI::class);
56 $cmd = $this->ctrl->getCmd(
'settings');
57 $next_class = $this->ctrl->getNextClass($this);
59 switch ($next_class) {
77 $this->tpl->setContent($form->getHTML());
89 $form->setFormAction($this->ctrl->getFormAction($this,
'saveSettings'));
93 $section->setTitle($this->lng->txt(
'orgu_enable_my_staff'));
96 $item =
new ilCheckboxInputGUI($this->lng->txt(
"orgu_enable_my_staff"),
"enable_my_staff");
97 $item->
setInfo($this->lng->txt(
"orgu_enable_my_staff_info"));
99 $item->setChecked(($DIC->settings()->get(
"enable_my_staff") ? true :
false));
100 $form->addItem($item);
104 $section->setTitle($this->lng->txt(
'orgu_global_set_positions'));
107 $objDefinition = $DIC[
'objDefinition'];
108 $available_types = $objDefinition->getOrgUnitPermissionTypes();
109 foreach ($available_types as $object_type) {
113 if ($objDefinition->isPlugin($object_type)) {
116 $is_multi = !$objDefinition->isSystemObject($object_type);
117 $lang_prefix = $is_multi ?
'objs_' :
'obj_';
118 $label = $this->lng->txt($lang_prefix . $object_type);
122 $this->lng->txt(
'orgu_global_set_positions_type_active') .
' ' . $label,
123 $object_type .
'_active' 126 $type->setChecked($setting->isActive());
128 $scope =
new ilRadioGroupInputGUI($this->lng->txt(
'orgu_global_set_type_changeable'), $object_type .
'_changeable');
129 $scope->
setValue((
int) $setting->isChangeableForObject());
132 $this->lng->txt(
'orgu_global_set_type_changeable_object'),
135 $default =
new ilCheckboxInputGUI($this->lng->txt(
'orgu_global_set_type_default'), $object_type .
'_default');
136 $default->
setInfo($this->lng->txt(
'orgu_global_set_type_default_info'));
138 $default->setChecked($setting->getActivationDefault());
141 $scope->addOption($scope_object);
144 $this->lng->txt(
'orgu_global_set_type_changeable_no'),
147 $scope->addOption($scope_global);
149 $type->addSubItem($scope);
151 $form->addItem(
$type);
153 $form->addCommandButton(
'saveSettings', $this->lng->txt(
'save'));
159 protected function saveSettings()
165 $objDefinition = $DIC[
'objDefinition'];
167 if ($form->checkInput()) {
169 $available_types = $objDefinition->getOrgUnitPermissionTypes();
170 foreach ($available_types as $object_type) {
172 $obj_setting->setActive((
bool) $form->getInput($object_type .
'_active'));
173 $obj_setting->setActivationDefault((
int) $form->getInput($object_type .
'_default'));
174 $obj_setting->setChangeableForObject((
bool) $form->getInput($object_type
176 $obj_setting->update();
180 $DIC->settings()->set(
"enable_my_staff", (
int) (
$_POST[
"enable_my_staff"] ? 1 : 0));
182 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
183 $this->ctrl->redirect($this,
'settings');
185 $form->setValuesByPost();
This class represents an option in a radio group.
static lookupTxtById($plugin_id, $lang_var)
static _checkAccessSettings(int $ref_id)
__construct()
Default constructor.
setInfo($a_info)
Set Info.
Global orgunit settings GUI.
executeCommand()
Ctrl execute command.
setValue($a_value)
Set Value.
initSettingsForm()
Init settings form.
addSubItem($a_item)
Add Subitem.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
settings(ilPropertyFormGUI $form=null)
Show settings.
Object settings regarding position permissions.