ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilDclDatetimeFieldRepresentation.php
Go to the documentation of this file.
1 <?php
2 require_once ('./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php');
10 
11  public function getInputField(ilPropertyFormGUI $form, $record_id = 0) {
12  $input = new ilDateTimeInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
13  $input->setStartYear(date("Y") - 100);
14  $this->setupInputField($input, $this->getField());
15  return $input;
16  }
17 
18  public function addFilterInputFieldToTable(ilTable2GUI $table) {
19  $input = $table->addFilterItemByMetaType("filter_" . $this->getField()->getId(), ilTable2GUI::FILTER_DATE_RANGE, false, $this->getField()->getId());
20  $input->setSubmitFormOnEnter(true);
21  $input->setStartYear(date("Y") - 100);
22 
23  $this->setupFilterInputField($input);
24 
25  return $this->getFilterInputFieldValue($input);
26  }
27 
28 
29  public function passThroughFilter(ilDclBaseRecordModel $record, $filter) {
30  $value = $record->getRecordFieldValue($this->getField()->getId());
31  if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
32  return true;
33  }
34  return false;
35  }
36 }
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
This class represents a property form user interface.
This class represents a date/time property in a property form.
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
Class ilTable2GUI.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
setupFilterInputField(ilFormPropertyGUI $input)
Set basic settings for filter-input-gui.
Class ilDclBaseRecordModel.
getRecordFieldValue($field_id)
Get Field Value.
getInputField(ilPropertyFormGUI $form, $record_id=0)
passThroughFilter(ilDclBaseRecordModel $record, $filter)
Class ilDclBaseFieldRepresentation.