ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilDclNumberFieldRepresentation.php
Go to the documentation of this file.
1 <?php
2 require_once ('./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php');
3 
11 
12  public function getInputField(ilPropertyFormGUI $form, $record_id = 0) {
13  $input = new ilNumberInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
14  // 9 is the maximum number of digits for an integer
15  $input->setMaxLength(9);
16  $input->setInfo($this->lng->txt('dcl_max_digits') . ": 9");
17  $this->setupInputField($input, $this->getField());
18  return $input;
19  }
20 
21  public function addFilterInputFieldToTable(ilTable2GUI $table) {
22  $input = $table->addFilterItemByMetaType("filter_" . $this->getField()->getId(), ilTable2GUI::FILTER_NUMBER_RANGE, false, $this->getField()->getId());
23  $input->setSubmitFormOnEnter(true);
24 
25  $this->setupFilterInputField($input);
26 
27  return $this->getFilterInputFieldValue($input);
28  }
29 
30 
31  public function passThroughFilter(ilDclBaseRecordModel $record, $filter) {
32  $value = $record->getRecordFieldValue($this->getField()->getId());
33  if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
34  return true;
35  }
36  return false;
37  }
38 
39 
43  protected function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create') {
44  $opt = parent::buildFieldCreationInput($dcl, $mode);
45  return $opt;
46  }
47 }
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
This class represents a property form user interface.
getInputField(ilPropertyFormGUI $form, $record_id=0)
const FILTER_NUMBER_RANGE
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
Class ilTable2GUI.
This class represents a number property in a property form.
setupFilterInputField(ilFormPropertyGUI $input)
Set basic settings for filter-input-gui.
Class ilDclBaseRecordModel.
getRecordFieldValue($field_id)
Get Field Value.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
Class ilDclBaseFieldRepresentation.
Class ilObjDataCollection.