ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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, Psr\Http\Message\ServerRequestInterface $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)
 

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

ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilAccess $access
 
ilObjUser $user
 
Factory $input_factory
 
Renderer $renderer
 
Psr Http Message ServerRequestInterface $request
 
ILIAS Refinery Factory $refinery_factory
 
ILIAS Data Factory $data_factory
 
ilPRGMessagePrinter $messages
 
string $back_target = null
 
array $progress_ids = []
 
int $ref_id = null
 
ilObjStudyProgramme $object = null
 

Private Attributes

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

61 {
62 $this->ctrl = $ctrl;
63 $this->tpl = $tpl;
64 $this->lng = $lng;
65 $this->access = $access;
66 $this->user = $user;
67 $this->input_factory = $input_factory;
68 $this->renderer = $renderer;
69 $this->request = $request;
70 $this->refinery_factory = $refinery_factory;
71 $this->data_factory = $data_factory;
72 $this->messages = $messages;
73 }
renderer()

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

+ Here is the call graph for this function:

Member Function Documentation

◆ buildForm()

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

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

109 : Standard
110 {
111 $ff = $this->input_factory->field();
112 $txt = function ($id) {
113 return $this->lng->txt($id);
114 };
115
116 return $this->input_factory->container()->form()->standard(
117 $submit_action,
118 $this->buildFormElements(
119 $ff,
120 $txt,
121 $prg
122 )
123 );
124 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
buildFormElements(ILIAS\UI\Component\Input\Field\Factory $ff, Closure $txt, ilObjStudyProgramme $prg)
$txt
Definition: error.php:31
This describes a standard form.
Definition: Standard.php:29

References $id, $txt, buildFormElements(), and ILIAS\Repository\lng().

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 156 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

160 : array {
161 return [
162 $ff->section(
163 [
165 ],
166 $txt("prg_validity_of_qualification"),
167 ""
168 )
169 ];
170 }

Referenced by buildForm().

+ Here is the caller graph for this function:

◆ changeExpireDate()

ilStudyProgrammeChangeExpireDateGUI::changeExpireDate ( )
protected

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

172 : void
173 {
174 $form = $this
175 ->buildForm($this->getObject(), $this->ctrl->getFormAction($this, "changeExpireDate"))
176 ->withRequest($this->request);
177
178 $result = $form->getInputGroup()->getContent();
179
180 $msg_collection = $this->messages->getMessageCollection('msg_change_expire_date');
181
182 if ($result->isOK()) {
183 $values = $result->value();
184 $programme = $this->getObject();
185 $acting_usr_id = $this->user->getId();
186
187 $vq_data = $values[0][self::PROP_VALIDITY_OF_QUALIFICATION];
188 $vq_type = $vq_data[0];
189 $validity = null;
191 $validity = array_shift($vq_data[1]);
192 if (!$validity) {
193 $this->tpl->setOnScreenMessage("failure", $this->lng->txt('error_updating_expire_date'), true);
194 $this->ctrl->setParameter($this, 'prgrs_ids', implode(',', $this->getProgressIds()));
195 $this->ctrl->redirectByClass(self::class, self::CMD_SHOW_EXPIRE_DATE_CONFIG);
196 }
197 }
198 foreach ($this->getProgressIds() as $progress_id) {
199 $assignment_id = $progress_id->getAssignmentId();
200 $programme->changeProgressValidityDate($assignment_id, $acting_usr_id, $msg_collection, $validity, );
201 }
202
203 $this->messages->showMessages($msg_collection);
204 $this->ctrl->redirectByClass('ilObjStudyProgrammeMembersGUI', 'view');
205 }
206 $this->tpl->setOnScreenMessage("failure", $this->lng->txt('error_updating_expire_date'), true);
207 $this->ctrl->setParameter($this, 'prgrs_ids', implode(',', $this->getProgressIds()));
208 $this->ctrl->redirectByClass(self::class, self::CMD_SHOW_EXPIRE_DATE_CONFIG);
209 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilObjStudyProgrammeSettingsGUI\OPT_VALIDITY_OF_QUALIFICATION_DATE, and ILIAS\Repository\user().

Referenced by executeCommand().

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

◆ executeCommand()

ilStudyProgrammeChangeExpireDateGUI::executeCommand ( )

◆ getBackTarget()

ilStudyProgrammeChangeExpireDateGUI::getBackTarget ( )
protected

◆ getObject()

ilStudyProgrammeChangeExpireDateGUI::getObject ( )
protected

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

242 {
243 $ref_id = $this->getRefId();
244 if (is_null($ref_id)) {
245 throw new LogicException("Can't create object. No ref_id given.");
246 }
247
248 if ($this->object === null) {
250 }
251 return $this->object;
252 }

References $ref_id, and 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 221 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

Referenced by showExpireDateConfig().

+ Here is the caller graph for this function:

◆ getRefId()

ilStudyProgrammeChangeExpireDateGUI::getRefId ( )
protected

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

231 : ?int
232 {
233 return $this->ref_id;
234 }

References $ref_id.

◆ getValidityOfQualificationSubForm()

ilStudyProgrammeChangeExpireDateGUI::getValidityOfQualificationSubForm ( ilObjStudyProgramme  $prg)
protected

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

126 : FormInput
127 {
128 $ff = $this->input_factory->field();
129 $txt = function ($id) {
130 return $this->lng->txt($id);
131 };
132
134 $format = $this->data_factory->dateFormat()->germanShort();
135 $vq_date_sub_form = $ff
136 ->dateTime('', $txt('validity_qualification_date_desc'))
137 ->withFormat($format);
138 $date = $prg->getSettings()->getValidityOfQualificationSettings()->getQualificationDate();
139 if ($date !== null) {
140 $vq_date_sub_form = $vq_date_sub_form->withValue($date->format($format->toString()));
142 }
143
144 $sg = $ff->switchableGroup(
145 [
147 $ff->group([], $txt('prg_no_validity_qualification')),
149 $ff->group([$vq_date_sub_form], $txt('validity_qualification_date'))
150 ],
151 ''
152 );
153 return $sg->withValue($option);
154 }
This describes inputs that can be used in forms.
Definition: FormInput.php:33

References $id, $txt, ilObjStudyProgramme\getSettings(), ILIAS\Repository\lng(), 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 254 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

254 : void
255 {
256 $back_target = $this->getBackTarget();
257 if (is_null($back_target)) {
258 throw new LogicException("Can't redirect. No back target given.");
259 }
260
261 $this->ctrl->redirectToURL($back_target);
262 }

References ILIAS\Repository\ctrl().

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 216 of file class.ilStudyProgrammeChangeExpireDateGUI.php.

216 : void
217 {
218 $this->back_target = $target;
219 }

◆ setProgressIds()

ilStudyProgrammeChangeExpireDateGUI::setProgressIds ( array  $progress_ids)

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

226 : void
227 {
228 $this->progress_ids = $progress_ids;
229 }

◆ setRefId()

ilStudyProgrammeChangeExpireDateGUI::setRefId ( int  $ref_id)

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

236 : void
237 {
238 $this->ref_id = $ref_id;
239 }

References $ref_id.

◆ showExpireDateConfig()

ilStudyProgrammeChangeExpireDateGUI::showExpireDateConfig ( )
protected

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

94 : void
95 {
96 $this->tpl->loadStandardTemplate();
97 $this->ctrl->setParameter($this, 'prgrs_ids', implode(',', $this->getProgressIds()));
98 $action = $this->ctrl->getFormAction(
99 $this,
100 self::CMD_CHANGE_EXPIRE_DATE
101 );
102 $this->ctrl->clearParameters($this);
103
104 $form = $this->buildForm($this->getObject(), $action);
105
106 $this->tpl->setContent($this->renderer->render($form));
107 }
buildForm(ilObjStudyProgramme $prg, string $submit_action)

References buildForm(), ILIAS\Repository\ctrl(), getObject(), getProgressIds(), and renderer().

Referenced by executeCommand().

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

Field Documentation

◆ $access

ilAccess ilStudyProgrammeChangeExpireDateGUI::$access
protected

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

Referenced by __construct().

◆ $back_target

string ilStudyProgrammeChangeExpireDateGUI::$back_target = null
protected

◆ $ctrl

ilCtrl ilStudyProgrammeChangeExpireDateGUI::$ctrl
protected

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

Referenced by __construct().

◆ $data_factory

ILIAS Data Factory ilStudyProgrammeChangeExpireDateGUI::$data_factory
protected

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

Referenced by __construct().

◆ $input_factory

Factory ilStudyProgrammeChangeExpireDateGUI::$input_factory
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilStudyProgrammeChangeExpireDateGUI::$lng
protected

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

Referenced by __construct().

◆ $messages

ilPRGMessagePrinter ilStudyProgrammeChangeExpireDateGUI::$messages
protected

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

Referenced by __construct().

◆ $object

ilObjStudyProgramme ilStudyProgrammeChangeExpireDateGUI::$object = null
protected

◆ $progress_ids

array ilStudyProgrammeChangeExpireDateGUI::$progress_ids = []
protected

◆ $ref_id

int ilStudyProgrammeChangeExpireDateGUI::$ref_id = null
protected

◆ $refinery_factory

ILIAS Refinery Factory ilStudyProgrammeChangeExpireDateGUI::$refinery_factory
protected

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

Referenced by __construct().

◆ $renderer

Renderer ilStudyProgrammeChangeExpireDateGUI::$renderer
protected

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

Referenced by __construct().

◆ $request

Psr Http Message ServerRequestInterface ilStudyProgrammeChangeExpireDateGUI::$request
protected

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

Referenced by __construct().

◆ $tpl

ilGlobalTemplateInterface ilStudyProgrammeChangeExpireDateGUI::$tpl
protected

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

Referenced by __construct().

◆ $user

ilObjUser ilStudyProgrammeChangeExpireDateGUI::$user
protected

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

Referenced by __construct().

◆ CMD_CHANGE_EXPIRE_DATE

const ilStudyProgrammeChangeExpireDateGUI::CMD_CHANGE_EXPIRE_DATE = "changeExpireDate"
private

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

Referenced by executeCommand().

◆ CMD_SHOW_EXPIRE_DATE_CONFIG

const ilStudyProgrammeChangeExpireDateGUI::CMD_SHOW_EXPIRE_DATE_CONFIG = "showExpireDateConfig"
private

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

Referenced by executeCommand().

◆ PROP_VALIDITY_OF_QUALIFICATION

const ilStudyProgrammeChangeExpireDateGUI::PROP_VALIDITY_OF_QUALIFICATION = "validity_qualification"
private

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