29 protected BookingManager\InternalDomainService
$domain;
57 $this->
ctrl = $DIC->ctrl();
58 $this->
lng = $DIC->language();
59 $this->main_tpl =
$DIC->ui()->mainTemplate();
61 $this->
tabs = $DIC->tabs();
62 $this->book_request =
$DIC->bookingManager()
71 $this->
lng->loadLanguageModule(
"book");
82 $this->seed = $this->book_request->getSeed();
83 $this->sseed = $this->book_request->getSSeed();
85 $this->
toolbar = $DIC->toolbar();
89 $req_return_to = $this->book_request->getReturnTo();
90 if (in_array($req_return_to, [
"ilbookingobjectservicegui",
"ilbookingreservationsgui"])) {
91 $this->return_to = $req_return_to;
95 $handler =
new BookingManager\getObjectSettingsCommandHandler(
99 $this->current_settings =
$handler->handle()->getSettings();
103 if (is_object($this->pool)) {
105 $DIC[
"ilHelp"]->setScreenIdComponent(
"book");
122 $pool_ref_id = $this->book_request->getPoolRefId();
124 $book_ref_ids = $this->use_book_repo->getUsedBookingPools(
ilObject::_lookupObjId($this->main_host_ref_id),
false);
126 $this->pools_selected = (count($book_ref_ids) > 0);
128 if (!in_array($pool_ref_id, $book_ref_ids)) {
129 if (count($book_ref_ids) > 0) {
130 $pool_ref_id = current($book_ref_ids);
135 $this->current_pool_ref_id = $pool_ref_id;
136 if ($this->current_pool_ref_id > 0) {
153 switch ($next_class) {
154 case "ilpropertyformgui":
160 case "ilbookingobjectservicegui":
165 $this->current_pool_ref_id,
166 $this->use_book_repo,
174 case "ilbookingreservationsgui":
182 $this->
ctrl->forwardCommand($res_gui);
187 if (in_array($cmd, array(
"show",
"settings",
"saveSettings",
"selectPool"))) {
206 $si->setValue($this->current_pool_ref_id);
207 $this->
toolbar->setFormAction($this->
ctrl->getFormAction($this));
208 $this->
toolbar->addInputItem($si,
false);
209 $this->
toolbar->addFormButton($this->
lng->txt(
"book_select_pool"),
"selectPool");
215 if ($this->return_to !==
"") {
216 $this->
ctrl->redirectByClass($this->return_to);
227 if ($this->pools_selected) {
230 $lng->txt(
"book_booking_objects"),
235 $lng->txt(
"book_log"),
239 if ($this->ref_id === $this->main_host_ref_id) {
242 $lng->txt(
"settings"),
250 protected function show(): void
253 if ($this->pools_selected) {
255 } elseif ($this->ref_id === $this->main_host_ref_id) {
259 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"book_no_pools_selected"));
268 $this->setSubTabs(
"settings");
269 $main_tpl = $this->main_tpl;
270 $form = $this->initSettingsForm();
271 $main_tpl->setContent($form->getHTML());
283 $repo->getExplorerGUI()->setSelectableTypes([
"book"]);
284 $repo->getExplorerGUI()->setTypeWhiteList(
285 [
"book",
"root",
"cat",
"grp",
"fold",
"crs"]
287 $form->addItem($repo);
288 $repo->setValue($this->current_settings->getUsedBookingObjectIds());
290 $form->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
292 $form->setTitle(
$lng->txt(
"book_pool_selection"));
302 $main_tpl = $this->main_tpl;
304 $form = $this->initSettingsForm();
305 if ($form->checkInput()) {
306 $b_ids = $form->getInput(
"booking_obj_ids");
307 $b_ids = is_array($b_ids)
308 ? array_map(
static function ($i) {
313 if (!$this->checkBookingPoolsForSchedules($b_ids)) {
314 $this->main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"book_all_pools_need_schedules"));
315 $form->setValuesByPost();
316 $main_tpl->setContent($form->getHTML());
325 $repo = $this->use_book_repo;
326 $handler =
new BookingManager\saveObjectSettingsCommandHandler($cmd, $repo);
329 $this->main_tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
332 $form->setValuesByPost();
333 $main_tpl->setContent($form->getHTML());
343 foreach ($ids as $pool_ref_id) {
345 if (!$schedule_manager->hasSchedules()) {
This class is used for integration of the booking manager as a service into other repository objects,...
BookingManager InternalDomainService $domain
ilBookingHelpAdapter $help
setSubTabs(string $active)
checkBookingPoolsForSchedules(array $ids)
Check if all pools have schedules.
ilObjBookingServiceSettings $current_settings
ilObjUseBookDBRepository $use_book_repo
showPoolSelector(string $return_to)
ilGlobalTemplateInterface $main_tpl
BookingManager StandardGUIRequest $book_request
__construct(ilObjectGUI $parent_gui, int $main_host_ref_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
getNextClass($a_gui_class=null)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
saveParameter(object $a_gui_obj, $a_parameter)
@inheritDoc
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
forwardCommand(object $a_gui_object)
@inheritDoc
getCmd(?string $fallback_command=null)
@inheritDoc
setReturn(object $a_gui_obj, ?string $a_cmd=null)
@inheritDoc
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjectId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
activateSubTab(string $a_id)
addSubTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...