3declare(strict_types=1);
8use GuzzleHttp\Psr7\ServerRequest;
121 $this->ctrl = $ilCtrl;
129 $this->
object =
null;
133 $lng->loadLanguageModule(
"prg");
138 $this->ref_id = $a_ref_id;
143 $next_class = $this->ctrl->getNextClass();
144 switch ($next_class) {
145 case 'ilstudyprogrammecommonsettingsgui':
146 $this->tabs->activateSubTab(self::TAB_COMMON_SETTINGS);
147 $this->common_settings_gui->setObject($this->
getObject());
148 $content = $this->ctrl->forwardCommand($this->common_settings_gui);
151 $cmd = $this->ctrl->getCmd();
157 $content = $this->
view();
160 $content = $this->$cmd();
164 "ilObjStudyProgrammeSettingsGUI: " .
"Command not supported: $cmd"
169 if (!$this->ctrl->isAsynch()) {
170 $this->tpl->setContent($content);
173 $heading = $this->lng->txt(
"prg_async_" . $this->ctrl->getCmd());
174 if (isset($this->tmp_heading)) {
177 $output_handler->setHeading($heading);
178 $output_handler->setContent($content);
179 $output_handler->terminate();
187 $form = $this->
buildForm($this->
getObject(), $this->ctrl->getFormAction($this,
"update"));
188 return $this->renderer->render($form);
194 ->buildForm($this->
getObject(), $this->ctrl->getFormAction($this,
"update"))
195 ->withRequest($this->request);
197 $result = $form->getInputGroup()->getContent();
204 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
206 if ($this->ctrl->isAsynch()) {
210 "message" => $this->lng->txt(
"msg_obj_modified"))
214 $this->ctrl->redirect($this);
219 if ($this->ctrl->isAsynch()) {
223 "errors" => $form->getErrors())
227 return $this->renderer->render($form);
234 if (!$current_node) {
235 $this->ctrl->saveParameterByClass(
'ilobjstudyprogrammesettingsgui',
'ref_id');
237 $heading_button->setCaption(
'prg_open_node');
238 $heading_button->setUrl(
239 $this->ctrl->getLinkTargetByClass(
240 'ilobjstudyprogrammetreegui',
248 "<div class='pull-right'>" .
249 $heading_button->render() .
252 $this->tmp_heading = $heading;
254 $this->tmp_heading =
"<div class=''>" . $label .
"</div>";
260 string $submit_action
261 ) :
ILIAS\
UI\Component\Input\Container\Form\Form {
262 $trans = $prg->getObjectTranslation();
263 $ff = $this->input_factory->field();
264 $sp_types = $this->type_repository->getAllTypesArray();
267 return $this->input_factory->container()->form()->standard(
275 )->withAdditionalTransformation(
276 $this->refinery_factory->custom()->transformation(
277 function ($values) use ($prg) {
278 $object_data = $values[0];
279 $prg->
setTitle($object_data[self::PROP_TITLE]);
283 ->withAssessmentSettings($values[
'prg_assessment'])
284 ->withDeadlineSettings($values[
'prg_deadline'])
285 ->withValidityOfQualificationSettings($values[
'prg_validity_of_qualification'])
286 ->withAutoMailSettings($values[
'automail_settings'])
287 ->withTypeSettings($values[
'prg_type']);
298 InputFieldFactory $ff,
304 $ilLng =
$DIC->language();
305 $refinery =
$DIC[
"refinery"];
308 $this->getEditSection($ff, $trans),
309 "prg_type" => $settings
311 ->toFormInput($ff, $ilLng, $refinery, $sp_types)
313 "prg_assessment" => $settings
315 ->toFormInput($ff, $ilLng, $refinery)
317 "prg_deadline" => $settings
319 ->toFormInput($ff, $ilLng, $refinery, $this->data_factory)
321 "prg_validity_of_qualification" => $settings
323 ->toFormInput($ff, $ilLng, $refinery, $this->data_factory)
325 "automail_settings" => $settings
327 ->toFormInput($ff, $ilLng, $refinery)
334 InputFieldFactory $ff,
341 $ff->text($this->txt(
"title"))
343 ->withRequired(
true),
345 $ff->textarea($this->txt(
"description"))
348 $this->txt(
"prg_edit"),
350 ' <a href="' . $this->ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
"") .
351 '">» ' . $this->txt(
"obj_more_translations") .
'</a>'
357 if ($this->
object ===
null) {
360 return $this->object;
363 protected function txt(
string $code) : string
365 return $this->lng->txt($code);
An exception for terminatinating execution or to throw for unit testing.
Class ilAsyncOutputHandler Handles the output for async-requests.
static handleAsyncOutput($normal_content, $async_content=null, $apply_to_tpl=true)
Handles async output.
static encodeAsyncResponse(array $data=array())
Encode data as json for async output.
This class provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
@ilCtrl_Calls ilObjStudyProgrammeSettingsGUI: ilStudyProgrammeCommonSettingsGUI
__construct(\ilGlobalTemplateInterface $tpl, \ilCtrl $ilCtrl, \ilLanguage $lng, Factory $input_factory, Renderer $renderer, ServerRequest $request, \ILIAS\Refinery\Factory $refinery_factory, \ILIAS\Data\Factory $data_factory, ilStudyProgrammeTypeRepository $type_repository, ilStudyProgrammeCommonSettingsGUI $common_settings_gui, ilTabsGUI $tabs)
const OPT_NO_VALIDITY_OF_QUALIFICATION
buildForm(\ilObjStudyProgramme $prg, string $submit_action)
const PROP_VALIDITY_OF_QUALIFICATION
const OPT_VALIDITY_OF_QUALIFICATION_DATE
buildFormElements(InputFieldFactory $ff, ilObjectTranslation $trans, array $sp_types, ilStudyProgrammeSettings $settings)
getEditSection(InputFieldFactory $ff, ilObjectTranslation $trans)
const OPT_DEADLINE_PERIOD
const TAB_COMMON_SETTINGS
buildModalHeading($label, $current_node)
const OPT_VALIDITY_OF_QUALIFICATION_PERIOD
const PROP_ACCESS_CONTROL_BY_ORGU_POSITION
updateSettings(ilStudyProgrammeSettings $settings)
static getInstanceByRefId($a_ref_id)
Class handles translation mode for an object.
getDefaultTitle()
Get default title.
getDefaultDescription()
Get default description.
getDefaultLanguage()
Get default language.
setTitle($a_title)
set object title
setDescription($a_desc)
set object description
getValidityOfQualificationSettings()
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
An entity that renders components to a string output.
Covers the persistence of sp-type related information.
Class ChatMainBarProvider \MainMenu\Provider.