5declare(strict_types=1);
7use GuzzleHttp\Psr7\ServerRequest;
127 $next_class = $this->ctrl->getNextClass($this);
128 $cmd = $this->ctrl->getCmd();
130 switch ($next_class) {
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'))
194 $date = $prg->
getSettings()->getValidityOfQualificationSettings()->getQualificationDate();
195 if ($date !==
null) {
196 $vq_date_sub_form = $vq_date_sub_form->withValue($date->format(
$format->toString()));
200 $sg = $ff->switchableGroup(
203 $ff->group([],
$txt(
'prg_no_validity_qualification')),
205 $ff->group([$vq_date_sub_form],
$txt(
'validity_qualification_date'))
209 return $sg->withValue($option);
222 $txt(
"prg_validity_of_qualification"),
231 ->buildForm($this->getObject(), $this->ctrl->getFormAction($this,
"changeExpireDate"))
232 ->withRequest($this->request);
234 $result = $form->getInputGroup()->getContent();
236 $msg_collection = $this->messages->getMessageCollection(
'msg_change_expire_date');
240 $programme = $this->getObject();
241 $acting_usr_id = $this->
user->getId();
243 $vq_data = $values[0][self::PROP_VALIDITY_OF_QUALIFICATION];
244 $vq_type = $vq_data[0];
247 $validity = DateTimeImmutable::createFromFormat(
'd.m.Y', array_shift($vq_data[1]));
250 $this->ctrl->redirectByClass(self::class, self::CMD_SHOW_EXPIRE_DATE_CONFIG);
253 foreach ($this->getProgressIds() as $progress_id) {
254 $programme->changeProgressValidityDate($progress_id, $acting_usr_id, $msg_collection, $validity, );
257 $this->messages->showMessages($msg_collection);
258 $this->ctrl->redirectByClass(
'ilObjStudyProgrammeMembersGUI',
'view');
261 $this->ctrl->redirectByClass(self::class, self::CMD_SHOW_EXPIRE_DATE_CONFIG);
266 return $this->back_target;
271 $this->back_target = $target;
276 return $this->progress_ids;
281 $this->progress_ids = array_map(
'intval', $progress_ids);
286 return $this->ref_id;
291 $this->ref_id = $ref_id;
296 if ($this->
object ===
null) {
299 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)
Util around ilPRGMessageCollection factors and output collections.
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
__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)
setBackTarget(string $target)
getValidityOfQualificationSubForm(ilObjStudyProgramme $prg)
buildFormElements(\ILIAS\UI\Component\Input\Field\Factory $ff, Closure $txt, ilObjStudyProgramme $prg)
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.