ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjStudyProgrammeSettingsGUI Class Reference

@ilCtrl_Calls ilObjStudyProgrammeSettingsGUI: ilStudyProgrammeCommonSettingsGUI More...

+ Collaboration diagram for ilObjStudyProgrammeSettingsGUI:

Public Member Functions

 __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)
 
 setRefId ($a_ref_id)
 
 executeCommand ()
 

Data Fields

const TAB_SETTINGS = 'settings'
 
const TAB_COMMON_SETTINGS = 'commonSettings'
 
const PROP_TITLE = "title"
 
const PROP_DESC = "desc"
 
const PROP_DEADLINE = "deadline"
 
const PROP_VALIDITY_OF_QUALIFICATION = "validity_qualification"
 
const PROP_ACCESS_CONTROL_BY_ORGU_POSITION = "access_ctr_by_orgu_position"
 
const OPT_NO_DEADLINE = 'opt_no_deadline'
 
const OPT_DEADLINE_PERIOD = "opt_deadline_period"
 
const OPT_DEADLINE_DATE = "opt_deadline_date"
 
const OPT_NO_VALIDITY_OF_QUALIFICATION = 'opt_no_validity_qualification'
 
const OPT_VALIDITY_OF_QUALIFICATION_PERIOD = "opt_validity_qualification_period"
 
const OPT_VALIDITY_OF_QUALIFICATION_DATE = "opt_validity_qualification_date"
 
 $ctrl
 
 $tpl
 
 $object
 
 $lng
 

Protected Member Functions

 view ()
 
 update ()
 
 buildModalHeading ($label, $current_node)
 
 buildForm (\ilObjStudyProgramme $prg, string $submit_action)
 
 buildFormElements (InputFieldFactory $ff, ilObjectTranslation $trans, array $sp_types, ilObjStudyProgramme $prg)
 
 getEditSection (InputFieldFactory $ff, ilObjectTranslation $trans)
 
 getObject ()
 
 txt (string $code)
 

Protected Attributes

 $tmp_heading
 
 $input_factory
 
 $renderer
 
 $request
 
 $refinery_factory
 
 $ref_id
 
 $data_factory
 
 $type_repository
 
 $common_settings_gui
 
 $tabs
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjStudyProgrammeSettingsGUI::__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 
)

Definition at line 107 of file class.ilObjStudyProgrammeSettingsGUI.php.

119 {
120 $this->tpl = $tpl;
121 $this->ctrl = $ilCtrl;
122 $this->lng = $lng;
123 $this->input_factory = $input_factory;
124 $this->renderer = $renderer;
125 $this->request = $request;
126 $this->refinery_factory = $refinery_factory;
127 $this->data_factory = $data_factory;
128 $this->type_repository = $type_repository;
129 $this->object = null;
130 $this->common_settings_gui = $common_settings_gui;
131 $this->tabs = $tabs;
132
133 $lng->loadLanguageModule("prg");
134 }
global $ilCtrl
Definition: ilias.php:18

References $common_settings_gui, $data_factory, $ilCtrl, $input_factory, $lng, $refinery_factory, $renderer, $request, $tabs, $tpl, and $type_repository.

Member Function Documentation

◆ buildForm()

ilObjStudyProgrammeSettingsGUI::buildForm ( \ilObjStudyProgramme  $prg,
string  $submit_action 
)
protected

Definition at line 258 of file class.ilObjStudyProgrammeSettingsGUI.php.

262 $trans = $prg->getObjectTranslation();
263 $ff = $this->input_factory->field();
264 $sp_types = $this->type_repository->readAllTypesArray();
265
266 return $this->input_factory->container()->form()->standard(
267 $submit_action,
268 $this->buildFormElements(
269 $ff,
270 $trans,
271 $sp_types,
272 $prg
273 )
275 $this->refinery_factory->custom()->transformation(
276 function ($values) use ($prg) {
277 // to the section they originated from.
278 $object_data = $values[0];
279 $prg->setTitle($object_data[self::PROP_TITLE]);
280 $prg->setDescription($object_data[self::PROP_DESC]);
281
282 $type_settings = $values['prg_type'];
283 $type = $type_settings->getTypeId();
284 if ($prg->getTypeSettings()->getTypeId() != $type) {
285 $prg->setTypeSettings($type_settings);
286 $prg->updateCustomIcon();
287 }
288
289 $prg->setAssessmentSettings($values['prg_assessment']);
290 $prg->setDeadlineSettings($values['prg_deadline']);
291 $prg->setValidityOfQualificationSettings(
292 $values['prg_validity_of_qualification']
293 );
294
295 $prg->setAutoMailSettings($values["automail_settings"]);
296
297 return $prg;
298 }
299 )
300 );
301 }
buildFormElements(InputFieldFactory $ff, ilObjectTranslation $trans, array $sp_types, ilObjStudyProgramme $prg)
This describes commonalities between all forms.
Definition: Form.php:16
withAdditionalTransformation(Transformation $trafo)
Apply a transformation to the data of the form.
$type

References $type, ilObjStudyProgramme\getTypeSettings(), ilObjStudyProgramme\setAssessmentSettings(), ilObjStudyProgramme\setAutoMailSettings(), ilObjStudyProgramme\setDeadlineSettings(), ilObject\setDescription(), ilObject\setTitle(), and ilObjStudyProgramme\setValidityOfQualificationSettings().

Referenced by view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFormElements()

ilObjStudyProgrammeSettingsGUI::buildFormElements ( InputFieldFactory  $ff,
ilObjectTranslation  $trans,
array  $sp_types,
ilObjStudyProgramme  $prg 
)
protected

Definition at line 303 of file class.ilObjStudyProgrammeSettingsGUI.php.

308 : array {
309 global $DIC;
310 $ilLng = $DIC->language();
311 $refinery = $DIC["refinery"];
312
313 $return = [
314 $this->getEditSection($ff, $trans),
315 "prg_type" => $prg
317 ->toFormInput($ff, $ilLng, $refinery, $sp_types)
318 ,
319 "prg_assessment" => $prg
321 ->toFormInput($ff, $ilLng, $refinery)
322 ,
323 "prg_deadline" => $prg
325 ->toFormInput($ff, $ilLng, $refinery, $this->data_factory)
326 ,
327 "prg_validity_of_qualification" => $prg
329 ->toFormInput($ff, $ilLng, $refinery, $this->data_factory)
330 ,
331 "automail_settings" => $prg
333 ->toFormInput($ff, $ilLng, $refinery)
334 ];
335
336 return $return;
337 }
getEditSection(InputFieldFactory $ff, ilObjectTranslation $trans)
$DIC
Definition: xapitoken.php:46

◆ buildModalHeading()

ilObjStudyProgrammeSettingsGUI::buildModalHeading (   $label,
  $current_node 
)
protected

Definition at line 232 of file class.ilObjStudyProgrammeSettingsGUI.php.

233 {
234 if (!$current_node) {
235 $this->ctrl->saveParameterByClass('ilobjstudyprogrammesettingsgui', 'ref_id');
236 $heading_button = ilLinkButton::getInstance();
237 $heading_button->setCaption('prg_open_node');
238 $heading_button->setUrl(
239 $this->ctrl->getLinkTargetByClass(
240 'ilobjstudyprogrammetreegui',
241 'view'
242 )
243 );
244
245 $heading =
246 "<div class=''>" .
247 $label .
248 "<div class='pull-right'>" .
249 $heading_button->render() .
250 "</div></div>"
251 ;
252 $this->tmp_heading = $heading;
253 } else {
254 $this->tmp_heading = "<div class=''>" . $label . "</div>";
255 }
256 }
static getInstance()
Factory.

References ilLinkButton\getInstance().

Referenced by view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjStudyProgrammeSettingsGUI::executeCommand ( )

Definition at line 141 of file class.ilObjStudyProgrammeSettingsGUI.php.

142 {
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);
149 break;
150 default:
151 $cmd = $this->ctrl->getCmd();
152 if ($cmd == "") {
153 $cmd = "view";
154 }
155 switch ($cmd) {
156 case "view":
157 $content = $this->view();
158 break;
159 case "update":
160 $content = $this->$cmd();
161 break;
162 default:
163 throw new ilException(
164 "ilObjStudyProgrammeSettingsGUI: " . "Command not supported: $cmd"
165 );
166 }
167 }
168
169 if (!$this->ctrl->isAsynch()) {
170 $this->tpl->setContent($content);
171 } else {
172 $output_handler = new ilAsyncOutputHandler();
173 $heading = $this->lng->txt("prg_async_" . $this->ctrl->getCmd());
174 if (isset($this->tmp_heading)) {
175 $heading = $this->tmp_heading;
176 }
177 $output_handler->setHeading($heading);
178 $output_handler->setContent($content);
179 $output_handler->terminate();
180 }
181 }
Class ilAsyncOutputHandler Handles the output for async-requests.
Base class for ILIAS Exception handling.

References $tmp_heading, getObject(), and view().

+ Here is the call graph for this function:

◆ getEditSection()

ilObjStudyProgrammeSettingsGUI::getEditSection ( InputFieldFactory  $ff,
ilObjectTranslation  $trans 
)
protected

Definition at line 339 of file class.ilObjStudyProgrammeSettingsGUI.php.

342 {
343 $languages = ilMDLanguageItem::_getLanguages();
344 return $ff->section(
345 [
346 self::PROP_TITLE =>
347 $ff->text($this->txt("title"))
348 ->withValue($trans->getDefaultTitle())
349 ->withRequired(true),
350 self::PROP_DESC =>
351 $ff->textarea($this->txt("description"))
352 ->withValue($trans->getDefaultDescription() ?? "")
353 ],
354 $this->txt("prg_edit"),
355 $this->txt("language") . ": " . $languages[$trans->getDefaultLanguage()] .
356 ' <a href="' . $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", "") .
357 '">&raquo; ' . $this->txt("obj_more_translations") . '</a>'
358 );
359 }
getDefaultTitle()
Get default title.
getDefaultDescription()
Get default description.
getDefaultLanguage()
Get default language.

References ilMDLanguageItem\_getLanguages(), ilObjectTranslation\getDefaultDescription(), ilObjectTranslation\getDefaultLanguage(), and ilObjectTranslation\getDefaultTitle().

+ Here is the call graph for this function:

◆ getObject()

ilObjStudyProgrammeSettingsGUI::getObject ( )
protected

Definition at line 361 of file class.ilObjStudyProgrammeSettingsGUI.php.

362 {
363 if ($this->object === null) {
364 $this->object = ilObjStudyProgramme::getInstanceByRefId($this->ref_id);
365 }
366 return $this->object;
367 }
static getInstanceByRefId($a_ref_id)

References ilObjStudyProgramme\getInstanceByRefId().

Referenced by executeCommand(), update(), and view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRefId()

ilObjStudyProgrammeSettingsGUI::setRefId (   $a_ref_id)

Definition at line 136 of file class.ilObjStudyProgrammeSettingsGUI.php.

137 {
138 $this->ref_id = $a_ref_id;
139 }

◆ txt()

ilObjStudyProgrammeSettingsGUI::txt ( string  $code)
protected

Definition at line 369 of file class.ilObjStudyProgrammeSettingsGUI.php.

369 : string
370 {
371 return $this->lng->txt($code);
372 }

◆ update()

ilObjStudyProgrammeSettingsGUI::update ( )
protected

Definition at line 191 of file class.ilObjStudyProgrammeSettingsGUI.php.

192 {
193 $form = $this
194 ->buildForm($this->getObject(), $this->ctrl->getFormAction($this, "update"))
195 ->withRequest($this->request);
196
197 $result = $form->getInputGroup()->getContent();
198
199 // This could further improved by providing a new container for asynch-forms in the
200 // UI-Framework.
201
202 if ($result->isOK()) {
203 $result->value()->update();
204 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
205
206 if ($this->ctrl->isAsynch()) {
208 array(
209 "success" => true,
210 "message" => $this->lng->txt("msg_obj_modified"))
211 );
212 return ilAsyncOutputHandler::handleAsyncOutput($form->getHTML(), $response, false);
213 } else {
214 $this->ctrl->redirect($this);
215 }
216 } else {
217 ilUtil::sendFailure($this->lng->txt("msg_form_save_error"));
218
219 if ($this->ctrl->isAsynch()) {
221 array(
222 "success" => false,
223 "errors" => $form->getErrors())
224 );
225 return ilAsyncOutputHandler::handleAsyncOutput($form->getHTML(), $response, false);
226 } else {
227 return $this->renderer->render($form);
228 }
229 }
230 }
$result
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.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$response

References $response, $result, ilAsyncOutputHandler\encodeAsyncResponse(), getObject(), ilAsyncOutputHandler\handleAsyncOutput(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ view()

ilObjStudyProgrammeSettingsGUI::view ( )
protected

Definition at line 183 of file class.ilObjStudyProgrammeSettingsGUI.php.

184 {
185 $this->buildModalHeading($this->lng->txt('prg_async_settings'), isset($_GET["currentNode"]));
186
187 $form = $this->buildForm($this->getObject(), $this->ctrl->getFormAction($this, "update"));
188 return $this->renderer->render($form);
189 }
$_GET["client_id"]
buildForm(\ilObjStudyProgramme $prg, string $submit_action)

References $_GET, buildForm(), buildModalHeading(), and getObject().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $common_settings_gui

ilObjStudyProgrammeSettingsGUI::$common_settings_gui
protected

Definition at line 100 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $ctrl

ilObjStudyProgrammeSettingsGUI::$ctrl

Definition at line 40 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ $data_factory

ilObjStudyProgrammeSettingsGUI::$data_factory
protected

Definition at line 90 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $input_factory

ilObjStudyProgrammeSettingsGUI::$input_factory
protected

Definition at line 65 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $lng

ilObjStudyProgrammeSettingsGUI::$lng

Definition at line 55 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $object

ilObjStudyProgrammeSettingsGUI::$object

Definition at line 50 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ $ref_id

ilObjStudyProgrammeSettingsGUI::$ref_id
protected

Definition at line 85 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ $refinery_factory

ilObjStudyProgrammeSettingsGUI::$refinery_factory
protected

Definition at line 80 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $renderer

ilObjStudyProgrammeSettingsGUI::$renderer
protected

Definition at line 70 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $request

ilObjStudyProgrammeSettingsGUI::$request
protected

Definition at line 75 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $tabs

ilObjStudyProgrammeSettingsGUI::$tabs
protected

Definition at line 105 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $tmp_heading

ilObjStudyProgrammeSettingsGUI::$tmp_heading
protected

Definition at line 60 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by executeCommand().

◆ $tpl

ilObjStudyProgrammeSettingsGUI::$tpl

Definition at line 45 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ $type_repository

ilObjStudyProgrammeSettingsGUI::$type_repository
protected

Definition at line 95 of file class.ilObjStudyProgrammeSettingsGUI.php.

Referenced by __construct().

◆ OPT_DEADLINE_DATE

const ilObjStudyProgrammeSettingsGUI::OPT_DEADLINE_DATE = "opt_deadline_date"

◆ OPT_DEADLINE_PERIOD

const ilObjStudyProgrammeSettingsGUI::OPT_DEADLINE_PERIOD = "opt_deadline_period"

Definition at line 29 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ OPT_NO_DEADLINE

const ilObjStudyProgrammeSettingsGUI::OPT_NO_DEADLINE = 'opt_no_deadline'

◆ OPT_NO_VALIDITY_OF_QUALIFICATION

const ilObjStudyProgrammeSettingsGUI::OPT_NO_VALIDITY_OF_QUALIFICATION = 'opt_no_validity_qualification'

◆ OPT_VALIDITY_OF_QUALIFICATION_DATE

const ilObjStudyProgrammeSettingsGUI::OPT_VALIDITY_OF_QUALIFICATION_DATE = "opt_validity_qualification_date"

◆ OPT_VALIDITY_OF_QUALIFICATION_PERIOD

const ilObjStudyProgrammeSettingsGUI::OPT_VALIDITY_OF_QUALIFICATION_PERIOD = "opt_validity_qualification_period"

Definition at line 33 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_ACCESS_CONTROL_BY_ORGU_POSITION

const ilObjStudyProgrammeSettingsGUI::PROP_ACCESS_CONTROL_BY_ORGU_POSITION = "access_ctr_by_orgu_position"

Definition at line 26 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_DEADLINE

const ilObjStudyProgrammeSettingsGUI::PROP_DEADLINE = "deadline"

Definition at line 24 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_DESC

const ilObjStudyProgrammeSettingsGUI::PROP_DESC = "desc"

Definition at line 23 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_TITLE

const ilObjStudyProgrammeSettingsGUI::PROP_TITLE = "title"

Definition at line 22 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ PROP_VALIDITY_OF_QUALIFICATION

const ilObjStudyProgrammeSettingsGUI::PROP_VALIDITY_OF_QUALIFICATION = "validity_qualification"

Definition at line 25 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ TAB_COMMON_SETTINGS

const ilObjStudyProgrammeSettingsGUI::TAB_COMMON_SETTINGS = 'commonSettings'

Definition at line 20 of file class.ilObjStudyProgrammeSettingsGUI.php.

◆ TAB_SETTINGS

const ilObjStudyProgrammeSettingsGUI::TAB_SETTINGS = 'settings'

Definition at line 19 of file class.ilObjStudyProgrammeSettingsGUI.php.


The documentation for this class was generated from the following file: