ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 Schedule ScheduleManager $schedule_manager
 
ilBookBulkCreationGUI $bulk_creation_gui
 
ilObjBookingPool $pool
 
ILIAS BookingManager InternalGUIService $gui
 
ILIAS BookingManager StandardGUIRequest $book_request
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilAccessHandler $access
 
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 116 of file class.ilBookingObjectGUI.php.

Referenced by ilBookingObjectServiceGUI\__construct().

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

◆ applyFilter()

ilBookingObjectGUI::applyFilter ( )

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

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

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

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

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

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

Referenced by save().

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

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

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

References $id, $object_id, and ilFileDelivery\deliverFileLegacy().

603  : void
604  {
606  if (!$id) {
607  return;
608  }
609 
610  $obj = new ilBookingObject($id);
611  $file = $obj->getFileFullPath();
612  if ($file) {
613  ilFileDelivery::deliverFileLegacy($file, $obj->getFile());
614  }
615  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ edit()

ilBookingObjectGUI::edit ( ilPropertyFormGUI  $a_form = null)

Render edit form.

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

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

Referenced by update().

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

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

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

◆ getPoolOverallLimit()

ilBookingObjectGUI::getPoolOverallLimit ( )
protected

Get booking pool overall limit.

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

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

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

150  : ?int
151  {
152  return $this->hasPoolSchedule()
153  ? null
154  : $this->pool_gui->getObject()->getOverallLimit();
155  }
hasPoolSchedule()
Has booking pool a schedule?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPoolRefId()

ilBookingObjectGUI::getPoolRefId ( )
protected

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

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

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

◆ hasPoolSchedule()

ilBookingObjectGUI::hasPoolSchedule ( )
protected

Has booking pool a schedule?

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

References ilObjBookingPool\TYPE_FIX_SCHEDULE.

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

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

◆ initForm()

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

Build property form.

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

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

References $management.

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

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

◆ render()

ilBookingObjectGUI::render ( )

Render list of booking objects uses ilBookingObjectsTableGUI.

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

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

Referenced by applyFilter(), and resetFilter().

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

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

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

References ILIAS\Repository\ctrl().

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

◆ save()

ilBookingObjectGUI::save ( )

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

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

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

References ILIAS\Repository\help().

Referenced by create(), and edit().

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

◆ showNoScheduleMessage()

ilBookingObjectGUI::showNoScheduleMessage ( )
protected

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

Referenced by render().

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

◆ update()

ilBookingObjectGUI::update ( )

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

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

501  : void
502  {
503  if (!$this->access->checkAccess('write', '', $this->ref_id)) {
504  return;
505  }
506 
507  $lng = $this->lng;
508  $ilCtrl = $this->ctrl;
509 
510  $form = $this->initForm('edit', $this->object_id);
511  if ($form->checkInput()) {
512  $valid = true;
513  if ($this->record_gui &&
514  !$this->record_gui->importEditFormPostValues()) {
515  $valid = false;
516  }
517 
518  if ($valid) {
519  $obj = new ilBookingObject($this->object_id);
520  $obj->setTitle($form->getInput("title"));
521  $obj->setDescription($form->getInput("desc"));
522  $obj->setNrOfItems($form->getInput("items"));
523  $obj->setPostText($form->getInput("post_text"));
524 
525  $file = $form->getItemByPostVar("file");
526  if ($_FILES["file"]["tmp_name"]) {
527  $obj->uploadFile($_FILES["file"]);
528  } elseif ($file !== null && $file->getDeletionFlag()) {
529  $obj->deleteFile();
530  }
531 
532  $pfile = $form->getItemByPostVar("post_file");
533  if ($_FILES["post_file"]["tmp_name"]) {
534  $obj->uploadPostFile($_FILES["post_file"]);
535  } elseif ($pfile !== null && $pfile->getDeletionFlag()) {
536  $obj->deletePostFile();
537  }
538 
539  if ($this->hasPoolSchedule()) {
540  $obj->setScheduleId($form->getInput("schedule"));
541  }
542 
543  $obj->update();
544 
545  if ($this->record_gui) {
546  $this->record_gui->writeEditForm();
547  }
548 
549  $this->tpl->setOnScreenMessage('success', $lng->txt("book_object_updated"), true);
550  $ilCtrl->redirect($this, "render");
551  }
552  }
553 
554  $form->setValuesByPost();
555  $this->edit($form);
556  }
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...
edit(ilPropertyFormGUI $a_form=null)
Render edit form.
$valid
initForm(string $a_mode="create", int $id=null)
Build property form.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilBookingObjectGUI::$access
protected

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

Referenced by render().

◆ $book_request

ILIAS BookingManager StandardGUIRequest ilBookingObjectGUI::$book_request
protected

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

◆ $bulk_creation_gui

ilBookBulkCreationGUI ilBookingObjectGUI::$bulk_creation_gui
protected

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

◆ $context_obj_id

int ilBookingObjectGUI::$context_obj_id
protected

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

◆ $ctrl

ilCtrl ilBookingObjectGUI::$ctrl
protected

◆ $gui

ILIAS BookingManager InternalGUIService ilBookingObjectGUI::$gui
protected

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

◆ $help

ilBookingHelpAdapter ilBookingObjectGUI::$help
protected

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

◆ $lng

ilLanguage ilBookingObjectGUI::$lng
protected

◆ $management

bool ilBookingObjectGUI::$management = true
protected

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

Referenced by isManagementActivated().

◆ $obj_data_cache

ilObjectDataCache ilBookingObjectGUI::$obj_data_cache
protected

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

Referenced by initForm().

◆ $object_id

int ilBookingObjectGUI::$object_id
protected

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

Referenced by deliverInfo().

◆ $pool

ilObjBookingPool ilBookingObjectGUI::$pool
protected

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

◆ $pool_gui

ilObjBookingPoolGUI ilBookingObjectGUI::$pool_gui
protected

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

◆ $pool_has_schedule

bool ilBookingObjectGUI::$pool_has_schedule
protected

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

◆ $pool_overall_limit

int ilBookingObjectGUI::$pool_overall_limit
protected

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

◆ $pool_uses_preferences

bool ilBookingObjectGUI::$pool_uses_preferences = false
protected

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

◆ $record_gui

ilAdvancedMDRecordGUI ilBookingObjectGUI::$record_gui
protected

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

◆ $ref_id

int ilBookingObjectGUI::$ref_id
protected

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

◆ $rsv_ids

array ilBookingObjectGUI::$rsv_ids = []
protected

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

◆ $schedule_manager

ILIAS BookingManager Schedule ScheduleManager ilBookingObjectGUI::$schedule_manager
protected

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

◆ $seed

string ilBookingObjectGUI::$seed
protected

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

◆ $sseed

string ilBookingObjectGUI::$sseed
protected

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

◆ $tabs

ilTabsGUI ilBookingObjectGUI::$tabs
protected

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

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

◆ $tpl

ilGlobalTemplateInterface ilBookingObjectGUI::$tpl
protected

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

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

◆ $user

ilObjUser ilBookingObjectGUI::$user
protected

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


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