ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilDateDurationInputGUI Class Reference

input GUI for a time span (start and end date) More...

+ Inheritance diagram for ilDateDurationInputGUI:
+ Collaboration diagram for ilDateDurationInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 enableToggleFullTime ($a_title, $a_checked)
 Enable toggling between date and time. More...
 
 enabledToggleFullTime ()
 Check if toggling between date and time enabled. More...
 
 setStart (ilDateTime $a_date=null)
 Set start date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTime('2008-06-12 08:00:00',IL_CAL_DATETIME));. More...
 
 setStartText ($a_txt)
 Set text, which will be shown before the start date. More...
 
 getStartText ()
 get start text More...
 
 setEndText ($a_txt)
 Set text, which will be shown before the end date. More...
 
 getEndText ()
 Get end text. More...
 
 getStart ()
 Get Date, yyyy-mm-dd. More...
 
 setEnd (ilDateTime $a_date=null)
 Set end date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTime('2008-06-12 08:00:00',IL_CAL_DATETIME));. More...
 
 getEnd ()
 Get Date, yyyy-mm-dd. More...
 
 setShowTime ($a_showtime)
 Set Show Time Information. More...
 
 getShowTime ()
 Get Show Time Information. More...
 
 getShowSeconds ()
 Show seconds not implemented yet. More...
 
 setStartYear ($a_year)
 Set start year. More...
 
 getStartYear ()
 Get start year. More...
 
 setMinuteStepSize ($a_step_size)
 Set minute step size E.g 5 => The selection will only show 00,05,10... More...
 
 getMinuteStepSize ()
 Get minute step size. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 render ()
 Insert property html. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
 getTableFilterHTML ()
 Used for table filter presentation. More...
 
 getValue ()
 Used for storing the date duration data in session for table gui filters. More...
 
 setValue ($value)
 Called from table gui with the stored session value Attention: If the user resets the table filter, a boolean false is passed by the table gui. More...
 
 hideSubForm ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 

Protected Member Functions

 getDatePickerTimeFormat ()
 
 parseDatePickerConfig ()
 parse properties to datepicker config More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Protected Attributes

 $lng
 
 $user
 
 $start = null
 
 $startyear = null
 
 $start_text = null
 
 $end_text = null
 
 $minute_step_size = 5
 
 $end = null
 
 $showtime = false
 
 $toggle_fulltime = false
 
 $toggle_fulltime_txt = ''
 
 $toggle_fulltime_checked = false
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 

Detailed Description

input GUI for a time span (start and end date)

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 14 of file class.ilDateDurationInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilDateDurationInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Definition at line 43 of file class.ilDateDurationInputGUI.php.

References $DIC, ilFormPropertyGUI\setType(), and user().

44  {
45  global $DIC;
46 
47  $this->lng = $DIC->language();
48  $this->user = $DIC->user();
49  parent::__construct($a_title, $a_postvar);
50  $this->setType("dateduration");
51  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
setType($a_type)
Set Type.
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilDateDurationInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Definition at line 263 of file class.ilDateDurationInputGUI.php.

References $_POST, $end, $format, $lng, $post, $start, $valid, ilDateTime\_after(), ilSubEnabledFormPropertyGUI\checkSubItemsInput(), getDatePickerTimeFormat(), ilFormPropertyGUI\getDisabled(), getEnd(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getStart(), getStartYear(), IL_CAL_FKT_DATE, ilCalendarUtil\parseIncomingDate(), ilFormPropertyGUI\setAlert(), setEnd(), and setStart().

264  {
265  $lng = $this->lng;
266 
267  if ($this->getDisabled()) {
268  return true;
269  }
270 
271  $post = $_POST[$this->getPostVar()];
272  if (!is_array($post)) {
273  return false;
274  }
275 
276  $start = $post["start"];
277  $end = $post["end"];
278 
279  // if full day is active, ignore time format
280  $format = $post['tgl']
281  ? 0
282  : $this->getDatePickerTimeFormat();
283 
284  // always done to make sure there are no obsolete values left
285  $this->setStart(null);
286  $this->setEnd(null);
287 
288  $valid_start = false;
289  if (trim($start)) {
291  if ($parsed) {
292  $this->setStart($parsed);
293  $valid_start = true;
294  }
295  } elseif (!$this->getRequired() && !trim($end)) {
296  $valid_start = true;
297  }
298 
299  $valid_end = false;
300  if (trim($end)) {
302  if ($parsed) {
303  $this->setEnd($parsed);
304  $valid_end = true;
305  }
306  } elseif (!$this->getRequired() && !trim($start)) {
307  $valid_end = true;
308  }
309 
310  if ($this->getStartYear()) {
311  if ($valid_start &&
312  $this->getStart()->get(IL_CAL_FKT_DATE, "Y") < $this->getStartYear()) {
313  $valid_start = false;
314  }
315  if ($valid_end &&
316  $this->getEnd()->get(IL_CAL_FKT_DATE, "Y") < $this->getStartYear()) {
317  $valid_end = false;
318  }
319  }
320 
321  $valid = ($valid_start && $valid_end);
322 
323  if ($valid &&
324  $this->getStart() &&
325  $this->getEnd() &&
326  ilDateTime::_after($this->getStart(), $this->getEnd())) {
327  $valid = false;
328  }
329 
330  if (!$valid) {
331  $this->invalid_input_start = $start;
332  $this->invalid_input_end = $end;
333 
334  $_POST[$this->getPostVar()]["start"] = null;
335  $_POST[$this->getPostVar()]["end"] = null;
336 
337  $this->setAlert($lng->txt("form_msg_wrong_date"));
338  } else {
339  if (
340  !$this->getStart() ||
341  !$this->getEnd()
342  ) {
343  $_POST[$this->getPostVar()]["start"] = null;
344  $_POST[$this->getPostVar()]["end"] = null;
345  }
346  }
347 
348  if ($valid) {
349  $valid = $this->checkSubItemsInput();
350  }
351 
352  return $valid;
353  }
$format
Definition: metadata.php:141
getPostVar()
Get Post Variable.
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
setStart(ilDateTime $a_date=null)
Set start date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilD...
$valid
setAlert($a_alert)
Set Alert Text.
const IL_CAL_FKT_DATE
$post
Definition: post.php:34
setEnd(ilDateTime $a_date=null)
Set end date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDat...
$_POST["username"]
static parseIncomingDate($a_value, $a_add_time=null)
Try to parse incoming value to date object.
+ Here is the call graph for this function:

◆ enabledToggleFullTime()

ilDateDurationInputGUI::enabledToggleFullTime ( )

Check if toggling between date and time enabled.

Returns

Definition at line 70 of file class.ilDateDurationInputGUI.php.

References $toggle_fulltime.

Referenced by render().

+ Here is the caller graph for this function:

◆ enableToggleFullTime()

ilDateDurationInputGUI::enableToggleFullTime (   $a_title,
  $a_checked 
)

Enable toggling between date and time.

Parameters
object$a_title
object$a_checked
Returns

Definition at line 59 of file class.ilDateDurationInputGUI.php.

60  {
61  $this->toggle_fulltime_txt = $a_title;
62  $this->toggle_fulltime_checked = $a_checked;
63  $this->toggle_fulltime = true;
64  }

◆ getDatePickerTimeFormat()

ilDateDurationInputGUI::getDatePickerTimeFormat ( )
protected

Definition at line 355 of file class.ilDateDurationInputGUI.php.

References getShowSeconds(), and getShowTime().

Referenced by checkInput(), render(), and setValueByArray().

356  {
357  return (int) $this->getShowTime() + (int) $this->getShowSeconds();
358  }
getShowSeconds()
Show seconds not implemented yet.
getShowTime()
Get Show Time Information.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnd()

ilDateDurationInputGUI::getEnd ( )

Get Date, yyyy-mm-dd.

Returns
object Date, yyyy-mm-dd

Definition at line 160 of file class.ilDateDurationInputGUI.php.

References $end.

Referenced by checkInput(), getValue(), hideSubForm(), and render().

161  {
162  return $this->end;
163  }
+ Here is the caller graph for this function:

◆ getEndText()

ilDateDurationInputGUI::getEndText ( )

Get end text.

Returns

Definition at line 124 of file class.ilDateDurationInputGUI.php.

References $end_text.

Referenced by render().

+ Here is the caller graph for this function:

◆ getMinuteStepSize()

ilDateDurationInputGUI::getMinuteStepSize ( )

Get minute step size.

public

Definition at line 233 of file class.ilDateDurationInputGUI.php.

References $minute_step_size.

Referenced by parseDatePickerConfig().

+ Here is the caller graph for this function:

◆ getShowSeconds()

ilDateDurationInputGUI::getShowSeconds ( )

Show seconds not implemented yet.

Returns

Definition at line 189 of file class.ilDateDurationInputGUI.php.

Referenced by getDatePickerTimeFormat().

190  {
191  return false;
192  }
+ Here is the caller graph for this function:

◆ getShowTime()

ilDateDurationInputGUI::getShowTime ( )

Get Show Time Information.

Returns
boolean Show Time Information

Definition at line 180 of file class.ilDateDurationInputGUI.php.

References $showtime.

Referenced by getDatePickerTimeFormat().

+ Here is the caller graph for this function:

◆ getStart()

ilDateDurationInputGUI::getStart ( )

Get Date, yyyy-mm-dd.

Returns
object Date, yyyy-mm-dd

Definition at line 134 of file class.ilDateDurationInputGUI.php.

References $start.

Referenced by checkInput(), getValue(), hideSubForm(), and render().

+ Here is the caller graph for this function:

◆ getStartText()

ilDateDurationInputGUI::getStartText ( )

get start text

Returns

Definition at line 105 of file class.ilDateDurationInputGUI.php.

References $start_text.

Referenced by render().

+ Here is the caller graph for this function:

◆ getStartYear()

ilDateDurationInputGUI::getStartYear ( )

Get start year.

Returns
integer Start year

Definition at line 209 of file class.ilDateDurationInputGUI.php.

References $startyear.

Referenced by checkInput(), and parseDatePickerConfig().

+ Here is the caller graph for this function:

◆ getTableFilterHTML()

ilDateDurationInputGUI::getTableFilterHTML ( )

Used for table filter presentation.

Returns
string

Implements ilTableFilterItem.

Definition at line 498 of file class.ilDateDurationInputGUI.php.

References render().

499  {
500  return $this->render();
501  }
+ Here is the call graph for this function:

◆ getValue()

ilDateDurationInputGUI::getValue ( )

Used for storing the date duration data in session for table gui filters.

Returns
array

Definition at line 507 of file class.ilDateDurationInputGUI.php.

References array, getEnd(), getStart(), and IL_CAL_UNIX.

508  {
509  return array(
510  'start' => $this->getStart()->get(IL_CAL_UNIX),
511  'end' => $this->getEnd()->get(IL_CAL_UNIX)
512  );
513  }
const IL_CAL_UNIX
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ hideSubForm()

ilDateDurationInputGUI::hideSubForm ( )

Definition at line 529 of file class.ilDateDurationInputGUI.php.

References getEnd(), and getStart().

530  {
531  if ($this->invalid_input_start ||
532  $this->invalid_input_end) {
533  return false;
534  }
535 
536  return ((!$this->getStart() || $this->getStart()->isNull()) &&
537  (!$this->getEnd() || $this->getEnd()->isNull()));
538  }
+ Here is the call graph for this function:

◆ insert()

ilDateDurationInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

Definition at line 485 of file class.ilDateDurationInputGUI.php.

References $html, and render().

486  {
487  $html = $this->render();
488 
489  $a_tpl->setCurrentBlock("prop_generic");
490  $a_tpl->setVariable("PROP_GENERIC", $html);
491  $a_tpl->parseCurrentBlock();
492  }
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ parseDatePickerConfig()

ilDateDurationInputGUI::parseDatePickerConfig ( )
protected

parse properties to datepicker config

Returns
array

Definition at line 365 of file class.ilDateDurationInputGUI.php.

References $config, getMinuteStepSize(), and getStartYear().

Referenced by render().

366  {
367  $config = null;
368  if ($this->getMinuteStepSize()) {
369  $config['stepping'] = (int) $this->getMinuteStepSize();
370  }
371  if ($this->getStartYear()) {
372  $config['minDate'] = $this->getStartYear() . '-01-01';
373  }
374  return $config;
375  }
getMinuteStepSize()
Get minute step size.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render()

ilDateDurationInputGUI::render ( )

Insert property html.

Definition at line 381 of file class.ilDateDurationInputGUI.php.

References $ilUser, $lng, $tpl, $user, ilCalendarUtil\addDateTimePicker(), enabledToggleFullTime(), getDatePickerTimeFormat(), ilFormPropertyGUI\getDisabled(), getEnd(), getEndText(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getStart(), getStartText(), ilCalendarUtil\getUserDateFormat(), IL_CAL_FKT_DATE, parseDatePickerConfig(), and setShowTime().

Referenced by getTableFilterHTML(), and insert().

382  {
384  $lng = $this->lng;
385 
386  $tpl = new ilTemplate("tpl.prop_datetime_duration.html", true, true, "Services/Form");
387 
388  if ($this->enabledToggleFullTime()) {
389  $this->setShowTime(true);
390 
391  $toggle_id = md5($this->getPostVar() . '_fulltime'); // :TODO: unique?
392 
393  $tpl->setCurrentBlock('toggle_fullday');
394  $tpl->setVariable('DATE_TOGGLE_ID', $this->getPostVar() . '[tgl]');
395  $tpl->setVariable('FULLDAY_TOGGLE_ID', $toggle_id);
396  $tpl->setVariable('FULLDAY_TOGGLE_CHECKED', $this->toggle_fulltime_checked ? 'checked="checked"' : '');
397  $tpl->setVariable('FULLDAY_TOGGLE_DISABLED', $this->getDisabled() ? 'disabled="disabled"' : '');
398  $tpl->setVariable('TXT_TOGGLE_FULLDAY', $this->toggle_fulltime_txt);
399  $tpl->parseCurrentBlock();
400  }
401 
402  // config picker
403  if (!$this->getDisabled()) {
404  // :TODO: unique?
405  $picker_start_id = md5($this->getPostVar() . '_start');
406  $picker_end_id = md5($this->getPostVar() . '_end');
407 
408  $tpl->setVariable('DATEPICKER_START_ID', $picker_start_id);
409  $tpl->setVariable('DATEPICKER_END_ID', $picker_end_id);
410 
412  $picker_start_id,
413  $this->getDatePickerTimeFormat(),
414  $this->parseDatePickerConfig(),
415  $picker_end_id,
416  $this->parseDatePickerConfig(),
417  $toggle_id,
418  "subform_" . $this->getPostVar()
419  );
420  } else {
421  $tpl->setVariable('DATEPICKER_START_DISABLED', 'disabled="disabled" ');
422  $tpl->setVariable('DATEPICKER_END_DISABLED', 'disabled="disabled" ');
423  }
424 
425  $start_txt = $this->getStartText();
426  if ($start_txt === null) {
427  $start_txt = $lng->txt("form_date_duration_start");
428  }
429  if (trim($start_txt)) {
430  $tpl->setVariable('START_LABEL', $start_txt);
431  $tpl->touchBlock('start_width_bl');
432  }
433 
434  $end_txt = $this->getEndText();
435  if ($end_txt === null) {
436  $end_txt = $lng->txt("form_date_duration_end");
437  }
438  if (trim($end_txt)) {
439  $tpl->setVariable('END_LABEL', $end_txt);
440  $tpl->touchBlock('end_width_bl');
441  }
442 
443 
444  $tpl->setVariable('DATE_START_ID', $this->getPostVar() . '[start]');
445  $tpl->setVariable('DATE_END_ID', $this->getPostVar() . '[end]');
446 
447  // placeholder
448  // :TODO: i18n?
450  $tpl->setVariable('START_PLACEHOLDER', $pl_format);
451  $tpl->setVariable('END_PLACEHOLDER', $pl_format);
452 
453 
454  // values
455 
456  $date_value = htmlspecialchars($this->invalid_input_start);
457  if (!$date_value &&
458  $this->getStart()) {
459  $out_format = ilCalendarUtil::getUserDateFormat($this->getDatePickerTimeFormat(), true);
460  $date_value = $this->getStart()->get(IL_CAL_FKT_DATE, $out_format, $ilUser->getTimeZone());
461  }
462  $tpl->setVariable('DATEPICKER_START_VALUE', $date_value);
463 
464  $date_value = htmlspecialchars($this->invalid_input_end);
465  if (!$date_value &&
466  $this->getEnd()) {
467  $out_format = ilCalendarUtil::getUserDateFormat($this->getDatePickerTimeFormat(), true);
468  $date_value = $this->getEnd()->get(IL_CAL_FKT_DATE, $out_format, $ilUser->getTimeZone());
469  }
470  $tpl->setVariable('DATEPICKER_END_VALUE', $date_value);
471 
472  if ($this->getRequired()) {
473  $tpl->setVariable("START_REQUIRED", "required=\"required\"");
474  $tpl->setVariable("END_REQUIRED", "required=\"required\"");
475  }
476 
477  return $tpl->get();
478  }
$tpl
Definition: ilias.php:10
getPostVar()
Get Post Variable.
enabledToggleFullTime()
Check if toggling between date and time enabled.
parseDatePickerConfig()
parse properties to datepicker config
static getUserDateFormat($a_add_time=false, $a_for_parsing=false)
Parse current user setting into date/time format.
static addDateTimePicker($a_id, $a_add_time=null, array $a_custom_config=null, $a_id2=null, $a_custom_config2=null, $a_toggle_id=null, $a_subform_id=null)
Add date time picker to element.
special template class to simplify handling of ITX/PEAR
const IL_CAL_FKT_DATE
$ilUser
Definition: imgupload.php:18
setShowTime($a_showtime)
Set Show Time Information.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setEnd()

ilDateDurationInputGUI::setEnd ( ilDateTime  $a_date = null)

Set end date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTime('2008-06-12 08:00:00',IL_CAL_DATETIME));.

For fullday (no timezone conversion) events use:

            $dt_form->setDate(new ilDate('2008-08-01',IL_CAL_DATE));
Parameters
object$a_dateilDate or ilDateTime object

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

Referenced by checkInput(), setValue(), and setValueByArray().

151  {
152  $this->end = $a_date;
153  }
+ Here is the caller graph for this function:

◆ setEndText()

ilDateDurationInputGUI::setEndText (   $a_txt)

Set text, which will be shown before the end date.

Parameters
object$a_txt
Returns

Definition at line 115 of file class.ilDateDurationInputGUI.php.

116  {
117  $this->end_text = $a_txt;
118  }

◆ setMinuteStepSize()

ilDateDurationInputGUI::setMinuteStepSize (   $a_step_size)

Set minute step size E.g 5 => The selection will only show 00,05,10...

minutes

public

Parameters
intminute step_size 1,5,10,15,20...

Definition at line 222 of file class.ilDateDurationInputGUI.php.

223  {
224  $this->minute_step_size = $a_step_size;
225  }

◆ setShowTime()

ilDateDurationInputGUI::setShowTime (   $a_showtime)

Set Show Time Information.

Parameters
boolean$a_showtimeShow Time Information

Definition at line 170 of file class.ilDateDurationInputGUI.php.

Referenced by ilObjTestSettingsGeneralGUI\addAvailabilityProperties(), ilChatroomFormFactory\getSettingsForm(), ilObjPollGUI\initEditCustomForm(), ilObjPortfolioTemplateGUI\initEditCustomForm(), ilObjCourseGUI\initEditForm(), ilObjGroupGUI\initForm(), ilObjSurveyGUI\initPropertiesForm(), and render().

171  {
172  $this->showtime = $a_showtime;
173  }
+ Here is the caller graph for this function:

◆ setStart()

ilDateDurationInputGUI::setStart ( ilDateTime  $a_date = null)

Set start date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTime('2008-06-12 08:00:00',IL_CAL_DATETIME));.

For fullday (no timezone conversion) events use:

            $dt_form->setDate(new ilDate('2008-08-01',IL_CAL_DATE));
Parameters
object$a_dateilDate or ilDateTime object

Definition at line 86 of file class.ilDateDurationInputGUI.php.

Referenced by checkInput(), setValue(), and setValueByArray().

87  {
88  $this->start = $a_date;
89  }
+ Here is the caller graph for this function:

◆ setStartText()

ilDateDurationInputGUI::setStartText (   $a_txt)

Set text, which will be shown before the start date.

Parameters
object$a_txt
Returns

Definition at line 96 of file class.ilDateDurationInputGUI.php.

Referenced by ilChatroomFormFactory\getPeriodForm().

97  {
98  $this->start_text = $a_txt;
99  }
+ Here is the caller graph for this function:

◆ setStartYear()

ilDateDurationInputGUI::setStartYear (   $a_year)

Set start year.

Parameters
integerStart year

Definition at line 199 of file class.ilDateDurationInputGUI.php.

200  {
201  $this->startyear = $a_year;
202  }

◆ setValue()

ilDateDurationInputGUI::setValue (   $value)

Called from table gui with the stored session value Attention: If the user resets the table filter, a boolean false is passed by the table gui.

See also
getValue()
Parameters
array | bool$value

Definition at line 521 of file class.ilDateDurationInputGUI.php.

References IL_CAL_UNIX, setEnd(), and setStart().

522  {
523  if (is_array($value)) {
524  $this->setStart(new ilDateTime($value['start'], IL_CAL_UNIX));
525  $this->setEnd(new ilDateTime($value['end'], IL_CAL_UNIX));
526  }
527  }
setStart(ilDateTime $a_date=null)
Set start date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilD...
const IL_CAL_UNIX
Date and time handling
setEnd(ilDateTime $a_date=null)
Set end date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDat...
+ Here is the call graph for this function:

◆ setValueByArray()

ilDateDurationInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 243 of file class.ilDateDurationInputGUI.php.

References $format, getDatePickerTimeFormat(), ilFormPropertyGUI\getPostVar(), ilSubEnabledFormPropertyGUI\getSubItems(), ilCalendarUtil\parseIncomingDate(), setEnd(), and setStart().

244  {
245  $incoming = $a_values[$this->getPostVar()];
246  if (is_array($incoming)) {
247  $format = $incoming['tgl'] ? 0 : $this->getDatePickerTimeFormat();
248  $this->toggle_fulltime_checked = (bool) $incoming['tgl'];
249  $this->setStart(ilCalendarUtil::parseIncomingDate($incoming["start"], $format));
250  $this->setEnd(ilCalendarUtil::parseIncomingDate($incoming["end"], $format));
251  }
252 
253  foreach ($this->getSubItems() as $item) {
254  $item->setValueByArray($a_values);
255  }
256  }
$format
Definition: metadata.php:141
getPostVar()
Get Post Variable.
setStart(ilDateTime $a_date=null)
Set start date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilD...
setEnd(ilDateTime $a_date=null)
Set end date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDat...
static parseIncomingDate($a_value, $a_add_time=null)
Try to parse incoming value to date object.
+ Here is the call graph for this function:

Field Documentation

◆ $end

ilDateDurationInputGUI::$end = null
protected

Definition at line 31 of file class.ilDateDurationInputGUI.php.

Referenced by checkInput(), and getEnd().

◆ $end_text

ilDateDurationInputGUI::$end_text = null
protected

Definition at line 29 of file class.ilDateDurationInputGUI.php.

Referenced by getEndText().

◆ $lng

ilDateDurationInputGUI::$lng
protected

Definition at line 19 of file class.ilDateDurationInputGUI.php.

Referenced by checkInput(), and render().

◆ $minute_step_size

ilDateDurationInputGUI::$minute_step_size = 5
protected

Definition at line 30 of file class.ilDateDurationInputGUI.php.

Referenced by getMinuteStepSize().

◆ $showtime

ilDateDurationInputGUI::$showtime = false
protected

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

Referenced by getShowTime().

◆ $start

ilDateDurationInputGUI::$start = null
protected

Definition at line 26 of file class.ilDateDurationInputGUI.php.

Referenced by checkInput(), and getStart().

◆ $start_text

ilDateDurationInputGUI::$start_text = null
protected

Definition at line 28 of file class.ilDateDurationInputGUI.php.

Referenced by getStartText().

◆ $startyear

ilDateDurationInputGUI::$startyear = null
protected

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

Referenced by getStartYear().

◆ $toggle_fulltime

ilDateDurationInputGUI::$toggle_fulltime = false
protected

Definition at line 33 of file class.ilDateDurationInputGUI.php.

Referenced by enabledToggleFullTime().

◆ $toggle_fulltime_checked

ilDateDurationInputGUI::$toggle_fulltime_checked = false
protected

Definition at line 35 of file class.ilDateDurationInputGUI.php.

◆ $toggle_fulltime_txt

ilDateDurationInputGUI::$toggle_fulltime_txt = ''
protected

Definition at line 34 of file class.ilDateDurationInputGUI.php.

◆ $user

ilDateDurationInputGUI::$user
protected

Definition at line 24 of file class.ilDateDurationInputGUI.php.

Referenced by render().


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