5 declare(strict_types=1);
127 $next_class = $this->ctrl->getNextClass($this);
128 $cmd = $this->ctrl->getCmd();
130 switch ($next_class) {
133 case self::CMD_SHOW_EXPIRE_DATE_CONFIG:
136 case self::CMD_CHANGE_EXPIRE_DATE:
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'))
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();
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);
284 $this->back_target = $target;
309 if ($this->
object === null) {
An entity that renders components to a string output.
This class provides processing control methods.
getValidityOfQualificationSubForm(ilObjStudyProgramme $prg)
Class ChatMainBarProvider .
const OPT_NO_VALIDITY_OF_QUALIFICATION
Storage implementation for ilStudyProgrammeUserProgress.
const OPT_VALIDITY_OF_QUALIFICATION_DATE
setProgressIds(array $progress_ids)
static getInstanceByRefId($a_ref_id)
const CMD_CHANGE_EXPIRE_DATE
const CMD_SHOW_EXPIRE_DATE_CONFIG
const PROP_VALIDITY_OF_QUALIFICATION
setBackTarget(string $target)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getValidityOfQualificationSettings()
buildFormElements(\ILIAS\UI\Component\Input\Field\Factory $ff, Closure $txt, ilObjStudyProgramme $prg)
__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)
static redirect($a_script)
const PROP_VALIDITY_OF_QUALIFICATION
buildForm(ilObjStudyProgramme $prg, string $submit_action)