19 declare(strict_types=1);
77 $cmd = $this->
ctrl->getCmd();
80 case self::CMD_SHOW_DEADLINE_CONFIG:
83 case self::CMD_CHANGE_DEADLINE:
90 throw new Exception(
'Unknown command ' . $cmd);
96 $this->tpl->loadStandardTemplate();
98 $action = $this->
ctrl->getFormAction(
100 self::CMD_CHANGE_DEADLINE
102 $this->
ctrl->clearParameters($this);
106 $this->tpl->setContent($this->
renderer->render($form));
111 $ff = $this->input_factory->field();
113 return $this->
lng->txt(
$id);
116 return $this->input_factory->container()->form()->standard(
128 $ff = $this->input_factory->field();
130 return $this->
lng->txt(
$id);
134 $deadline_date = $prg->
getSettings()->getDeadlineSettings()->getDeadlineDate();
135 $format = $this->data_factory->dateFormat()->germanShort();
136 $deadline_date_sub_form = $ff
137 ->dateTime(
'',
$txt(
'prg_deadline_date_desc'))
138 ->withFormat($format)
141 if ($deadline_date !==
null) {
142 $deadline_date_sub_form = $deadline_date_sub_form->withValue(
143 $deadline_date->format($format->toString())
148 $sg = $ff->switchableGroup(
151 $ff->group([],
$txt(
'prg_no_deadline')),
153 $ff->group([$deadline_date_sub_form],
$txt(
'prg_deadline_date'))
158 return $sg->withValue($option);
171 $txt(
"prg_deadline_settings"),
182 ->buildForm($this->
getObject(), $this->
ctrl->getFormAction($this,
"changeDeadline"))
183 ->withRequest($this->request);
185 $result = $form->getInputGroup()->getContent();
187 $msg_collection = $this->messages->getMessageCollection(
'msg_change_deadline_date');
189 if ($result->isOK()) {
190 $values = $result->value();
192 $acting_usr_id = $this->
user->getId();
194 $deadline_data = $values[0][self::PROP_DEADLINE];
195 $deadline_type = $deadline_data[0];
198 $deadline = array_shift($deadline_data[1]);
201 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
'error_updating_deadline'),
true);
203 $this->
ctrl->redirectByClass(self::class, self::CMD_SHOW_DEADLINE_CONFIG);
208 $assignment_id = $progress_id->getAssignmentId();
209 $programme->changeProgressDeadline($assignment_id, $acting_usr_id, $msg_collection, $deadline);
212 $this->messages->showMessages($msg_collection);
213 $this->
ctrl->redirectByClass(
'ilObjStudyProgrammeMembersGUI',
'view');
216 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
'error_updating_deadline'),
true);
218 $this->
ctrl->redirectByClass(self::class, self::CMD_SHOW_DEADLINE_CONFIG);
228 $this->back_target = $target;
254 if (is_null($ref_id)) {
255 throw new LogicException(
"Can't create object. No ref_id given.");
258 if ($this->
object ===
null) {
267 if (is_null($back_target)) {
268 throw new LogicException(
"Can't redirect. No back target given.");
271 $this->
ctrl->redirectToURL($back_target);
ilPRGMessagePrinter $messages
Psr Http Message ServerRequestInterface $request
getDeadlineSubForm(ilObjStudyProgramme $prg)
const CMD_CHANGE_DEADLINE
Util around ilPRGMessageCollection factors and output collections.
Interface Observer Contains several chained tasks and infos about them.
buildForm(ilObjStudyProgramme $prg, string $submit_action)
static getInstanceByRefId($ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__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)
buildFormElements( $ff, Closure $txt, ilObjStudyProgramme $prg)
ilObjStudyProgramme $object
setProgressIds(array $progress_ids)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const CMD_SHOW_DEADLINE_CONFIG
ILIAS Refinery Factory $refinery_factory
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
ILIAS Data Factory $data_factory
setBackTarget(string $target)
ilGlobalTemplateInterface $tpl