19declare(strict_types=1);
55 protected Psr\Http\Message\ServerRequestInterface
$request;
74 Psr\Http\Message\ServerRequestInterface
$request,
84 $this->
ctrl = $ilCtrl;
109 $next_class = $this->
ctrl->getNextClass();
110 switch ($next_class) {
111 case 'ilstudyprogrammecommonsettingsgui':
112 $this->
tabs->activateSubTab(self::TAB_COMMON_SETTINGS);
113 $this->common_settings_gui->setObject($this->
getObject());
114 $content = $this->
ctrl->forwardCommand($this->common_settings_gui);
117 $cmd = $this->
ctrl->getCmd();
118 if ($cmd ===
"" || $cmd ===
null) {
123 $content = $this->
view();
126 $content = $this->$cmd();
130 "ilObjStudyProgrammeSettingsGUI: Command not supported: $cmd"
135 $this->tpl->setContent($content);
138 protected function view(): string
140 $this->tmp_heading =
"<div class=''>" . $this->
lng->txt(
'prg_async_settings') .
"</div>";
142 return $this->
renderer->render($form);
151 ->buildForm($this->
getObject(), $this->
ctrl->getFormAction($this,
"update"))
152 ->withRequest($this->request);
154 $result = $form->getInputGroup()->getContent();
156 if ($result->isOK()) {
157 $result->value()->update();
158 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"msg_obj_modified"),
true);
159 $this->
ctrl->redirect($this);
161 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"msg_form_save_error"));
162 return $this->
renderer->render($form);
168 string $submit_action
170 $trans = $prg->getObjectTranslation();
171 $ff = $this->input_factory->field();
172 $sp_types = $this->type_repository->getAllTypesArray();
175 return $this->input_factory->container()->form()->standard(
183 )->withAdditionalTransformation(
184 $this->refinery_factory->custom()->transformation(
185 function ($values) use ($prg) {
186 $object_data = $values[0];
187 $prg->
setTitle($object_data[self::PROP_TITLE]);
191 ->withAssessmentSettings($values[
'prg_assessment'])
192 ->withDeadlineSettings($values[
'prg_deadline'])
193 ->withValidityOfQualificationSettings($values[
'prg_validity_of_qualification'])
194 ->withAutoMailSettings($values[
'automail_settings'])
195 ->withTypeSettings($values[
'prg_type']);
206 InputFieldFactory $ff,
212 $this->getEditSection($ff, $trans),
213 "prg_type" => $settings
215 ->toFormInput($ff, $this->
lng, $this->refinery_factory, $sp_types)
217 "prg_assessment" => $settings
218 ->getAssessmentSettings()
219 ->toFormInput($ff, $this->
lng, $this->refinery_factory)
221 "prg_deadline" => $settings
222 ->getDeadlineSettings()
223 ->toFormInput($ff, $this->
lng, $this->refinery_factory, $this->data_factory)
225 "prg_validity_of_qualification" => $settings
226 ->getValidityOfQualificationSettings()
227 ->toFormInput($ff, $this->
lng, $this->refinery_factory, $this->data_factory)
229 "automail_settings" => $settings
230 ->getAutoMailSettings()
231 ->toFormInput($ff, $this->
lng, $this->refinery_factory)
238 InputFieldFactory $ff,
242 foreach ($this->lom_services->dataHelper()->getAllLanguages() as $language) {
244 $lang = $language->presentableLabel();
250 $ff->text($this->txt(
"title"))
252 ->withRequired(
true),
254 $ff->textarea($this->txt(
"description"))
257 $this->txt(
"prg_edit"),
258 $this->txt(
"language") .
": " . $lang .
259 ' <a href="' . $this->ctrl->getLinkTargetByClass(TranslationGUI::class,
"") .
260 '">» ' . $this->txt(
"obj_more_translations") .
'</a>'
266 if ($this->
object ===
null) {
269 return $this->object;
272 protected function txt(
string $code): string
274 return $this->
lng->txt($code);
GUI class for object translation handling.
Class handles translation mode for an object.
Class ilCtrl provides processing control methods.
Base class for ILIAS Exception handling.
loadLanguageModule(string $a_module)
Load language module.
@ilCtrl_Calls ilObjStudyProgrammeSettingsGUI: ilStudyProgrammeCommonSettingsGUI
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
ilObjStudyProgramme $object
ilStudyProgrammeCommonSettingsGUI $common_settings_gui
const OPT_NO_VALIDITY_OF_QUALIFICATION
const PROP_VALIDITY_OF_QUALIFICATION
ILIAS UI Component Input Factory $input_factory
const OPT_VALIDITY_OF_QUALIFICATION_DATE
getEditSection(InputFieldFactory $ff, Translations $trans)
const OPT_DEADLINE_PERIOD
buildFormElements(InputFieldFactory $ff, Translations $trans, array $sp_types, ilStudyProgrammeSettings $settings)
buildForm(ilObjStudyProgramme $prg, string $submit_action)
const TAB_COMMON_SETTINGS
__construct(ilGlobalTemplateInterface $tpl, ilCtrl $ilCtrl, ilLanguage $lng, Factory $input_factory, Renderer $renderer, Psr\Http\Message\ServerRequestInterface $request, ILIAS\Refinery\Factory $refinery_factory, ILIAS\Data\Factory $data_factory, ilStudyProgrammeTypeRepository $type_repository, ilStudyProgrammeCommonSettingsGUI $common_settings_gui, ilTabsGUI $tabs, ILIAS\HTTP\Wrapper\RequestWrapper $request_wrapper, LOMServices $lom_services)
LOMServices $lom_services
ILIAS Data Factory $data_factory
ILIAS Refinery Factory $refinery_factory
ilStudyProgrammeTypeRepository $type_repository
const OPT_VALIDITY_OF_QUALIFICATION_PERIOD
ILIAS UI Renderer $renderer
Psr Http Message ServerRequestInterface $request
ilGlobalTemplateInterface $tpl
updateSettings(ilStudyProgrammeSettings $settings)
static getInstanceByRefId($ref_id)
setDescription(string $description)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface RequestWrapper.
An entity that renders components to a string output.
Covers the persistence of sp-type related information.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.