ILIAS  release_8 Revision v8.24
class.ilDclDatetimeFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
20{
21 public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilDateTimeInputGUI
22 {
23 $input = new ilDateTimeInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
24 $input->setStartYear(date("Y") - 100);
25 $this->setupInputField($input, $this->getField());
26
27 return $input;
28 }
29
30 public function addFilterInputFieldToTable(ilTable2GUI $table): ?array
31 {
32 $input = $table->addFilterItemByMetaType(
33 "filter_" . $this->getField()->getId(),
35 false,
36 $this->getField()->getId()
37 );
38 $input->setSubmitFormOnEnter(true);
39 $input->setStartYear(date("Y") - 100);
40
41 $this->setupFilterInputField($input);
42
43 return $this->getFilterInputFieldValue($input);
44 }
45
49 public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
50 {
51 $value = $record->getRecordFieldValue($this->getField()->getId());
52 if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
53 return true;
54 }
55
56 return false;
57 }
58}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
getRecordFieldValue(?int $field_id)
Get Field Value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
Returns field-input.
addFilterInputFieldToTable(ilTable2GUI $table)
Add filter input to TableGUI.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
This class represents a property form user interface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.