ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilStudyProgrammeChangeDeadlineGUI Class Reference
+ Collaboration diagram for ilStudyProgrammeChangeDeadlineGUI:

Public Member Functions

 __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)
 
 executeCommand ()
 
 setBackTarget (string $target)
 
 setProgressIds (array $progress_ids)
 
 setRefId (int $ref_id)
 

Data Fields

const CMD_SHOW_DEADLINE_CONFIG = "showDeadlineConfig"
 
const CMD_CHANGE_DEADLINE = "changeDeadline"
 
const PROP_DEADLINE = "deadline"
 

Protected Member Functions

 showDeadlineConfig ()
 
 buildForm (ilObjStudyProgramme $prg, string $submit_action)
 
 getDeadlineSubForm (ilObjStudyProgramme $prg)
 
 buildFormElements ( $ff, Closure $txt, ilObjStudyProgramme $prg)
 
 getBackTarget ()
 
 getProgressIds ()
 
 getRefId ()
 
 getObject ()
 
 redirectToParent ()
 

Protected Attributes

 $gui
 
 $ctrl
 
 $tpl
 
 $lng
 
 $access
 
 $user
 
 $back_target
 
 $input_factory
 
 $renderer
 
 $request
 
 $refinery_factory
 
 $data_factory
 
 $user_progress_db
 
 $progress_ids
 
 $ref_id
 
 $object
 

Detailed Description

Definition at line 13 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeChangeDeadlineGUI::__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 
)

Definition at line 99 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

111 {
112 $this->ctrl = $ctrl;
113 $this->tpl = $tpl;
114 $this->lng = $lng;
115 $this->access = $access;
116 $this->user = $user;
117 $this->input_factory = $input_factory;
118 $this->renderer = $renderer;
119 $this->request = $request;
120 $this->refinery_factory = $refinery_factory;
121 $this->data_factory = $data_factory;
122 $this->user_progress_db = $user_progress_db;
123 }
user()
Definition: user.php:4

References $access, $ctrl, $data_factory, $input_factory, $lng, $refinery_factory, $renderer, $request, $tpl, $user, $user_progress_db, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildForm()

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

Definition at line 165 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

165 : Standard
166 {
167 $ff = $this->input_factory->field();
168 $txt = function ($id) {
169 return $this->lng->txt($id);
170 };
171
172 return $this->input_factory->container()->form()->standard(
173 $submit_action,
174 $this->buildFormElements(
175 $ff,
176 $txt,
177 $prg
178 )
179 );
180 }
buildFormElements( $ff, Closure $txt, ilObjStudyProgramme $prg)
$txt
Definition: error.php:13
This describes a standard form.
Definition: Standard.php:11

References $txt, and buildFormElements().

Referenced by showDeadlineConfig().

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

◆ buildFormElements()

ilStudyProgrammeChangeDeadlineGUI::buildFormElements (   $ff,
Closure  $txt,
ilObjStudyProgramme  $prg 
)
protected

Definition at line 218 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

222 : array {
223 $return = [
224 $ff->section(
225 [
227 ],
228 $txt("prg_deadline_settings"),
229 ""
230 )
231 ];
232
233 return $return;
234 }

Referenced by buildForm().

+ Here is the caller graph for this function:

◆ executeCommand()

ilStudyProgrammeChangeDeadlineGUI::executeCommand ( )

Definition at line 125 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

125 : void
126 {
127 $next_class = $this->ctrl->getNextClass($this);
128 $cmd = $this->ctrl->getCmd();
129
130 switch ($next_class) {
131 default:
132 switch ($cmd) {
134 $this->showDeadlineConfig();
135 break;
137 $this->changeDeadline();
138 break;
139 case 'cancel':
140 $this->redirectToParent();
141 break;
142 default:
143 throw new Exception('Unknown command ' . $cmd);
144 break;
145 }
146 break;
147 }
148 }

References CMD_CHANGE_DEADLINE, CMD_SHOW_DEADLINE_CONFIG, redirectToParent(), and showDeadlineConfig().

+ Here is the call graph for this function:

◆ getBackTarget()

ilStudyProgrammeChangeDeadlineGUI::getBackTarget ( )
protected

◆ getDeadlineSubForm()

ilStudyProgrammeChangeDeadlineGUI::getDeadlineSubForm ( ilObjStudyProgramme  $prg)
protected

Definition at line 182 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

182 : Input
183 {
184 $ff = $this->input_factory->field();
185 $txt = function ($id) {
186 return $this->lng->txt($id);
187 };
188
190 $deadline_date = $prg->getDeadlineSettings()->getDeadlineDate();
191 $format = $this->data_factory->dateFormat()->germanShort();
192 $deadline_date_sub_form = $ff
193 ->dateTime('', $txt('prg_deadline_date_desc'))
194 ->withFormat($format)
195 ->withMinValue(new DateTimeImmutable())
196 ;
197
198 if ($deadline_date !== null) {
199 $deadline_date_sub_form = $deadline_date_sub_form->withValue(
200 $deadline_date->format($format->toString())
201 );
203 }
204
205 $sg = $ff->switchableGroup(
206 [
208 $ff->group([], $txt('prg_no_deadline')),
210 $ff->group([$deadline_date_sub_form], $txt('prg_deadline_date'))
211 ],
212 ''
213 );
214
215 return $sg->withValue($option);
216 }
This describes commonalities between all inputs.
Definition: Input.php:32
$format
Definition: metadata.php:218

References $format, $txt, ilObjStudyProgramme\getDeadlineSettings(), ilObjStudyProgrammeSettingsGUI\OPT_DEADLINE_DATE, and ilObjStudyProgrammeSettingsGUI\OPT_NO_DEADLINE.

+ Here is the call graph for this function:

◆ getObject()

ilStudyProgrammeChangeDeadlineGUI::getObject ( )
protected

Definition at line 307 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

References ilObjStudyProgramme\getInstanceByRefId().

Referenced by showDeadlineConfig().

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

◆ getProgressIds()

ilStudyProgrammeChangeDeadlineGUI::getProgressIds ( )
protected

Definition at line 287 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by showDeadlineConfig().

+ Here is the caller graph for this function:

◆ getRefId()

ilStudyProgrammeChangeDeadlineGUI::getRefId ( )
protected

◆ redirectToParent()

ilStudyProgrammeChangeDeadlineGUI::redirectToParent ( )
protected

Definition at line 315 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

315 : void
316 {
318 }
static redirect($a_script)

References ilUtil\redirect().

Referenced by executeCommand().

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

◆ setBackTarget()

ilStudyProgrammeChangeDeadlineGUI::setBackTarget ( string  $target)

Definition at line 282 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

282 : void
283 {
284 $this->back_target = $target;
285 }

◆ setProgressIds()

ilStudyProgrammeChangeDeadlineGUI::setProgressIds ( array  $progress_ids)

Definition at line 292 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

292 : void
293 {
294 $this->progress_ids = $progress_ids;
295 }

◆ setRefId()

ilStudyProgrammeChangeDeadlineGUI::setRefId ( int  $ref_id)

Definition at line 302 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

302 : void
303 {
304 $this->ref_id = $ref_id;
305 }

◆ showDeadlineConfig()

ilStudyProgrammeChangeDeadlineGUI::showDeadlineConfig ( )
protected

Definition at line 150 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

150 : void
151 {
152 $this->tpl->loadStandardTemplate();
153 $this->ctrl->setParameter($this, 'prgrs_ids', implode(',', $this->getProgressIds()));
154 $action = $this->ctrl->getFormAction(
155 $this,
156 self::CMD_CHANGE_DEADLINE
157 );
158 $this->ctrl->clearParameters($this);
159
160 $form = $this->buildForm($this->getObject(), $action);
161
162 $this->tpl->setContent($this->renderer->render($form));
163 }
buildForm(ilObjStudyProgramme $prg, string $submit_action)

References buildForm(), getObject(), and getProgressIds().

Referenced by executeCommand().

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

Field Documentation

◆ $access

ilStudyProgrammeChangeDeadlineGUI::$access
protected

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

Referenced by __construct().

◆ $back_target

ilStudyProgrammeChangeDeadlineGUI::$back_target
protected

Definition at line 52 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

◆ $ctrl

ilStudyProgrammeChangeDeadlineGUI::$ctrl
protected

Definition at line 27 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by __construct().

◆ $data_factory

ilStudyProgrammeChangeDeadlineGUI::$data_factory
protected

Definition at line 77 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by __construct().

◆ $gui

ilStudyProgrammeChangeDeadlineGUI::$gui
protected

Definition at line 22 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

◆ $input_factory

ilStudyProgrammeChangeDeadlineGUI::$input_factory
protected

Definition at line 57 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by __construct().

◆ $lng

ilStudyProgrammeChangeDeadlineGUI::$lng
protected

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

Referenced by __construct().

◆ $object

ilStudyProgrammeChangeDeadlineGUI::$object
protected

Definition at line 97 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

◆ $progress_ids

ilStudyProgrammeChangeDeadlineGUI::$progress_ids
protected

Definition at line 87 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

◆ $ref_id

ilStudyProgrammeChangeDeadlineGUI::$ref_id
protected

Definition at line 92 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

◆ $refinery_factory

ilStudyProgrammeChangeDeadlineGUI::$refinery_factory
protected

Definition at line 72 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by __construct().

◆ $renderer

ilStudyProgrammeChangeDeadlineGUI::$renderer
protected

Definition at line 62 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by __construct().

◆ $request

ilStudyProgrammeChangeDeadlineGUI::$request
protected

Definition at line 67 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by __construct().

◆ $tpl

ilStudyProgrammeChangeDeadlineGUI::$tpl
protected

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

Referenced by __construct().

◆ $user

ilStudyProgrammeChangeDeadlineGUI::$user
protected

Definition at line 47 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by __construct().

◆ $user_progress_db

ilStudyProgrammeChangeDeadlineGUI::$user_progress_db
protected

Definition at line 82 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by __construct().

◆ CMD_CHANGE_DEADLINE

const ilStudyProgrammeChangeDeadlineGUI::CMD_CHANGE_DEADLINE = "changeDeadline"

Definition at line 16 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by executeCommand().

◆ CMD_SHOW_DEADLINE_CONFIG

const ilStudyProgrammeChangeDeadlineGUI::CMD_SHOW_DEADLINE_CONFIG = "showDeadlineConfig"

Definition at line 15 of file class.ilStudyProgrammeChangeDeadlineGUI.php.

Referenced by executeCommand().

◆ PROP_DEADLINE

const ilStudyProgrammeChangeDeadlineGUI::PROP_DEADLINE = "deadline"

Definition at line 17 of file class.ilStudyProgrammeChangeDeadlineGUI.php.


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