4 include_once
'Services/Table/interfaces/interface.ilTableFilterItem.php';
47 $this->lng = $DIC->language();
48 $this->
user = $DIC->user();
49 parent::__construct($a_title, $a_postvar);
61 $this->toggle_fulltime_txt = $a_title;
62 $this->toggle_fulltime_checked = $a_checked;
63 $this->toggle_fulltime =
true;
88 $this->start = $a_date;
98 $this->start_text = $a_txt;
117 $this->end_text = $a_txt;
152 $this->end = $a_date;
172 $this->showtime = $a_showtime;
201 $this->startyear = $a_year;
224 $this->minute_step_size = $a_step_size;
246 if (is_array($incoming)) {
248 $this->toggle_fulltime_checked = (bool) $incoming[
'tgl'];
254 $item->setValueByArray($a_values);
272 if (!is_array(
$post)) {
288 $valid_start =
false;
313 $valid_start =
false;
321 $valid = ($valid_start && $valid_end);
331 $this->invalid_input_start =
$start;
332 $this->invalid_input_end =
$end;
386 $tpl =
new ilTemplate(
"tpl.prop_datetime_duration.html",
true,
true,
"Services/Form");
391 $toggle_id = md5($this->
getPostVar() .
'_fulltime');
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();
405 $picker_start_id = md5($this->
getPostVar() .
'_start');
406 $picker_end_id = md5($this->
getPostVar() .
'_end');
408 $tpl->setVariable(
'DATEPICKER_START_ID', $picker_start_id);
409 $tpl->setVariable(
'DATEPICKER_END_ID', $picker_end_id);
421 $tpl->setVariable(
'DATEPICKER_START_DISABLED',
'disabled="disabled" ');
422 $tpl->setVariable(
'DATEPICKER_END_DISABLED',
'disabled="disabled" ');
426 if ($start_txt === null) {
427 $start_txt =
$lng->txt(
"form_date_duration_start");
429 if (trim($start_txt)) {
430 $tpl->setVariable(
'START_LABEL', $start_txt);
431 $tpl->touchBlock(
'start_width_bl');
435 if ($end_txt === null) {
436 $end_txt =
$lng->txt(
"form_date_duration_end");
438 if (trim($end_txt)) {
439 $tpl->setVariable(
'END_LABEL', $end_txt);
440 $tpl->touchBlock(
'end_width_bl');
444 $tpl->setVariable(
'DATE_START_ID', $this->
getPostVar() .
'[start]');
450 $tpl->setVariable(
'START_PLACEHOLDER', $pl_format);
451 $tpl->setVariable(
'END_PLACEHOLDER', $pl_format);
456 $date_value = htmlspecialchars($this->invalid_input_start);
462 $tpl->setVariable(
'DATEPICKER_START_VALUE', $date_value);
464 $date_value = htmlspecialchars($this->invalid_input_end);
470 $tpl->setVariable(
'DATEPICKER_END_VALUE', $date_value);
473 $tpl->setVariable(
"START_REQUIRED",
"required=\"required\"");
474 $tpl->setVariable(
"END_REQUIRED",
"required=\"required\"");
489 $a_tpl->setCurrentBlock(
"prop_generic");
490 $a_tpl->setVariable(
"PROP_GENERIC",
$html);
491 $a_tpl->parseCurrentBlock();
523 if (is_array($value)) {
531 if ($this->invalid_input_start ||
532 $this->invalid_input_end) {
Interface for property form input GUI classes that can be used in table filters.
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.
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
Create styles array
The data for the language used.
static parseIncomingDate($a_value, $a_add_time=null)
Try to parse incoming value to date object.