5declare(strict_types=1);
7use GuzzleHttp\Psr7\ServerRequest;
127 $next_class = $this->ctrl->getNextClass($this);
128 $cmd = $this->ctrl->getCmd();
130 switch ($next_class) {
137 $this->changeExpireDate();
143 throw new Exception(
'Unknown command ' . $cmd);
152 $this->tpl->loadStandardTemplate();
153 $this->ctrl->setParameter($this,
'prgrs_ids', implode(
',', $this->
getProgressIds()));
154 $action = $this->ctrl->getFormAction(
156 self::CMD_CHANGE_EXPIRE_DATE
158 $this->ctrl->clearParameters($this);
162 $this->tpl->setContent($this->renderer->render($form));
167 $ff = $this->input_factory->field();
168 $txt =
function ($id) {
169 return $this->lng->txt($id);
172 return $this->input_factory->container()->form()->standard(
184 $ff = $this->input_factory->field();
185 $txt =
function ($id) {
186 return $this->lng->txt($id);
190 $format = $this->data_factory->dateFormat()->germanShort();
191 $vq_date_sub_form = $ff
192 ->dateTime(
'',
$txt(
'validity_qualification_date_desc'))
193 ->withMinValue(
new DateTimeImmutable())
196 if ($date !==
null) {
197 $vq_date_sub_form = $vq_date_sub_form->withValue($date->format(
$format->toString()));
201 $sg = $ff->switchableGroup(
204 $ff->group([],
$txt(
'prg_no_validity_qualification')),
206 $ff->group([$vq_date_sub_form],
$txt(
'validity_qualification_date'))
210 return $sg->withValue($option);
223 $txt(
"prg_validity_of_qualification"),
229 protected function changeExpireDate() : void
232 ->buildForm($this->getObject(), $this->ctrl->getFormAction($this,
"changeExpireDate"))
233 ->withRequest($this->request);
235 $result = $form->getInputGroup()->getContent();
239 foreach ($this->getProgressIds() as $prgs_id) {
241 $progress = $this->user_progress_db->getInstanceById($prgs_id);
242 $status = $progress->getStatus();
251 $vq_data = $values[0][self::PROP_VALIDITY_OF_QUALIFICATION];
252 $vq_type = $vq_data[0];
256 $progress->setValidityOfQualification(
null);
259 $progress->setValidityOfQualification(
260 DateTime::createFromFormat(
'd.m.Y', array_shift($vq_data[1]))
265 $progress->updateProgress($this->
user->getId());
266 $progress->updateFromProgramNode();
269 ilUtil::sendSuccess($this->lng->txt(
'update_expire_date'),
true);
270 $this->ctrl->redirectByClass(
'ilObjStudyProgrammeMembersGUI',
'view');
274 $this->ctrl->redirectByClass(self::class, self::CMD_SHOW_EXPIRE_DATE_CONFIG);
279 return $this->back_target;
284 $this->back_target = $target;
289 return $this->progress_ids;
294 $this->progress_ids = $progress_ids;
299 return $this->ref_id;
304 $this->ref_id = $ref_id;
309 if ($this->
object ===
null) {
312 return $this->object;
An exception for terminatinating execution or to throw for unit testing.
This class provides processing control methods.
@ilCtrl_Calls ilObjStudyProgrammeSettingsGUI: ilStudyProgrammeCommonSettingsGUI
const OPT_NO_VALIDITY_OF_QUALIFICATION
const OPT_VALIDITY_OF_QUALIFICATION_DATE
static getInstanceByRefId($a_ref_id)
getValidityOfQualificationSettings()
const CMD_CHANGE_EXPIRE_DATE
buildForm(ilObjStudyProgramme $prg, string $submit_action)
const CMD_SHOW_EXPIRE_DATE_CONFIG
setProgressIds(array $progress_ids)
const PROP_VALIDITY_OF_QUALIFICATION
setBackTarget(string $target)
__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, ilStudyProgrammeUserProgressDB $user_progress_db)
getValidityOfQualificationSubForm(ilObjStudyProgramme $prg)
buildFormElements(\ILIAS\UI\Component\Input\Field\Factory $ff, Closure $txt, ilObjStudyProgramme $prg)
Storage implementation for ilStudyProgrammeUserProgress.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
An entity that renders components to a string output.
Class ChatMainBarProvider \MainMenu\Provider.