ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

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

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
+ 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.

References $txt, and buildFormElements().

Referenced by showDeadlineConfig().

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:10
+ 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.

References $result, $txt, getDeadlineSubForm(), getObject(), getProgressIds(), ilObjStudyProgrammeSettingsGUI\OPT_DEADLINE_DATE, ilObjStudyProgrammeSettingsGUI\OPT_NO_DEADLINE, ilObjStudyProgrammeSettingsGUI\PROP_DEADLINE, ilUtil\sendFailure(), and user().

Referenced by buildForm().

222  : array {
223  $return = [
224  $ff->section(
225  [
227  ],
228  $txt("prg_deadline_settings"),
229  ""
230  )
231  ];
232 
233  return $return;
234  }
$txt
Definition: error.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilStudyProgrammeChangeDeadlineGUI::executeCommand ( )

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

References redirectToParent(), and showDeadlineConfig().

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) {
133  case self::CMD_SHOW_DEADLINE_CONFIG:
134  $this->showDeadlineConfig();
135  break;
136  case self::CMD_CHANGE_DEADLINE:
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  }
+ Here is the call graph for this function:

◆ getBackTarget()

ilStudyProgrammeChangeDeadlineGUI::getBackTarget ( )
protected

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

References $back_target.

Referenced by redirectToParent().

+ Here is the caller graph for this function:

◆ getDeadlineSubForm()

ilStudyProgrammeChangeDeadlineGUI::getDeadlineSubForm ( ilObjStudyProgramme  $prg)
protected

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

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

Referenced by buildFormElements().

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  }
$format
Definition: metadata.php:218
$txt
Definition: error.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObject()

ilStudyProgrammeChangeDeadlineGUI::getObject ( )
protected

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

References $object, ilObjStudyProgramme\getInstanceByRefId(), and getRefId().

Referenced by buildFormElements(), and 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.

References $progress_ids.

Referenced by buildFormElements(), and showDeadlineConfig().

+ Here is the caller graph for this function:

◆ getRefId()

ilStudyProgrammeChangeDeadlineGUI::getRefId ( )
protected

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

References $ref_id.

Referenced by getObject().

+ Here is the caller graph for this function:

◆ redirectToParent()

ilStudyProgrammeChangeDeadlineGUI::redirectToParent ( )
protected

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

References getBackTarget(), and ilUtil\redirect().

Referenced by executeCommand().

315  : void
316  {
318  }
static redirect($a_script)
+ 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.

References $progress_ids.

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.

References $ref_id.

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

◆ showDeadlineConfig()

ilStudyProgrammeChangeDeadlineGUI::showDeadlineConfig ( )
protected

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

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

Referenced by executeCommand().

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)
+ 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.

Referenced by getBackTarget().

◆ $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.

Referenced by getObject().

◆ $progress_ids

ilStudyProgrammeChangeDeadlineGUI::$progress_ids
protected

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

Referenced by getProgressIds(), and setProgressIds().

◆ $ref_id

ilStudyProgrammeChangeDeadlineGUI::$ref_id
protected

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

Referenced by getRefId(), and setRefId().

◆ $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.

◆ CMD_SHOW_DEADLINE_CONFIG

const ilStudyProgrammeChangeDeadlineGUI::CMD_SHOW_DEADLINE_CONFIG = "showDeadlineConfig"

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

◆ 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: