ILIAS  release_7 Revision v7.30-3-g800a261c036
ilStudyProgrammeChangeExpireDateGUI Class Reference
+ Collaboration diagram for ilStudyProgrammeChangeExpireDateGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilGlobalTemplateInterface $tpl, ilLanguage $lng, ilAccess $access, ilObjUser $user, Factory $input_factory, Renderer $renderer, ServerRequest $request, \ILIAS\Refinery\Factory $refinery_factory, \ILIAS\Data\Factory $data_factory, ilPRGMessagePrinter $messages)
 
 executeCommand ()
 
 setBackTarget (string $target)
 
 setProgressIds (array $progress_ids)
 
 setRefId (int $ref_id)
 

Data Fields

const CMD_SHOW_EXPIRE_DATE_CONFIG = "showExpireDateConfig"
 
const CMD_CHANGE_EXPIRE_DATE = "changeExpireDate"
 
const PROP_VALIDITY_OF_QUALIFICATION = "validity_qualification"
 

Protected Member Functions

 showExpireDateConfig ()
 
 buildForm (ilObjStudyProgramme $prg, string $submit_action)
 
 getValidityOfQualificationSubForm (ilObjStudyProgramme $prg)
 
 buildFormElements (\ILIAS\UI\Component\Input\Field\Factory $ff, Closure $txt, ilObjStudyProgramme $prg)
 
 changeExpireDate ()
 
 getBackTarget ()
 
 getProgressIds ()
 
 getRefId ()
 
 getObject ()
 
 redirectToParent ()
 

Protected Attributes

 $gui
 
 $ctrl
 
 $tpl
 
 $lng
 
 $access
 
 $user
 
 $back_target
 
 $input_factory
 
 $renderer
 
 $request
 
 $refinery_factory
 
 $data_factory
 
 $progress_ids
 
 $ref_id
 
 $object
 
 $messages
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeChangeExpireDateGUI::__construct ( ilCtrl  $ctrl,
ilGlobalTemplateInterface  $tpl,
ilLanguage  $lng,
ilAccess  $access,
ilObjUser  $user,
Factory  $input_factory,
Renderer  $renderer,
ServerRequest  $request,
\ILIAS\Refinery\Factory  $refinery_factory,
\ILIAS\Data\Factory  $data_factory,
ilPRGMessagePrinter  $messages 
)

Definition at line 99 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

111 {
112 $this->ctrl = $ctrl;
113 $this->tpl = $tpl;
114 $this->lng = $lng;
115 $this->access = $access;
116 $this->user = $user;
117 $this->input_factory = $input_factory;
118 $this->renderer = $renderer;
119 $this->request = $request;
120 $this->refinery_factory = $refinery_factory;
121 $this->data_factory = $data_factory;
122 $this->messages = $messages;
123 }
user()
Definition: user.php:4

References $access, $ctrl, $data_factory, $input_factory, $lng, $messages, $refinery_factory, $renderer, $request, $tpl, $user, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildForm()

ilStudyProgrammeChangeExpireDateGUI::buildForm ( ilObjStudyProgramme  $prg,
string  $submit_action 
)
protected

Definition at line 165 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

165 : Standard
166 {
167 $ff = $this->input_factory->field();
168 $txt = function ($id) {
169 return $this->lng->txt($id);
170 };
171
172 return $this->input_factory->container()->form()->standard(
173 $submit_action,
174 $this->buildFormElements(
175 $ff,
176 $txt,
177 $prg
178 )
179 );
180 }
buildFormElements(\ILIAS\UI\Component\Input\Field\Factory $ff, Closure $txt, ilObjStudyProgramme $prg)
$txt
Definition: error.php:13
This describes a standard form.
Definition: Standard.php:11

References $txt, and buildFormElements().

Referenced by showExpireDateConfig().

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

◆ buildFormElements()

ilStudyProgrammeChangeExpireDateGUI::buildFormElements ( \ILIAS\UI\Component\Input\Field\Factory  $ff,
Closure  $txt,
ilObjStudyProgramme  $prg 
)
protected

Definition at line 212 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

216 : array {
217 return [
218 $ff->section(
219 [
221 ],
222 $txt("prg_validity_of_qualification"),
223 ""
224 )
225 ];
226 }

Referenced by buildForm().

+ Here is the caller graph for this function:

◆ changeExpireDate()

ilStudyProgrammeChangeExpireDateGUI::changeExpireDate ( )
protected

Definition at line 228 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

228 : void
229 {
230 $form = $this
231 ->buildForm($this->getObject(), $this->ctrl->getFormAction($this, "changeExpireDate"))
232 ->withRequest($this->request);
233
234 $result = $form->getInputGroup()->getContent();
235
236 $msg_collection = $this->messages->getMessageCollection('msg_change_expire_date');
237
238 if ($result->isOK()) {
239 $values = $result->value();
240 $programme = $this->getObject();
241 $acting_usr_id = $this->user->getId();
242
243 $vq_data = $values[0][self::PROP_VALIDITY_OF_QUALIFICATION];
244 $vq_type = $vq_data[0];
245 $validity = null;
247 $validity = DateTimeImmutable::createFromFormat('d.m.Y', array_shift($vq_data[1]));
248 if (!$validity) {
249 ilUtil::sendFailure($this->lng->txt('error_updating_expire_date'), true);
250 $this->ctrl->redirectByClass(self::class, self::CMD_SHOW_EXPIRE_DATE_CONFIG);
251 }
252 }
253 foreach ($this->getProgressIds() as $progress_id) {
254 $programme->changeProgressValidityDate($progress_id, $acting_usr_id, $msg_collection, $validity, );
255 }
256
257 $this->messages->showMessages($msg_collection);
258 $this->ctrl->redirectByClass('ilObjStudyProgrammeMembersGUI', 'view');
259 }
260 ilUtil::sendFailure($this->lng->txt('error_updating_expire_date'), true);
261 $this->ctrl->redirectByClass(self::class, self::CMD_SHOW_EXPIRE_DATE_CONFIG);
262 }
$result
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $result, ilObjStudyProgrammeSettingsGUI\OPT_VALIDITY_OF_QUALIFICATION_DATE, ilUtil\sendFailure(), and user().

Referenced by executeCommand().

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

◆ executeCommand()

ilStudyProgrammeChangeExpireDateGUI::executeCommand ( )

Definition at line 125 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

125 : void
126 {
127 $next_class = $this->ctrl->getNextClass($this);
128 $cmd = $this->ctrl->getCmd();
129
130 switch ($next_class) {
131 default:
132 switch ($cmd) {
134 $this->showExpireDateConfig();
135 break;
137 $this->changeExpireDate();
138 break;
139 case 'cancel':
140 $this->redirectToParent();
141 break;
142 default:
143 throw new Exception('Unknown command ' . $cmd);
144 break;
145 }
146 break;
147 }
148 }

References changeExpireDate(), CMD_CHANGE_EXPIRE_DATE, CMD_SHOW_EXPIRE_DATE_CONFIG, redirectToParent(), and showExpireDateConfig().

+ Here is the call graph for this function:

◆ getBackTarget()

ilStudyProgrammeChangeExpireDateGUI::getBackTarget ( )
protected

◆ getObject()

ilStudyProgrammeChangeExpireDateGUI::getObject ( )
protected

Definition at line 294 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

References ilObjStudyProgramme\getInstanceByRefId().

Referenced by showExpireDateConfig().

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

◆ getProgressIds()

ilStudyProgrammeChangeExpireDateGUI::getProgressIds ( )
protected

Definition at line 274 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by showExpireDateConfig().

+ Here is the caller graph for this function:

◆ getRefId()

ilStudyProgrammeChangeExpireDateGUI::getRefId ( )
protected

◆ getValidityOfQualificationSubForm()

ilStudyProgrammeChangeExpireDateGUI::getValidityOfQualificationSubForm ( ilObjStudyProgramme  $prg)
protected

Definition at line 182 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

182 : Input
183 {
184 $ff = $this->input_factory->field();
185 $txt = function ($id) {
186 return $this->lng->txt($id);
187 };
188
190 $format = $this->data_factory->dateFormat()->germanShort();
191 $vq_date_sub_form = $ff
192 ->dateTime('', $txt('validity_qualification_date_desc'))
193 ->withFormat($format);
194 $date = $prg->getSettings()->getValidityOfQualificationSettings()->getQualificationDate();
195 if ($date !== null) {
196 $vq_date_sub_form = $vq_date_sub_form->withValue($date->format($format->toString()));
198 }
199
200 $sg = $ff->switchableGroup(
201 [
203 $ff->group([], $txt('prg_no_validity_qualification')),
205 $ff->group([$vq_date_sub_form], $txt('validity_qualification_date'))
206 ],
207 ''
208 );
209 return $sg->withValue($option);
210 }
This describes commonalities between all inputs.
Definition: Input.php:32
$format
Definition: metadata.php:218

References $format, $txt, ilObjStudyProgramme\getSettings(), ilObjStudyProgrammeSettingsGUI\OPT_NO_VALIDITY_OF_QUALIFICATION, and ilObjStudyProgrammeSettingsGUI\OPT_VALIDITY_OF_QUALIFICATION_DATE.

+ Here is the call graph for this function:

◆ redirectToParent()

ilStudyProgrammeChangeExpireDateGUI::redirectToParent ( )
protected

Definition at line 302 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

References ilUtil\redirect().

Referenced by executeCommand().

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

◆ setBackTarget()

ilStudyProgrammeChangeExpireDateGUI::setBackTarget ( string  $target)

Definition at line 269 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

269 : void
270 {
271 $this->back_target = $target;
272 }

◆ setProgressIds()

ilStudyProgrammeChangeExpireDateGUI::setProgressIds ( array  $progress_ids)

Definition at line 279 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

279 : void
280 {
281 $this->progress_ids = array_map('intval', $progress_ids);
282 }

◆ setRefId()

ilStudyProgrammeChangeExpireDateGUI::setRefId ( int  $ref_id)

Definition at line 289 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

289 : void
290 {
291 $this->ref_id = $ref_id;
292 }

◆ showExpireDateConfig()

ilStudyProgrammeChangeExpireDateGUI::showExpireDateConfig ( )
protected

Definition at line 150 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

150 : void
151 {
152 $this->tpl->loadStandardTemplate();
153 $this->ctrl->setParameter($this, 'prgrs_ids', implode(',', $this->getProgressIds()));
154 $action = $this->ctrl->getFormAction(
155 $this,
156 self::CMD_CHANGE_EXPIRE_DATE
157 );
158 $this->ctrl->clearParameters($this);
159
160 $form = $this->buildForm($this->getObject(), $action);
161
162 $this->tpl->setContent($this->renderer->render($form));
163 }
buildForm(ilObjStudyProgramme $prg, string $submit_action)

References buildForm(), getObject(), and getProgressIds().

Referenced by executeCommand().

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

Field Documentation

◆ $access

ilStudyProgrammeChangeExpireDateGUI::$access
protected

Definition at line 42 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ $back_target

ilStudyProgrammeChangeExpireDateGUI::$back_target
protected

◆ $ctrl

ilStudyProgrammeChangeExpireDateGUI::$ctrl
protected

Definition at line 27 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ $data_factory

ilStudyProgrammeChangeExpireDateGUI::$data_factory
protected

Definition at line 77 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ $gui

ilStudyProgrammeChangeExpireDateGUI::$gui
protected

◆ $input_factory

ilStudyProgrammeChangeExpireDateGUI::$input_factory
protected

Definition at line 57 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ $lng

ilStudyProgrammeChangeExpireDateGUI::$lng
protected

Definition at line 37 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ $messages

ilStudyProgrammeChangeExpireDateGUI::$messages
protected

Definition at line 97 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ $object

ilStudyProgrammeChangeExpireDateGUI::$object
protected

◆ $progress_ids

ilStudyProgrammeChangeExpireDateGUI::$progress_ids
protected

◆ $ref_id

ilStudyProgrammeChangeExpireDateGUI::$ref_id
protected

◆ $refinery_factory

ilStudyProgrammeChangeExpireDateGUI::$refinery_factory
protected

Definition at line 72 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ $renderer

ilStudyProgrammeChangeExpireDateGUI::$renderer
protected

Definition at line 62 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ $request

ilStudyProgrammeChangeExpireDateGUI::$request
protected

Definition at line 67 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ $tpl

ilStudyProgrammeChangeExpireDateGUI::$tpl
protected

Definition at line 32 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ $user

ilStudyProgrammeChangeExpireDateGUI::$user
protected

Definition at line 47 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by __construct().

◆ CMD_CHANGE_EXPIRE_DATE

const ilStudyProgrammeChangeExpireDateGUI::CMD_CHANGE_EXPIRE_DATE = "changeExpireDate"

Definition at line 16 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by executeCommand().

◆ CMD_SHOW_EXPIRE_DATE_CONFIG

const ilStudyProgrammeChangeExpireDateGUI::CMD_SHOW_EXPIRE_DATE_CONFIG = "showExpireDateConfig"

Definition at line 15 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by executeCommand().

◆ PROP_VALIDITY_OF_QUALIFICATION

const ilStudyProgrammeChangeExpireDateGUI::PROP_VALIDITY_OF_QUALIFICATION = "validity_qualification"

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