2 require_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
3 require_once(
'./Customizing/global/plugins/Libraries/ActiveRecord/Views/Edit/class.arEditField.php');
4 require_once(
'./Customizing/global/plugins/Libraries/ActiveRecord/Views/Edit/class.arEditFields.php');
51 $this->ctrl->saveParameter($parent_gui,
'ar_id');
62 protected function init() {
65 if ($this->ar->getPrimaryFieldValue() != 0) {
74 $this->
fields->sortFields();
83 $this->BeforeInitForm();
86 $this->generateFormFields();
97 $this->
setFormAction($this->ctrl->getFormAction($this->parent_gui,
"index"));
103 if ($this->ar->getPrimaryFieldValue() == 0) {
111 protected function generateFormFields() {
113 foreach ($this->
fields->getFields() as $field) {
117 if ($field->getVisible()) {
128 $field_element = NULL;
200 $date_input->setShowTime(
true);
217 if ($this->ar->getPrimaryFieldValue() == 0) {
235 public function fillForm() {
237 foreach ($this->
fields->getFields() as $field) {
241 if ($field->getVisible()) {
242 if ($field->getFormElement()) {
243 $this->fillFormField($field);
262 protected function fillFormField(
arEditField $field) {
265 case 'ilCheckboxInputGUI':
267 $field->
getFormElement()->setChecked($this->ar->$get_function() == 1 ?
true :
false);
269 case 'ilNumberInputGUI':
270 case 'ilSelectInputGUI':
271 case 'ilTextInputGUI':
272 case 'ilTextAreaInputGUI':
273 case 'ilRadioGroupInputGUI':
276 case 'ilDateTimeInputGUI':
282 $form_item->
setDate($datetime);
307 public function saveObject() {
318 $modified_by_field = $this->
getFields()->getModifiedByField();
319 if ($modified_by_field) {
320 $set_modified_by_function = $modified_by_field->getSetFunctionName();
321 $this->ar->$set_modified_by_function($ilUser->getId());
323 $modification_date_field = $this->
getFields()->getModificationDateField();
324 if ($modification_date_field) {
325 $set_modification_date_function = $modification_date_field->getSetFunctionName();
327 $this->ar->$set_modification_date_function($datetime);
329 if ($this->ar->getPrimaryFieldValue() != 0) {
332 $created_by_field = $this->
getFields()->getCreatedByField();
333 if ($created_by_field) {
334 $set_created_by_function = $created_by_field->getSetFunctionName();
335 $this->ar->$set_created_by_function($ilUser->getId());
337 $creation_date_field = $this->
getFields()->getCreationDateField();
338 if ($creation_date_field) {
339 $set_creation_date_function = $creation_date_field->getSetFunctionName();
341 $this->ar->$set_creation_date_function($datetime);
374 foreach ($this->
fields->getFields() as $field) {
375 if (!$this->setArFieldAfterSubmit($field)) {
394 protected function setArFieldAfterSubmit(
arEditField $field) {
407 case 'ilNumberInputGUI':
408 case 'ilCheckboxInputGUI':
409 case 'ilSelectInputGUI':
410 case 'ilRadioGroupInputGUI':
412 case 'ilTextInputGUI':
413 case 'ilTextAreaInputGUI':
415 case 'ilDateTimeInputGUI':
461 if ($value[
'time']) {
466 $this->ar->$set_function($datetime);
526 return $this->
getFields()->getField($field_name);
544 protected function txt(
$txt, $plugin_txt =
true) {
545 return $this->parent_gui->txt(
$txt, $plugin_txt);