ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ilBookingObjectGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilBookingObjectGUI:
+ Collaboration diagram for ilBookingObjectGUI:

Public Member Functions

 activateManagement (bool $a_val)
 
 isManagementActivated ()
 Is management activated? More...
 
 render ()
 Render list of booking objects uses ilBookingObjectsTableGUI. More...
 
 applyFilter ()
 
 resetFilter ()
 
 create (?ilPropertyFormGUI $a_form=null)
 Render creation form. More...
 
 edit (?ilPropertyFormGUI $a_form=null)
 Render edit form. More...
 
 initForm (string $a_mode="create", ?int $id=null)
 Build property form. More...
 
 save ()
 
 update ()
 
 confirmDelete ()
 
 delete ()
 
 deliverInfo ()
 

Protected Member Functions

 getPoolRefId ()
 
 getPoolObjId ()
 
 hasPoolSchedule ()
 Has booking pool a schedule? More...
 
 getPoolOverallLimit ()
 Get booking pool overall limit. More...
 
 showNoScheduleMessage ()
 
 returnToPreferences ()
 
 setHelpId (string $a_id)
 

Protected Attributes

ILIAS BookingManager Objects ObjectsManager $objects_manager
 
ILIAS BookingManager Schedule ScheduleManager $schedule_manager
 
ilBookBulkCreationGUI $bulk_creation_gui
 
ilObjBookingPool $pool
 
ILIAS BookingManager InternalGUIService $gui
 
ILIAS BookingManager Access AccessManager $access
 
ILIAS BookingManager StandardGUIRequest $book_request
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilTabsGUI $tabs
 
ilBookingHelpAdapter $help
 
ilObjectDataCache $obj_data_cache
 
ilObjUser $user
 
bool $pool_has_schedule
 
int $pool_overall_limit
 
bool $pool_uses_preferences = false
 
bool $management = true
 
int $context_obj_id
 
int $object_id
 
string $seed
 
string $sseed
 
ilObjBookingPoolGUI $pool_gui
 
array $rsv_ids = []
 
ilAdvancedMDRecordGUI $record_gui
 
int $ref_id
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om ilBookingObjectGUI: ilPropertyFormGUI, ilBookingProcessWithScheduleGUI, ilBookingProcessWithoutScheduleGUI ilBookingObjectGUI: ilBookBulkCreationGUI

Definition at line 24 of file class.ilBookingObjectGUI.php.

Member Function Documentation

◆ activateManagement()

ilBookingObjectGUI::activateManagement ( bool  $a_val)

Definition at line 119 of file class.ilBookingObjectGUI.php.

Referenced by ilBookingObjectServiceGUI\__construct().

119  : void
120  {
121  $this->management = $a_val;
122  }
+ Here is the caller graph for this function:

◆ applyFilter()

ilBookingObjectGUI::applyFilter ( )

Definition at line 271 of file class.ilBookingObjectGUI.php.

References getPoolObjId(), getPoolOverallLimit(), getPoolRefId(), hasPoolSchedule(), isManagementActivated(), and render().

271  : void
272  {
273  $table = new ilBookingObjectsTableGUI($this, 'render', $this->getPoolRefId(), $this->getPoolObjId(), $this->hasPoolSchedule(), $this->getPoolOverallLimit(), $this->isManagementActivated());
274  $table->resetOffset();
275  $table->writeFilterToSession();
276  $this->render();
277  }
hasPoolSchedule()
Has booking pool a schedule?
getPoolOverallLimit()
Get booking pool overall limit.
isManagementActivated()
Is management activated?
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
render()
Render list of booking objects uses ilBookingObjectsTableGUI.
+ Here is the call graph for this function:

◆ confirmDelete()

ilBookingObjectGUI::confirmDelete ( )

Definition at line 560 of file class.ilBookingObjectGUI.php.

References $ctrl, $lng, $tabs, $tpl, ILIAS\Repository\access(), ilTabsGUI\clearTargets(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

560  : void
561  {
562  if (!$this->access->canManageObjects($this->ref_id)) {
563  return;
564  }
565 
566  $ilCtrl = $this->ctrl;
567  $lng = $this->lng;
568  $tpl = $this->tpl;
569  $ilTabs = $this->tabs;
570 
571  $ilTabs->clearTargets();
572  $ilTabs->setBackTarget($lng->txt('book_back_to_list'), $ilCtrl->getLinkTarget($this, 'render'));
573 
574  $conf = new ilConfirmationGUI();
575  $conf->setFormAction($ilCtrl->getFormAction($this));
576  $conf->setHeaderText($lng->txt('book_confirm_delete'));
577 
578  $type = new ilBookingObject($this->object_id);
579  $conf->addItem('object_id', $this->object_id, $type->getTitle());
580  $conf->setConfirm($lng->txt('delete'), 'delete');
581  $conf->setCancel($lng->txt('cancel'), 'render');
582 
583  $tpl->setContent($conf->getHTML());
584  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
clearTargets()
clear all targets
+ Here is the call graph for this function:

◆ create()

ilBookingObjectGUI::create ( ?ilPropertyFormGUI  $a_form = null)

Render creation form.

Definition at line 290 of file class.ilBookingObjectGUI.php.

References $ctrl, $lng, $tabs, $tpl, ILIAS\Repository\access(), ilTabsGUI\clearTargets(), initForm(), ILIAS\UICore\GlobalTemplate\setContent(), setHelpId(), and ilLanguage\txt().

Referenced by save().

290  : void
291  {
292  if (!$this->access->canManageObjects($this->ref_id)) {
293  return;
294  }
295 
296  $ilCtrl = $this->ctrl;
297  $tpl = $this->tpl;
298  $lng = $this->lng;
299  $ilTabs = $this->tabs;
300 
301  $ilTabs->clearTargets();
302  $ilTabs->setBackTarget($lng->txt('book_back_to_list'), $ilCtrl->getLinkTarget($this, 'render'));
303 
304  $this->setHelpId('create');
305 
306  if (!$a_form) {
307  $a_form = $this->initForm();
308  }
309  $tpl->setContent($a_form->getHTML());
310  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
clearTargets()
clear all targets
initForm(string $a_mode="create", ?int $id=null)
Build property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilBookingObjectGUI::delete ( )

Definition at line 586 of file class.ilBookingObjectGUI.php.

References $ctrl, $lng, ILIAS\Repository\access(), and ilLanguage\txt().

586  : void
587  {
588  if (!$this->access->canManageObjects($this->ref_id)) {
589  return;
590  }
591 
592  $ilCtrl = $this->ctrl;
593  $lng = $this->lng;
594 
595  $obj = new ilBookingObject($this->object_id);
596  $obj->deleteReservationsAndCalEntries($this->object_id);
597  $obj->delete();
598 
599  $this->tpl->setOnScreenMessage('success', $lng->txt('book_object_deleted'), true);
600  $ilCtrl->setParameter($this, 'object_id', "");
601  $ilCtrl->redirect($this, 'render');
602  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ deliverInfo()

ilBookingObjectGUI::deliverInfo ( )

Definition at line 605 of file class.ilBookingObjectGUI.php.

References $id, and $object_id.

605  : void
606  {
608  if (!$id) {
609  return;
610  }
611 
612  $this->objects_manager->deliverObjectInfo($id);
613  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ edit()

ilBookingObjectGUI::edit ( ?ilPropertyFormGUI  $a_form = null)

Render edit form.

Definition at line 315 of file class.ilBookingObjectGUI.php.

References $ctrl, $lng, $tabs, $tpl, ILIAS\Repository\access(), initForm(), ILIAS\UICore\GlobalTemplate\setContent(), setHelpId(), and ilLanguage\txt().

Referenced by update().

315  : void
316  {
317  if (!$this->access->canManageObjects($this->ref_id)) {
318  return;
319  }
320 
321  $tpl = $this->tpl;
322  $ilCtrl = $this->ctrl;
323  $ilTabs = $this->tabs;
324  $lng = $this->lng;
325 
326  $ilTabs->clearTargets();
327  $ilTabs->setBackTarget($lng->txt('book_back_to_list'), $ilCtrl->getLinkTarget($this, 'render'));
328 
329  $this->setHelpId('edit');
330 
331  if (!$a_form) {
332  $a_form = $this->initForm('edit', $this->object_id);
333  }
334  $tpl->setContent($a_form->getHTML());
335  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
initForm(string $a_mode="create", ?int $id=null)
Build property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPoolObjId()

ilBookingObjectGUI::getPoolObjId ( )
protected

Definition at line 137 of file class.ilBookingObjectGUI.php.

Referenced by applyFilter(), initForm(), render(), resetFilter(), and save().

137  : int
138  {
139  return $this->pool_gui->getObject()->getId();
140  }
+ Here is the caller graph for this function:

◆ getPoolOverallLimit()

ilBookingObjectGUI::getPoolOverallLimit ( )
protected

Get booking pool overall limit.

Definition at line 153 of file class.ilBookingObjectGUI.php.

References $ctrl, ILIAS\Repository\ctrl(), ilCtrl\getNextClass(), hasPoolSchedule(), initForm(), and null.

Referenced by applyFilter(), render(), and resetFilter().

153  : ?int
154  {
155  return $this->hasPoolSchedule()
156  ? null
157  : $this->pool_gui->getObject()->getOverallLimit();
158  }
hasPoolSchedule()
Has booking pool a schedule?
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPoolRefId()

ilBookingObjectGUI::getPoolRefId ( )
protected

Definition at line 132 of file class.ilBookingObjectGUI.php.

Referenced by applyFilter(), render(), and resetFilter().

132  : int
133  {
134  return $this->pool_gui->getRefId();
135  }
+ Here is the caller graph for this function:

◆ hasPoolSchedule()

ilBookingObjectGUI::hasPoolSchedule ( )
protected

Has booking pool a schedule?

Definition at line 145 of file class.ilBookingObjectGUI.php.

References ilObjBookingPool\TYPE_FIX_SCHEDULE.

Referenced by applyFilter(), getPoolOverallLimit(), initForm(), render(), resetFilter(), save(), and update().

145  : bool
146  {
147  return ($this->pool_gui->getObject()->getScheduleType() === ilObjBookingPool::TYPE_FIX_SCHEDULE);
148  }
+ Here is the caller graph for this function:

◆ initForm()

ilBookingObjectGUI::initForm ( string  $a_mode = "create",
?int  $id = null 
)

Build property form.

Definition at line 345 of file class.ilBookingObjectGUI.php.

References $ctrl, $id, $lng, $obj_data_cache, $post, getPoolObjId(), hasPoolSchedule(), ilAdvancedMDRecordGUI\MODE_EDITOR, ilFileInputGUI\setAllowDeletion(), ilTextAreaInputGUI\setCols(), ilFormPropertyGUI\setRequired(), and ilLanguage\txt().

Referenced by create(), edit(), getPoolOverallLimit(), save(), and update().

349  $lng = $this->lng;
350  $ilCtrl = $this->ctrl;
351  $ilObjDataCache = $this->obj_data_cache;
352 
353  $form_gui = new ilPropertyFormGUI();
354 
355  $title = new ilTextInputGUI($lng->txt("title"), "title");
356  $title->setRequired(true);
357  $title->setSize(40);
358  $title->setMaxLength(120);
359  $form_gui->addItem($title);
360 
361  $desc = new ilTextAreaInputGUI($lng->txt("description"), "desc");
362  $desc->setCols(70);
363  $desc->setRows(15);
364  $desc->setMaxNumOfChars(1000);
365  $form_gui->addItem($desc);
366 
367  $file = new ilFileInputGUI($lng->txt("book_additional_info_file"), "file");
368  $file->setAllowDeletion(true);
369  $form_gui->addItem($file);
370 
371  $nr = new ilNumberInputGUI($lng->txt("booking_nr_of_items"), "items");
372  $nr->setRequired(true);
373  $nr->setSize(3);
374  $nr->setMaxLength(3);
375  $nr->setSuffix($lng->txt("book_booking_objects"));
376  $form_gui->addItem($nr);
377 
378  if ($this->hasPoolSchedule()) {
379  $options = array();
380  foreach ($this->schedule_manager->getScheduleList() as $schedule_id => $schedule_title) {
381  $options[$schedule_id] = $schedule_title;
382  }
383  $schedule = new ilSelectInputGUI($lng->txt("book_schedule"), "schedule");
384  $schedule->setRequired(true);
385  $schedule->setOptions($options);
386  $form_gui->addItem($schedule);
387  }
388 
390  $post->setTitle($lng->txt("book_post_booking_information"));
391  $form_gui->addItem($post);
392 
393  $pdesc = new ilTextAreaInputGUI($lng->txt("book_post_booking_text"), "post_text");
394  $pdesc->setCols(70);
395  $pdesc->setRows(15);
396  $pdesc->setInfo($lng->txt("book_post_booking_text_info"));
397  $form_gui->addItem($pdesc);
398 
399  $pfile = new ilFileInputGUI($lng->txt("book_post_booking_file"), "post_file");
400  $pfile->setAllowDeletion(true);
401  $form_gui->addItem($pfile);
402 
403  // #18214 - should also work for new objects
404  $this->record_gui = new ilAdvancedMDRecordGUI(
406  "book",
407  $this->getPoolObjId(),
408  "bobj",
409  (int) $id
410  );
411  $this->record_gui->setPropertyForm($form_gui);
412  $this->record_gui->parse();
413 
414  if ($a_mode === "edit") {
415  $form_gui->setTitle($lng->txt("book_edit_object"));
416 
417  $item = new ilHiddenInputGUI('object_id');
418  $item->setValue($id);
419  $form_gui->addItem($item);
420 
421  $obj = new ilBookingObject($id);
422  $title->setValue($obj->getTitle());
423  $desc->setValue($obj->getDescription());
424  $nr->setValue($obj->getNrOfItems());
425  $pdesc->setValue($obj->getPostText());
426  $file->setValue($this->objects_manager->getObjectInfoFilename($id));
427  $pfile->setValue($this->objects_manager->getBookingInfoFilename($id));
428 
429  if (isset($schedule)) {
430  $schedule->setValue($obj->getScheduleId());
431  }
432 
433  $form_gui->addCommandButton("update", $lng->txt("save"));
434  } else {
435  $form_gui->setTitle($lng->txt("book_add_object"));
436  $form_gui->addCommandButton("save", $lng->txt("save"));
437  $form_gui->addCommandButton("render", $lng->txt("cancel"));
438  }
439  $form_gui->setFormAction($ilCtrl->getFormAction($this));
440 
441  return $form_gui;
442  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasPoolSchedule()
Has booking pool a schedule?
This class represents a selection list property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This class represents a file property in a property form.
This class represents a hidden form property in a property form.
This class represents a number property in a property form.
ilObjectDataCache $obj_data_cache
setRequired(bool $a_required)
setAllowDeletion(bool $a_val)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This class represents a text area property in a property form.
$post
Definition: ltitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isManagementActivated()

ilBookingObjectGUI::isManagementActivated ( )

Is management activated?

Definition at line 127 of file class.ilBookingObjectGUI.php.

References $management.

Referenced by applyFilter(), render(), and resetFilter().

127  : bool
128  {
129  return $this->management;
130  }
+ Here is the caller graph for this function:

◆ render()

ilBookingObjectGUI::render ( )

Render list of booking objects uses ilBookingObjectsTableGUI.

Definition at line 235 of file class.ilBookingObjectGUI.php.

References Vendor\Package\$bar, $ctrl, $lng, $tpl, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), getPoolObjId(), getPoolOverallLimit(), getPoolRefId(), hasPoolSchedule(), isManagementActivated(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), ILIAS\UICore\GlobalTemplate\setPermanentLink(), showNoScheduleMessage(), and ilLanguage\txt().

Referenced by applyFilter(), and resetFilter().

235  : void
236  {
237  $this->showNoScheduleMessage();
238 
239  $tpl = $this->tpl;
240  $ilCtrl = $this->ctrl;
241  $lng = $this->lng;
242 
243  $bar = "";
244 
245  if ($this->isManagementActivated() && $this->access->canManageObjects($this->getPoolRefId())) {
246  $bar = new ilToolbarGUI();
247  $bar->addButton($lng->txt('book_add_object'), $ilCtrl->getLinkTarget($this, 'create'));
248 
249  // bulk creation
250  $this->bulk_creation_gui->modifyToolbar($bar);
251 
252  if ($this->hasPoolSchedule()) {
253  $bar->addSeparator();
254  $list_link = $this->ctrl->getLinkTarget($this, "");
255  $week_link = $this->ctrl->getLinkTargetByClass("ilBookingProcessWithScheduleGUI", "week");
256  $mode_control = $this->gui->ui()->factory()->viewControl()->mode([
257  $this->lng->txt("book_list") => $list_link,
258  $this->lng->txt("book_week") => $week_link
259  ], $this->lng->txt("book_view"));
260  $bar->addComponent($mode_control);
261  }
262  $bar = $bar->getHTML();
263  }
264 
265  $tpl->setPermanentLink('book', $this->getPoolRefId());
266 
267  $table = new ilBookingObjectsTableGUI($this, 'render', $this->getPoolRefId(), $this->getPoolObjId(), $this->hasPoolSchedule(), $this->getPoolOverallLimit(), $this->isManagementActivated());
268  $tpl->setContent($bar . $table->getHTML());
269  }
hasPoolSchedule()
Has booking pool a schedule?
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getPoolOverallLimit()
Get booking pool overall limit.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
isManagementActivated()
Is management activated?
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setPermanentLink(string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
Generates and sets a permanent ilias link.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetFilter()

ilBookingObjectGUI::resetFilter ( )

Definition at line 279 of file class.ilBookingObjectGUI.php.

References getPoolObjId(), getPoolOverallLimit(), getPoolRefId(), hasPoolSchedule(), isManagementActivated(), and render().

279  : void
280  {
281  $table = new ilBookingObjectsTableGUI($this, 'render', $this->getPoolRefId(), $this->getPoolObjId(), $this->hasPoolSchedule(), $this->getPoolOverallLimit(), $this->isManagementActivated());
282  $table->resetOffset();
283  $table->resetFilter();
284  $this->render();
285  }
hasPoolSchedule()
Has booking pool a schedule?
getPoolOverallLimit()
Get booking pool overall limit.
isManagementActivated()
Is management activated?
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
render()
Render list of booking objects uses ilBookingObjectsTableGUI.
+ Here is the call graph for this function:

◆ returnToPreferences()

ilBookingObjectGUI::returnToPreferences ( )
protected

Definition at line 226 of file class.ilBookingObjectGUI.php.

References ILIAS\Repository\ctrl().

226  : void
227  {
228  $this->ctrl->redirectByClass("ilBookingPreferencesGUI");
229  }
+ Here is the call graph for this function:

◆ save()

ilBookingObjectGUI::save ( )

Definition at line 444 of file class.ilBookingObjectGUI.php.

References $ctrl, $lng, $valid, ILIAS\Repository\access(), create(), getPoolObjId(), hasPoolSchedule(), initForm(), null, and ilLanguage\txt().

444  : void
445  {
446  if (!$this->access->canManageObjects($this->ref_id)) {
447  return;
448  }
449 
450  $ilCtrl = $this->ctrl;
451  $lng = $this->lng;
452 
453  $form = $this->initForm();
454  if ($form->checkInput()) {
455  $valid = true;
456  if ($this->record_gui &&
457  !$this->record_gui->importEditFormPostValues()) {
458  $valid = false;
459  }
460  if ($valid) {
461  $obj = new ilBookingObject();
462  $obj->setPoolId($this->getPoolObjId());
463  $obj->setTitle($form->getInput("title"));
464  $obj->setDescription($form->getInput("desc"));
465  $obj->setNrOfItems($form->getInput("items"));
466  $obj->setPostText($form->getInput("post_text"));
467 
468  if ($this->hasPoolSchedule()) {
469  $obj->setScheduleId($form->getInput("schedule"));
470  }
471 
472  $obj->save();
473 
474  $file = $form->getItemByPostVar("file");
475  if ($_FILES["file"]["tmp_name"]) {
476  $this->objects_manager->importObjectInfoFromLegacyUpload($obj->getId(), $_FILES["file"]);
477  } elseif ($file !== null && $file->getDeletionFlag()) {
478  $this->objects_manager->deleteObjectInfo($obj->getId());
479  }
480 
481  $pfile = $form->getItemByPostVar("post_file");
482  if ($_FILES["post_file"]["tmp_name"]) {
483  $this->objects_manager->importBookingInfoFromLegacyUpload($obj->getId(), $_FILES["post_file"]);
484  } elseif ($pfile !== null && $pfile->getDeletionFlag()) {
485  $this->objects_manager->deleteBookingInfo($obj->getId());
486  }
487 
488  $obj->update();
489 
490  if ($this->record_gui) {
491  $this->record_gui->writeEditForm(null, $obj->getId());
492  }
493 
494  $this->tpl->setOnScreenMessage('success', $lng->txt("book_object_added"), true);
495  $ilCtrl->redirect($this, "render");
496  }
497  }
498 
499  $form->setValuesByPost();
500  $this->create($form);
501  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasPoolSchedule()
Has booking pool a schedule?
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$valid
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
create(?ilPropertyFormGUI $a_form=null)
Render creation form.
initForm(string $a_mode="create", ?int $id=null)
Build property form.
+ Here is the call graph for this function:

◆ setHelpId()

ilBookingObjectGUI::setHelpId ( string  $a_id)
protected

Definition at line 337 of file class.ilBookingObjectGUI.php.

References ILIAS\Repository\help().

Referenced by create(), and edit().

337  : void
338  {
339  $this->help->setHelpId($a_id);
340  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showNoScheduleMessage()

ilBookingObjectGUI::showNoScheduleMessage ( )
protected

Definition at line 221 of file class.ilBookingObjectGUI.php.

Referenced by render().

221  : void
222  {
223  $this->pool_gui->showNoScheduleMessage();
224  }
+ Here is the caller graph for this function:

◆ update()

ilBookingObjectGUI::update ( )

Definition at line 503 of file class.ilBookingObjectGUI.php.

References $ctrl, $lng, $valid, ILIAS\Repository\access(), edit(), hasPoolSchedule(), initForm(), null, and ilLanguage\txt().

503  : void
504  {
505  if (!$this->access->canManageObjects($this->ref_id)) {
506  return;
507  }
508 
509  $lng = $this->lng;
510  $ilCtrl = $this->ctrl;
511 
512  $form = $this->initForm('edit', $this->object_id);
513  if ($form->checkInput()) {
514  $valid = true;
515  if ($this->record_gui &&
516  !$this->record_gui->importEditFormPostValues()) {
517  $valid = false;
518  }
519 
520  if ($valid) {
521  $obj = new ilBookingObject($this->object_id);
522  $obj->setTitle($form->getInput("title"));
523  $obj->setDescription($form->getInput("desc"));
524  $obj->setNrOfItems($form->getInput("items"));
525  $obj->setPostText($form->getInput("post_text"));
526 
527  $file = $form->getItemByPostVar("file");
528  if ($_FILES["file"]["tmp_name"]) {
529  $this->objects_manager->importObjectInfoFromLegacyUpload($obj->getId(), $_FILES["file"]);
530  } elseif ($file !== null && $file->getDeletionFlag()) {
531  $this->objects_manager->deleteObjectInfo($obj->getId());
532  }
533 
534  $pfile = $form->getItemByPostVar("post_file");
535  if ($_FILES["post_file"]["tmp_name"]) {
536  $this->objects_manager->importBookingInfoFromLegacyUpload($obj->getId(), $_FILES["post_file"]);
537  } elseif ($pfile !== null && $pfile->getDeletionFlag()) {
538  $this->objects_manager->deleteBookingInfo($obj->getId());
539  }
540 
541  if ($this->hasPoolSchedule()) {
542  $obj->setScheduleId($form->getInput("schedule"));
543  }
544 
545  $obj->update();
546 
547  if ($this->record_gui) {
548  $this->record_gui->writeEditForm();
549  }
550 
551  $this->tpl->setOnScreenMessage('success', $lng->txt("book_object_updated"), true);
552  $ilCtrl->redirect($this, "edit");
553  }
554  }
555 
556  $form->setValuesByPost();
557  $this->edit($form);
558  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasPoolSchedule()
Has booking pool a schedule?
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$valid
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
edit(?ilPropertyFormGUI $a_form=null)
Render edit form.
initForm(string $a_mode="create", ?int $id=null)
Build property form.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ILIAS BookingManager Access AccessManager ilBookingObjectGUI::$access
protected

Definition at line 31 of file class.ilBookingObjectGUI.php.

◆ $book_request

ILIAS BookingManager StandardGUIRequest ilBookingObjectGUI::$book_request
protected

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

◆ $bulk_creation_gui

ilBookBulkCreationGUI ilBookingObjectGUI::$bulk_creation_gui
protected

Definition at line 28 of file class.ilBookingObjectGUI.php.

◆ $context_obj_id

int ilBookingObjectGUI::$context_obj_id
protected

Definition at line 46 of file class.ilBookingObjectGUI.php.

◆ $ctrl

ilCtrl ilBookingObjectGUI::$ctrl
protected

◆ $gui

ILIAS BookingManager InternalGUIService ilBookingObjectGUI::$gui
protected

Definition at line 30 of file class.ilBookingObjectGUI.php.

◆ $help

ilBookingHelpAdapter ilBookingObjectGUI::$help
protected

Definition at line 37 of file class.ilBookingObjectGUI.php.

◆ $lng

ilLanguage ilBookingObjectGUI::$lng
protected

◆ $management

bool ilBookingObjectGUI::$management = true
protected

Definition at line 44 of file class.ilBookingObjectGUI.php.

Referenced by isManagementActivated().

◆ $obj_data_cache

ilObjectDataCache ilBookingObjectGUI::$obj_data_cache
protected

Definition at line 38 of file class.ilBookingObjectGUI.php.

Referenced by initForm().

◆ $object_id

int ilBookingObjectGUI::$object_id
protected

Definition at line 47 of file class.ilBookingObjectGUI.php.

Referenced by deliverInfo().

◆ $objects_manager

ILIAS BookingManager Objects ObjectsManager ilBookingObjectGUI::$objects_manager
protected

Definition at line 26 of file class.ilBookingObjectGUI.php.

◆ $pool

ilObjBookingPool ilBookingObjectGUI::$pool
protected

Definition at line 29 of file class.ilBookingObjectGUI.php.

◆ $pool_gui

ilObjBookingPoolGUI ilBookingObjectGUI::$pool_gui
protected

Definition at line 50 of file class.ilBookingObjectGUI.php.

◆ $pool_has_schedule

bool ilBookingObjectGUI::$pool_has_schedule
protected

Definition at line 40 of file class.ilBookingObjectGUI.php.

◆ $pool_overall_limit

int ilBookingObjectGUI::$pool_overall_limit
protected

Definition at line 41 of file class.ilBookingObjectGUI.php.

◆ $pool_uses_preferences

bool ilBookingObjectGUI::$pool_uses_preferences = false
protected

Definition at line 42 of file class.ilBookingObjectGUI.php.

◆ $record_gui

ilAdvancedMDRecordGUI ilBookingObjectGUI::$record_gui
protected

Definition at line 52 of file class.ilBookingObjectGUI.php.

◆ $ref_id

int ilBookingObjectGUI::$ref_id
protected

Definition at line 53 of file class.ilBookingObjectGUI.php.

◆ $rsv_ids

array ilBookingObjectGUI::$rsv_ids = []
protected

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

◆ $schedule_manager

ILIAS BookingManager Schedule ScheduleManager ilBookingObjectGUI::$schedule_manager
protected

Definition at line 27 of file class.ilBookingObjectGUI.php.

◆ $seed

string ilBookingObjectGUI::$seed
protected

Definition at line 48 of file class.ilBookingObjectGUI.php.

◆ $sseed

string ilBookingObjectGUI::$sseed
protected

Definition at line 49 of file class.ilBookingObjectGUI.php.

◆ $tabs

ilTabsGUI ilBookingObjectGUI::$tabs
protected

Definition at line 36 of file class.ilBookingObjectGUI.php.

Referenced by confirmDelete(), create(), and edit().

◆ $tpl

ilGlobalTemplateInterface ilBookingObjectGUI::$tpl
protected

Definition at line 34 of file class.ilBookingObjectGUI.php.

Referenced by confirmDelete(), create(), edit(), and render().

◆ $user

ilObjUser ilBookingObjectGUI::$user
protected

Definition at line 39 of file class.ilBookingObjectGUI.php.


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