ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
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

 $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
 $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 33 of file class.ilDateDurationInputGUI.php.

References ilFormPropertyGUI\setType().

34  {
35  parent::__construct($a_title, $a_postvar);
36  $this->setType("dateduration");
37  }
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 250 of file class.ilDateDurationInputGUI.php.

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

251  {
252  global $lng;
253 
254  if($this->getDisabled())
255  {
256  return true;
257  }
258 
259  $post = $_POST[$this->getPostVar()];
260  if(!is_array($post))
261  {
262  return false;
263  }
264 
265  $start = $post["start"];
266  $end = $post["end"];
267 
268  // if full day is active, ignore time format
269  $format = $post['tgl']
270  ? 0
271  : $this->getDatePickerTimeFormat();
272 
273  // always done to make sure there are no obsolete values left
274  $this->setStart(null);
275  $this->setEnd(null);
276 
277  $valid_start = false;
278  if(trim($start))
279  {
280  $parsed = ilCalendarUtil::parseIncomingDate($start, $format);
281  if($parsed)
282  {
283  $this->setStart($parsed);
284  $valid_start = true;
285  }
286  }
287  else if(!$this->getRequired() && !trim($end))
288  {
289  $valid_start = true;
290  }
291 
292  $valid_end = false;
293  if(trim($end))
294  {
295  $parsed = ilCalendarUtil::parseIncomingDate($end, $format);
296  if($parsed)
297  {
298  $this->setEnd($parsed);
299  $valid_end = true;
300  }
301  }
302  else if(!$this->getRequired() && !trim($start))
303  {
304  $valid_end = true;
305  }
306 
307  if($this->getStartYear())
308  {
309  if($valid_start &&
310  $this->getStart()->get(IL_CAL_FKT_DATE, "Y") < $this->getStartYear())
311  {
312  $valid_start = false;
313  }
314  if($valid_end &&
315  $this->getEnd()->get(IL_CAL_FKT_DATE, "Y") < $this->getStartYear())
316  {
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  {
328  $valid = false;
329  }
330 
331  if(!$valid)
332  {
333  $this->invalid_input_start = $start;
334  $this->invalid_input_end = $end;
335 
336  $_POST[$this->getPostVar()]["start"] = null;
337  $_POST[$this->getPostVar()]["end"] = null;
338 
339  $this->setAlert($lng->txt("form_msg_wrong_date"));
340  }
341  else
342  {
343  if($this->getStart() &&
344  $this->getEnd())
345  {
346  // getInput() should return a generic format
347  $post_format = $format
349  : IL_CAL_DATE;
350  $_POST[$this->getPostVar()]["start"] = $this->getStart()->get($post_format);
351  $_POST[$this->getPostVar()]["end"] = $this->getEnd()->get($post_format);
352  unset($_POST[$this->getPostVar()]["tgl"]);
353  }
354  else
355  {
356  $_POST[$this->getPostVar()]["start"] = null;
357  $_POST[$this->getPostVar()]["end"] = null;
358  }
359  }
360 
361  if($valid)
362  {
363  $valid = $this->checkSubItemsInput();
364  }
365 
366  return $valid;
367  }
const IL_CAL_DATETIME
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
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...
const IL_CAL_DATE
global $lng
Definition: privfeed.php:17
$_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 56 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 45 of file class.ilDateDurationInputGUI.php.

46  {
47  $this->toggle_fulltime_txt = $a_title;
48  $this->toggle_fulltime_checked = $a_checked;
49  $this->toggle_fulltime = true;
50  }

◆ getDatePickerTimeFormat()

ilDateDurationInputGUI::getDatePickerTimeFormat ( )
protected

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

References getShowSeconds(), and getShowTime().

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

370  {
371  return (int)$this->getShowTime() + (int)$this->getShowSeconds();
372  }
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 146 of file class.ilDateDurationInputGUI.php.

References $end.

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

147  {
148  return $this->end;
149  }
+ Here is the caller graph for this function:

◆ getEndText()

ilDateDurationInputGUI::getEndText ( )

Get end text.

Returns

Definition at line 110 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 219 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 175 of file class.ilDateDurationInputGUI.php.

Referenced by getDatePickerTimeFormat().

176  {
177  return false;
178  }
+ Here is the caller graph for this function:

◆ getShowTime()

ilDateDurationInputGUI::getShowTime ( )

Get Show Time Information.

Returns
boolean Show Time Information

Definition at line 166 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 120 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 91 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 195 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 524 of file class.ilDateDurationInputGUI.php.

References render().

525  {
526  return $this->render();
527  }
+ 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 533 of file class.ilDateDurationInputGUI.php.

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

534  {
535  return array(
536  'start' => $this->getStart()->get(IL_CAL_UNIX),
537  'end' => $this->getEnd()->get(IL_CAL_UNIX)
538  );
539  }
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 556 of file class.ilDateDurationInputGUI.php.

References getEnd(), and getStart().

557  {
558  if($this->invalid_input_start ||
559  $this->invalid_input_end)
560  {
561  return false;
562  }
563 
564  return ((!$this->getStart() || $this->getStart()->isNull()) &&
565  (!$this->getEnd() || $this->getEnd()->isNull()));
566  }
+ Here is the call graph for this function:

◆ insert()

ilDateDurationInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

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

References $html, and render().

512  {
513  $html = $this->render();
514 
515  $a_tpl->setCurrentBlock("prop_generic");
516  $a_tpl->setVariable("PROP_GENERIC", $html);
517  $a_tpl->parseCurrentBlock();
518  }
$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 379 of file class.ilDateDurationInputGUI.php.

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

Referenced by render().

380  {
381  $config = null;
382  if($this->getMinuteStepSize())
383  {
384  $config['stepping'] = (int)$this->getMinuteStepSize();
385  }
386  if($this->getStartYear())
387  {
388  $config['minDate'] = $this->getStartYear().'-01-01';
389  }
390  return $config;
391  }
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 397 of file class.ilDateDurationInputGUI.php.

References $ilUser, $lng, $tpl, 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().

398  {
399  global $ilUser, $lng;
400 
401  $tpl = new ilTemplate("tpl.prop_datetime_duration.html", true, true, "Services/Form");
402 
403  if($this->enabledToggleFullTime())
404  {
405  $this->setShowTime(true);
406 
407  $toggle_id = md5($this->getPostVar().'_fulltime'); // :TODO: unique?
408 
409  $tpl->setCurrentBlock('toggle_fullday');
410  $tpl->setVariable('DATE_TOGGLE_ID', $this->getPostVar().'[tgl]');
411  $tpl->setVariable('FULLDAY_TOGGLE_ID', $toggle_id);
412  $tpl->setVariable('FULLDAY_TOGGLE_CHECKED', $this->toggle_fulltime_checked ? 'checked="checked"' : '');
413  $tpl->setVariable('FULLDAY_TOGGLE_DISABLED', $this->getDisabled() ? 'disabled="disabled"' : '');
414  $tpl->setVariable('TXT_TOGGLE_FULLDAY', $this->toggle_fulltime_txt);
415  $tpl->parseCurrentBlock();
416  }
417 
418  // config picker
419  if(!$this->getDisabled())
420  {
421  // :TODO: unique?
422  $picker_start_id = md5($this->getPostVar().'_start');
423  $picker_end_id = md5($this->getPostVar().'_end');
424 
425  $tpl->setVariable('DATEPICKER_START_ID', $picker_start_id);
426  $tpl->setVariable('DATEPICKER_END_ID', $picker_end_id);
427 
429  $picker_start_id,
430  $this->getDatePickerTimeFormat(),
431  $this->parseDatePickerConfig(),
432  $picker_end_id,
433  $this->parseDatePickerConfig(),
434  $toggle_id,
435  "subform_".$this->getPostVar()
436  );
437  }
438  else
439  {
440  $tpl->setVariable('DATEPICKER_START_DISABLED', 'disabled="disabled" ');
441  $tpl->setVariable('DATEPICKER_END_DISABLED', 'disabled="disabled" ');
442  }
443 
444  $start_txt = $this->getStartText();
445  if($start_txt === null)
446  {
447  $start_txt = $lng->txt("form_date_duration_start");
448  }
449  if(trim($start_txt))
450  {
451  $tpl->setVariable('START_LABEL', $start_txt);
452  $tpl->touchBlock('start_width_bl');
453  }
454 
455  $end_txt = $this->getEndText();
456  if($end_txt === null)
457  {
458  $end_txt = $lng->txt("form_date_duration_end");
459  }
460  if(trim($end_txt))
461  {
462  $tpl->setVariable('END_LABEL', $end_txt);
463  $tpl->touchBlock('end_width_bl');
464  }
465 
466 
467  $tpl->setVariable('DATE_START_ID', $this->getPostVar().'[start]');
468  $tpl->setVariable('DATE_END_ID', $this->getPostVar().'[end]');
469 
470  // placeholder
471  // :TODO: i18n?
473  $tpl->setVariable('START_PLACEHOLDER', $pl_format);
474  $tpl->setVariable('END_PLACEHOLDER', $pl_format);
475 
476 
477  // values
478 
479  $date_value = htmlspecialchars($this->invalid_input_start);
480  if(!$date_value &&
481  $this->getStart())
482  {
483  $out_format = ilCalendarUtil::getUserDateFormat($this->getDatePickerTimeFormat(), true);
484  $date_value = $this->getStart()->get(IL_CAL_FKT_DATE, $out_format, $ilUser->getTimeZone());
485  }
486  $tpl->setVariable('DATEPICKER_START_VALUE', $date_value);
487 
488  $date_value = htmlspecialchars($this->invalid_input_end);
489  if(!$date_value &&
490  $this->getEnd())
491  {
492  $out_format = ilCalendarUtil::getUserDateFormat($this->getDatePickerTimeFormat(), true);
493  $date_value = $this->getEnd()->get(IL_CAL_FKT_DATE, $out_format, $ilUser->getTimeZone());
494  }
495  $tpl->setVariable('DATEPICKER_END_VALUE', $date_value);
496 
497  if($this->getRequired())
498  {
499  $tpl->setVariable("START_REQUIRED", "required=\"required\"");
500  $tpl->setVariable("END_REQUIRED", "required=\"required\"");
501  }
502 
503  return $tpl->get();
504  }
getPostVar()
Get Post Variable.
enabledToggleFullTime()
Check if toggling between date and time enabled.
parseDatePickerConfig()
parse properties to datepicker config
global $tpl
Definition: ilias.php:8
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.
global $lng
Definition: privfeed.php:17
+ 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 136 of file class.ilDateDurationInputGUI.php.

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

137  {
138  $this->end = $a_date;
139  }
+ 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 101 of file class.ilDateDurationInputGUI.php.

102  {
103  $this->end_text = $a_txt;
104  }

◆ 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 208 of file class.ilDateDurationInputGUI.php.

209  {
210  $this->minute_step_size = $a_step_size;
211  }

◆ setShowTime()

ilDateDurationInputGUI::setShowTime (   $a_showtime)

Set Show Time Information.

Parameters
boolean$a_showtimeShow Time Information

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

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

157  {
158  $this->showtime = $a_showtime;
159  }
+ 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 72 of file class.ilDateDurationInputGUI.php.

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

73  {
74  $this->start = $a_date;
75  }
+ 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 82 of file class.ilDateDurationInputGUI.php.

83  {
84  $this->start_text = $a_txt;
85  }

◆ setStartYear()

ilDateDurationInputGUI::setStartYear (   $a_year)

Set start year.

Parameters
integerStart year

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

186  {
187  $this->startyear = $a_year;
188  }

◆ 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 547 of file class.ilDateDurationInputGUI.php.

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

548  {
549  if(is_array($value))
550  {
551  $this->setStart(new ilDateTime($value['start'], IL_CAL_UNIX));
552  $this->setEnd(new ilDateTime($value['end'], IL_CAL_UNIX));
553  }
554  }
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 229 of file class.ilDateDurationInputGUI.php.

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

230  {
231  $incoming = $a_values[$this->getPostVar()];
232  if(is_array($incoming))
233  {
234  $format = $this->getDatePickerTimeFormat();
235  $this->setStart(ilCalendarUtil::parseIncomingDate($incoming["start"], $format));
236  $this->setEnd(ilCalendarUtil::parseIncomingDate($incoming["end"], $format));
237  }
238 
239  foreach($this->getSubItems() as $item)
240  {
241  $item->setValueByArray($a_values);
242  }
243  }
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 21 of file class.ilDateDurationInputGUI.php.

Referenced by checkInput(), and getEnd().

◆ $end_text

ilDateDurationInputGUI::$end_text = null
protected

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

Referenced by getEndText().

◆ $minute_step_size

ilDateDurationInputGUI::$minute_step_size = 5
protected

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

Referenced by getMinuteStepSize().

◆ $showtime

ilDateDurationInputGUI::$showtime = false
protected

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

Referenced by getShowTime().

◆ $start

ilDateDurationInputGUI::$start = null
protected

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

Referenced by checkInput(), and getStart().

◆ $start_text

ilDateDurationInputGUI::$start_text = null
protected

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

Referenced by getStartText().

◆ $startyear

ilDateDurationInputGUI::$startyear = null
protected

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

Referenced by getStartYear().

◆ $toggle_fulltime

ilDateDurationInputGUI::$toggle_fulltime = false
protected

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

Referenced by enabledToggleFullTime().

◆ $toggle_fulltime_checked

ilDateDurationInputGUI::$toggle_fulltime_checked = false
protected

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

◆ $toggle_fulltime_txt

ilDateDurationInputGUI::$toggle_fulltime_txt = ''
protected

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


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