2 require_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
3 require_once(
'./Services/ActiveRecord/Views/Edit/class.arEditField.php');
4 require_once(
'./Services/ActiveRecord/Views/Edit/class.arEditFields.php');
54 $this->ctrl->saveParameter($parent_gui,
'ar_id');
69 if ($this->ar->getPrimaryFieldValue() != 0) {
79 $this->
fields->sortFields();
90 $this->BeforeInitForm();
93 $this->generateFormFields();
106 $this->
setFormAction($this->ctrl->getFormAction($this->parent_gui,
"index"));
113 if ($this->ar->getPrimaryFieldValue() == 0) {
121 protected function generateFormFields()
123 foreach ($this->
fields->getFields() as $field) {
127 if ($field->getVisible()) {
139 $field_element = null;
215 $date_input->setShowTime(
true);
234 if ($this->ar->getPrimaryFieldValue() == 0) {
253 public function fillForm()
256 foreach ($this->
fields->getFields() as $field) {
260 if ($field->getVisible()) {
261 if ($field->getFormElement()) {
262 $this->fillFormField($field);
283 protected function fillFormField(
arEditField $field)
287 case 'ilCheckboxInputGUI':
289 $field->
getFormElement()->setChecked($this->ar->$get_function() == 1 ? true :
false);
291 case 'ilNumberInputGUI':
292 case 'ilSelectInputGUI':
293 case 'ilTextInputGUI':
294 case 'ilTextAreaInputGUI':
295 case 'ilRadioGroupInputGUI':
298 case 'ilDateTimeInputGUI':
304 $form_item->
setDate($datetime);
330 public function saveObject()
343 $modified_by_field = $this->
getFields()->getModifiedByField();
344 if ($modified_by_field) {
345 $set_modified_by_function = $modified_by_field->getSetFunctionName();
346 $this->ar->$set_modified_by_function(
$ilUser->getId());
348 $modification_date_field = $this->
getFields()->getModificationDateField();
349 if ($modification_date_field) {
350 $set_modification_date_function = $modification_date_field->getSetFunctionName();
352 $this->ar->$set_modification_date_function($datetime);
354 if ($this->ar->getPrimaryFieldValue() != 0) {
357 $created_by_field = $this->
getFields()->getCreatedByField();
358 if ($created_by_field) {
359 $set_created_by_function = $created_by_field->getSetFunctionName();
360 $this->ar->$set_created_by_function(
$ilUser->getId());
362 $creation_date_field = $this->
getFields()->getCreationDateField();
363 if ($creation_date_field) {
364 $set_creation_date_function = $creation_date_field->getSetFunctionName();
366 $this->ar->$set_creation_date_function($datetime);
402 foreach ($this->
fields->getFields() as $field) {
403 if (!$this->setArFieldAfterSubmit($field)) {
423 protected function setArFieldAfterSubmit(
arEditField $field)
437 case 'ilNumberInputGUI':
438 case 'ilCheckboxInputGUI':
439 case 'ilSelectInputGUI':
440 case 'ilRadioGroupInputGUI':
442 case 'ilTextInputGUI':
443 case 'ilTextAreaInputGUI':
445 case 'ilDateTimeInputGUI':
495 if ($value[
'time']) {
500 $this->ar->$set_function($datetime);
566 return $this->
getFields()->getField($field_name);
585 protected function txt(
$txt, $plugin_txt =
true)
587 return $this->parent_gui->txt(
$txt, $plugin_txt);
addFormField(arEditField $field)
txt($txt, $plugin_txt=true)
setFormPrefix($form_prefix)
addTextInputField(arEditField $field)
addBooleanInputField(arEditField $field)
setFormElement($form_element)
setCustomRecordField(arEditField $field)
setDateTimeRecordField(arEditField $field)
setNumericRecordField(arEditField $field)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
This class represents a text property in a property form.
addEditField(arEditField $field)
setTextRecordField(arEditField $field)
__construct(arGUI $parent_gui, ActiveRecord $ar)
setDate($a_date, $a_format)
Set date.
This class represents a text area property in a property form.
addNumbericInputField(arEditField $field)
handleEmptyPostValue(arEditField $field)
addClobInputField(arEditField $field)
fillCustomFormField(arEditField $field)
setFields(arEditFields $fields)
Setters and Getters *********************.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
addDateTimeInputField(arEditField $field)
init()
Form Initialization **********************.