ILIAS  trunk Revision v11.0_alpha-1846-g895b5f47236
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 114 of file class.ilBookingObjectGUI.php.

Referenced by ilBookingObjectServiceGUI\__construct().

114  : void
115  {
116  $this->management = $a_val;
117  }
+ Here is the caller graph for this function:

◆ applyFilter()

ilBookingObjectGUI::applyFilter ( )

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

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

266  : void
267  {
268  $table = new ilBookingObjectsTableGUI($this, 'render', $this->getPoolRefId(), $this->getPoolObjId(), $this->hasPoolSchedule(), $this->getPoolOverallLimit(), $this->isManagementActivated());
269  $table->resetOffset();
270  $table->writeFilterToSession();
271  $this->render();
272  }
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 555 of file class.ilBookingObjectGUI.php.

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

555  : void
556  {
557  if (!$this->access->canManageObjects($this->ref_id)) {
558  return;
559  }
560 
561  $ilCtrl = $this->ctrl;
562  $lng = $this->lng;
563  $tpl = $this->tpl;
564  $ilTabs = $this->tabs;
565 
566  $ilTabs->clearTargets();
567  $ilTabs->setBackTarget($lng->txt('book_back_to_list'), $ilCtrl->getLinkTarget($this, 'render'));
568 
569  $conf = new ilConfirmationGUI();
570  $conf->setFormAction($ilCtrl->getFormAction($this));
571  $conf->setHeaderText($lng->txt('book_confirm_delete'));
572 
573  $type = new ilBookingObject($this->object_id);
574  $conf->addItem('object_id', $this->object_id, $type->getTitle());
575  $conf->setConfirm($lng->txt('delete'), 'delete');
576  $conf->setCancel($lng->txt('cancel'), 'render');
577 
578  $tpl->setContent($conf->getHTML());
579  }
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 285 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().

285  : void
286  {
287  if (!$this->access->canManageObjects($this->ref_id)) {
288  return;
289  }
290 
291  $ilCtrl = $this->ctrl;
292  $tpl = $this->tpl;
293  $lng = $this->lng;
294  $ilTabs = $this->tabs;
295 
296  $ilTabs->clearTargets();
297  $ilTabs->setBackTarget($lng->txt('book_back_to_list'), $ilCtrl->getLinkTarget($this, 'render'));
298 
299  $this->setHelpId('create');
300 
301  if (!$a_form) {
302  $a_form = $this->initForm();
303  }
304  $tpl->setContent($a_form->getHTML());
305  }
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 581 of file class.ilBookingObjectGUI.php.

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

581  : void
582  {
583  if (!$this->access->canManageObjects($this->ref_id)) {
584  return;
585  }
586 
587  $ilCtrl = $this->ctrl;
588  $lng = $this->lng;
589 
590  $obj = new ilBookingObject($this->object_id);
591  $obj->deleteReservationsAndCalEntries($this->object_id);
592  $obj->delete();
593 
594  $this->tpl->setOnScreenMessage('success', $lng->txt('book_object_deleted'), true);
595  $ilCtrl->setParameter($this, 'object_id', "");
596  $ilCtrl->redirect($this, 'render');
597  }
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 600 of file class.ilBookingObjectGUI.php.

References $id, and $object_id.

600  : void
601  {
603  if (!$id) {
604  return;
605  }
606 
607  $this->objects_manager->deliverObjectInfo($id);
608  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ edit()

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

Render edit form.

Definition at line 310 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().

310  : void
311  {
312  if (!$this->access->canManageObjects($this->ref_id)) {
313  return;
314  }
315 
316  $tpl = $this->tpl;
317  $ilCtrl = $this->ctrl;
318  $ilTabs = $this->tabs;
319  $lng = $this->lng;
320 
321  $ilTabs->clearTargets();
322  $ilTabs->setBackTarget($lng->txt('book_back_to_list'), $ilCtrl->getLinkTarget($this, 'render'));
323 
324  $this->setHelpId('edit');
325 
326  if (!$a_form) {
327  $a_form = $this->initForm('edit', $this->object_id);
328  }
329  $tpl->setContent($a_form->getHTML());
330  }
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 132 of file class.ilBookingObjectGUI.php.

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

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

◆ getPoolOverallLimit()

ilBookingObjectGUI::getPoolOverallLimit ( )
protected

Get booking pool overall limit.

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

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

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

148  : ?int
149  {
150  return $this->hasPoolSchedule()
151  ? null
152  : $this->pool_gui->getObject()->getOverallLimit();
153  }
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 127 of file class.ilBookingObjectGUI.php.

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

127  : int
128  {
129  return $this->pool_gui->getRefId();
130  }
+ Here is the caller graph for this function:

◆ hasPoolSchedule()

ilBookingObjectGUI::hasPoolSchedule ( )
protected

Has booking pool a schedule?

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

References ilObjBookingPool\TYPE_FIX_SCHEDULE.

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

140  : bool
141  {
142  return ($this->pool_gui->getObject()->getScheduleType() === ilObjBookingPool::TYPE_FIX_SCHEDULE);
143  }
+ Here is the caller graph for this function:

◆ initForm()

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

Build property form.

Definition at line 340 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().

344  $lng = $this->lng;
345  $ilCtrl = $this->ctrl;
346  $ilObjDataCache = $this->obj_data_cache;
347 
348  $form_gui = new ilPropertyFormGUI();
349 
350  $title = new ilTextInputGUI($lng->txt("title"), "title");
351  $title->setRequired(true);
352  $title->setSize(40);
353  $title->setMaxLength(120);
354  $form_gui->addItem($title);
355 
356  $desc = new ilTextAreaInputGUI($lng->txt("description"), "desc");
357  $desc->setCols(70);
358  $desc->setRows(15);
359  $desc->setMaxNumOfChars(1000);
360  $form_gui->addItem($desc);
361 
362  $file = new ilFileInputGUI($lng->txt("book_additional_info_file"), "file");
363  $file->setAllowDeletion(true);
364  $form_gui->addItem($file);
365 
366  $nr = new ilNumberInputGUI($lng->txt("booking_nr_of_items"), "items");
367  $nr->setRequired(true);
368  $nr->setSize(3);
369  $nr->setMaxLength(3);
370  $nr->setSuffix($lng->txt("book_booking_objects"));
371  $form_gui->addItem($nr);
372 
373  if ($this->hasPoolSchedule()) {
374  $options = array();
375  foreach ($this->schedule_manager->getScheduleList() as $schedule_id => $schedule_title) {
376  $options[$schedule_id] = $schedule_title;
377  }
378  $schedule = new ilSelectInputGUI($lng->txt("book_schedule"), "schedule");
379  $schedule->setRequired(true);
380  $schedule->setOptions($options);
381  $form_gui->addItem($schedule);
382  }
383 
385  $post->setTitle($lng->txt("book_post_booking_information"));
386  $form_gui->addItem($post);
387 
388  $pdesc = new ilTextAreaInputGUI($lng->txt("book_post_booking_text"), "post_text");
389  $pdesc->setCols(70);
390  $pdesc->setRows(15);
391  $pdesc->setInfo($lng->txt("book_post_booking_text_info"));
392  $form_gui->addItem($pdesc);
393 
394  $pfile = new ilFileInputGUI($lng->txt("book_post_booking_file"), "post_file");
395  $pfile->setAllowDeletion(true);
396  $form_gui->addItem($pfile);
397 
398  // #18214 - should also work for new objects
399  $this->record_gui = new ilAdvancedMDRecordGUI(
401  "book",
402  $this->getPoolObjId(),
403  "bobj",
404  (int) $id
405  );
406  $this->record_gui->setPropertyForm($form_gui);
407  $this->record_gui->parse();
408 
409  if ($a_mode === "edit") {
410  $form_gui->setTitle($lng->txt("book_edit_object"));
411 
412  $item = new ilHiddenInputGUI('object_id');
413  $item->setValue($id);
414  $form_gui->addItem($item);
415 
416  $obj = new ilBookingObject($id);
417  $title->setValue($obj->getTitle());
418  $desc->setValue($obj->getDescription());
419  $nr->setValue($obj->getNrOfItems());
420  $pdesc->setValue($obj->getPostText());
421  $file->setValue($this->objects_manager->getObjectInfoFilename($id));
422  $pfile->setValue($this->objects_manager->getBookingInfoFilename($id));
423 
424  if (isset($schedule)) {
425  $schedule->setValue($obj->getScheduleId());
426  }
427 
428  $form_gui->addCommandButton("update", $lng->txt("save"));
429  } else {
430  $form_gui->setTitle($lng->txt("book_add_object"));
431  $form_gui->addCommandButton("save", $lng->txt("save"));
432  $form_gui->addCommandButton("render", $lng->txt("cancel"));
433  }
434  $form_gui->setFormAction($ilCtrl->getFormAction($this));
435 
436  return $form_gui;
437  }
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 122 of file class.ilBookingObjectGUI.php.

References $management.

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

122  : bool
123  {
124  return $this->management;
125  }
+ Here is the caller graph for this function:

◆ render()

ilBookingObjectGUI::render ( )

Render list of booking objects uses ilBookingObjectsTableGUI.

Definition at line 230 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().

230  : void
231  {
232  $this->showNoScheduleMessage();
233 
234  $tpl = $this->tpl;
235  $ilCtrl = $this->ctrl;
236  $lng = $this->lng;
237 
238  $bar = "";
239 
240  if ($this->isManagementActivated() && $this->access->canManageObjects($this->getPoolRefId())) {
241  $bar = new ilToolbarGUI();
242  $bar->addButton($lng->txt('book_add_object'), $ilCtrl->getLinkTarget($this, 'create'));
243 
244  // bulk creation
245  $this->bulk_creation_gui->modifyToolbar($bar);
246 
247  if ($this->hasPoolSchedule()) {
248  $bar->addSeparator();
249  $list_link = $this->ctrl->getLinkTarget($this, "");
250  $week_link = $this->ctrl->getLinkTargetByClass("ilBookingProcessWithScheduleGUI", "week");
251  $mode_control = $this->gui->ui()->factory()->viewControl()->mode([
252  $this->lng->txt("book_list") => $list_link,
253  $this->lng->txt("book_week") => $week_link
254  ], $this->lng->txt("book_view"));
255  $bar->addComponent($mode_control);
256  }
257  $bar = $bar->getHTML();
258  }
259 
260  $tpl->setPermanentLink('book', $this->getPoolRefId());
261 
262  $table = new ilBookingObjectsTableGUI($this, 'render', $this->getPoolRefId(), $this->getPoolObjId(), $this->hasPoolSchedule(), $this->getPoolOverallLimit(), $this->isManagementActivated());
263  $tpl->setContent($bar . $table->getHTML());
264  }
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 274 of file class.ilBookingObjectGUI.php.

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

274  : void
275  {
276  $table = new ilBookingObjectsTableGUI($this, 'render', $this->getPoolRefId(), $this->getPoolObjId(), $this->hasPoolSchedule(), $this->getPoolOverallLimit(), $this->isManagementActivated());
277  $table->resetOffset();
278  $table->resetFilter();
279  $this->render();
280  }
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 221 of file class.ilBookingObjectGUI.php.

References ILIAS\Repository\ctrl().

221  : void
222  {
223  $this->ctrl->redirectByClass("ilBookingPreferencesGUI");
224  }
+ Here is the call graph for this function:

◆ save()

ilBookingObjectGUI::save ( )

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

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

439  : void
440  {
441  if (!$this->access->canManageObjects($this->ref_id)) {
442  return;
443  }
444 
445  $ilCtrl = $this->ctrl;
446  $lng = $this->lng;
447 
448  $form = $this->initForm();
449  if ($form->checkInput()) {
450  $valid = true;
451  if ($this->record_gui &&
452  !$this->record_gui->importEditFormPostValues()) {
453  $valid = false;
454  }
455  if ($valid) {
456  $obj = new ilBookingObject();
457  $obj->setPoolId($this->getPoolObjId());
458  $obj->setTitle($form->getInput("title"));
459  $obj->setDescription($form->getInput("desc"));
460  $obj->setNrOfItems($form->getInput("items"));
461  $obj->setPostText($form->getInput("post_text"));
462 
463  if ($this->hasPoolSchedule()) {
464  $obj->setScheduleId($form->getInput("schedule"));
465  }
466 
467  $obj->save();
468 
469  $file = $form->getItemByPostVar("file");
470  if ($_FILES["file"]["tmp_name"]) {
471  $this->objects_manager->importObjectInfoFromLegacyUpload($obj->getId(), $_FILES["file"]);
472  } elseif ($file !== null && $file->getDeletionFlag()) {
473  $this->objects_manager->deleteObjectInfo($obj->getId());
474  }
475 
476  $pfile = $form->getItemByPostVar("post_file");
477  if ($_FILES["post_file"]["tmp_name"]) {
478  $this->objects_manager->importBookingInfoFromLegacyUpload($obj->getId(), $_FILES["post_file"]);
479  } elseif ($pfile !== null && $pfile->getDeletionFlag()) {
480  $this->objects_manager->deleteBookingInfo($obj->getId());
481  }
482 
483  $obj->update();
484 
485  if ($this->record_gui) {
486  $this->record_gui->writeEditForm(null, $obj->getId());
487  }
488 
489  $this->tpl->setOnScreenMessage('success', $lng->txt("book_object_added"), true);
490  $ilCtrl->redirect($this, "render");
491  }
492  }
493 
494  $form->setValuesByPost();
495  $this->create($form);
496  }
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 332 of file class.ilBookingObjectGUI.php.

References ILIAS\Repository\help().

Referenced by create(), and edit().

332  : void
333  {
334  $this->help->setHelpId($a_id);
335  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showNoScheduleMessage()

ilBookingObjectGUI::showNoScheduleMessage ( )
protected

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

Referenced by render().

216  : void
217  {
218  $this->pool_gui->showNoScheduleMessage();
219  }
+ Here is the caller graph for this function:

◆ update()

ilBookingObjectGUI::update ( )

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

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

498  : void
499  {
500  if (!$this->access->canManageObjects($this->ref_id)) {
501  return;
502  }
503 
504  $lng = $this->lng;
505  $ilCtrl = $this->ctrl;
506 
507  $form = $this->initForm('edit', $this->object_id);
508  if ($form->checkInput()) {
509  $valid = true;
510  if ($this->record_gui &&
511  !$this->record_gui->importEditFormPostValues()) {
512  $valid = false;
513  }
514 
515  if ($valid) {
516  $obj = new ilBookingObject($this->object_id);
517  $obj->setTitle($form->getInput("title"));
518  $obj->setDescription($form->getInput("desc"));
519  $obj->setNrOfItems($form->getInput("items"));
520  $obj->setPostText($form->getInput("post_text"));
521 
522  $file = $form->getItemByPostVar("file");
523  if ($_FILES["file"]["tmp_name"]) {
524  $this->objects_manager->importObjectInfoFromLegacyUpload($obj->getId(), $_FILES["file"]);
525  } elseif ($file !== null && $file->getDeletionFlag()) {
526  $this->objects_manager->deleteObjectInfo($obj->getId());
527  }
528 
529  $pfile = $form->getItemByPostVar("post_file");
530  if ($_FILES["post_file"]["tmp_name"]) {
531  $this->objects_manager->importBookingInfoFromLegacyUpload($obj->getId(), $_FILES["post_file"]);
532  } elseif ($pfile !== null && $pfile->getDeletionFlag()) {
533  $this->objects_manager->deleteBookingInfo($obj->getId());
534  }
535 
536  if ($this->hasPoolSchedule()) {
537  $obj->setScheduleId($form->getInput("schedule"));
538  }
539 
540  $obj->update();
541 
542  if ($this->record_gui) {
543  $this->record_gui->writeEditForm();
544  }
545 
546  $this->tpl->setOnScreenMessage('success', $lng->txt("book_object_updated"), true);
547  $ilCtrl->redirect($this, "edit");
548  }
549  }
550 
551  $form->setValuesByPost();
552  $this->edit($form);
553  }
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: