ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDclDatetimeFieldRepresentation Class Reference
+ Inheritance diagram for ilDclDatetimeFieldRepresentation:
+ Collaboration diagram for ilDclDatetimeFieldRepresentation:

Public Member Functions

 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 
 addFilterInputFieldToTable (ilTable2GUI $table)
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 
- Public Member Functions inherited from ilDclBaseFieldRepresentation
 __construct (ilDclBaseFieldModel $field)
 
 addFilterInputFieldToTable (ilTable2GUI $table)
 Add filter input to TableGUI. More...
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 Checks if a filter affects a record. More...
 
 parseSortingValue (string $value, bool $link=true)
 
 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 Returns field-input. More...
 
 addFieldCreationForm (ilSubEnabledFormPropertyGUI $form, ilObjDataCollection $dcl, string $mode="create")
 Adds the options for the field-types to the field-creation form. More...
 
 getPropertyInputFieldId (string $property)
 Return post-var for property-fields. More...
 
 getField ()
 Return BaseFieldModel. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ilDclBaseFieldRepresentation
 setupFilterInputField (?ilTableFilterItem $input)
 Set basic settings for filter-input-gui. More...
 
 setupInputField (ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
 Sets basic settings on field-input. More...
 
 getFilterInputFieldValue (ilTableFilterItem $input)
 
 buildFieldCreationInput (ilObjDataCollection $dcl, string $mode='create')
 Build the creation-input-field. More...
 
- Protected Attributes inherited from ilDclBaseFieldRepresentation
ilDclBaseFieldModel $field
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilComponentRepository $component_repository
 
ilComponentFactory $component_factory
 

Detailed Description

Definition at line 21 of file class.ilDclDatetimeFieldRepresentation.php.

Member Function Documentation

◆ addFilterInputFieldToTable()

ilDclDatetimeFieldRepresentation::addFilterInputFieldToTable ( ilTable2GUI  $table)

Definition at line 32 of file class.ilDclDatetimeFieldRepresentation.php.

References ilTable2GUI\addFilterItemByMetaType(), ilTable2GUI\FILTER_DATE_RANGE, ilDclBaseFieldRepresentation\getField(), ilDclBaseFieldRepresentation\getFilterInputFieldValue(), ILIAS\Survey\Mode\getId(), and ilDclBaseFieldRepresentation\setupFilterInputField().

32  : ?array
33  {
34  $input = $table->addFilterItemByMetaType(
35  "filter_" . $this->getField()->getId(),
37  false,
38  $this->getField()->getId()
39  );
40  $input->setSubmitFormOnEnter(true);
41  $input->setStartYear(date("Y") - 100);
42 
43  $this->setupFilterInputField($input);
44 
45  return $this->getFilterInputFieldValue($input);
46  }
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
+ Here is the call graph for this function:

◆ getInputField()

ilDclDatetimeFieldRepresentation::getInputField ( ilPropertyFormGUI  $form,
?int  $record_id = null 
)

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

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), and ilDclBaseFieldRepresentation\setupInputField().

24  {
25  $input = new ilDateTimeInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
26  $input->setStartYear(date("Y") - 100);
27  $this->setupInputField($input, $this->getField());
28 
29  return $input;
30  }
This class represents a date/time property in a property form.
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
+ Here is the call graph for this function:

◆ passThroughFilter()

ilDclDatetimeFieldRepresentation::passThroughFilter ( ilDclBaseRecordModel  $record,
  $filter 
)
Parameters
array$filter

Definition at line 51 of file class.ilDclDatetimeFieldRepresentation.php.

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), and ilDclBaseRecordModel\getRecordFieldValue().

51  : bool
52  {
53  $value = $record->getRecordFieldValue($this->getField()->getId());
54  if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
55  return true;
56  }
57 
58  return false;
59  }
getRecordFieldValue(?string $field_id)
Get Field Value.
+ Here is the call graph for this function:

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