This class is used for integration of the booking manager as a service into other repository objects, e.g.
More...
This class is used for integration of the booking manager as a service into other repository objects, e.g.
courses. ilBookingGatewayGUI: ilPropertyFormGUI, ilBookingObjectServiceGUI, ilBookingReservationsGUI
- Author
- Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Definition at line 27 of file class.ilBookingGatewayGUI.php.
◆ __construct()
ilBookingGatewayGUI::__construct |
( |
ilObjectGUI |
$parent_gui, |
|
|
int |
$main_host_ref_id = 0 |
|
) |
| |
Definition at line 51 of file class.ilBookingGatewayGUI.php.
References $DIC, $handler, $parent_gui, ILIAS\Repository\ctrl(), ilObjectGUI\getObject(), ILIAS\Repository\help(), initPool(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().
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");
74 $this->obj_id = $parent_gui->
getObject()->getId();
75 $this->ref_id = $parent_gui->
getObject()->getRefId();
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");
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...
◆ checkBookingPoolsForSchedules()
ilBookingGatewayGUI::checkBookingPoolsForSchedules |
( |
array |
$ids | ) |
|
|
protected |
◆ executeCommand()
ilBookingGatewayGUI::executeCommand |
( |
| ) |
|
- Exceptions
-
Definition at line 146 of file class.ilBookingGatewayGUI.php.
References $ctrl, ILIAS\Repository\ctrl(), ilCtrl\forwardCommand(), ilCtrl\getCmd(), ilCtrl\getNextClass(), ILIAS\Repository\help(), initSettingsForm(), ilCtrl\setReturn(), setSubTabs(), and showPoolSelector().
153 switch ($next_class) {
154 case "ilpropertyformgui":
160 case "ilbookingobjectservicegui":
165 $this->current_pool_ref_id,
166 $this->use_book_repo,
174 case "ilbookingreservationsgui":
178 $this->
ctrl->forwardCommand($res_gui);
183 if (in_array($cmd, array(
"show",
"settings",
"saveSettings",
"selectPool"))) {
getCmd(?string $fallback_command=null)
showPoolSelector(string $return_to)
forwardCommand(object $a_gui_object)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getNextClass($a_gui_class=null)
setReturn(object $a_gui_obj, ?string $a_cmd=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setSubTabs(string $active)
◆ initPool()
ilBookingGatewayGUI::initPool |
( |
| ) |
|
|
protected |
Init pool.
Determine the current pool in $this->current_pool_ref_id. Host objects (e.g. courses) may use multiple booking pools. This method determines the current selected pool (stored in request parameter "pool_ref_id") within the host object user interface. If no pool has been selected yet, the first one attached to the host object is choosen. If no pools are attached to the host object at all we get a 0 ID.
Definition at line 117 of file class.ilBookingGatewayGUI.php.
References $ctrl, ilObject\_lookupObjId(), ilCtrl\saveParameter(), and ilCtrl\setParameter().
Referenced by __construct().
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) {
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
saveParameter(object $a_gui_obj, $a_parameter)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
◆ initSettingsForm()
ilBookingGatewayGUI::initSettingsForm |
( |
| ) |
|
Definition at line 270 of file class.ilBookingGatewayGUI.php.
References $ctrl, $lng, ilCtrl\getFormAction(), ILIAS\Repository\lng(), and ilLanguage\txt().
Referenced by executeCommand(), saveSettings(), and settings().
279 $repo->getExplorerGUI()->setSelectableTypes([
"book"]);
280 $repo->getExplorerGUI()->setTypeWhiteList(
281 [
"book",
"root",
"cat",
"grp",
"fold",
"crs"]
283 $form->addItem($repo);
284 $repo->setValue($this->current_settings->getUsedBookingObjectIds());
286 $form->addCommandButton(
"saveSettings",
$lng->
txt(
"save"));
288 $form->setTitle(
$lng->
txt(
"book_pool_selection"));
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
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...
◆ saveSettings()
ilBookingGatewayGUI::saveSettings |
( |
| ) |
|
Definition at line 294 of file class.ilBookingGatewayGUI.php.
References $ctrl, $handler, $lng, $main_tpl, $use_book_repo, checkBookingPoolsForSchedules(), initSettingsForm(), ilCtrl\redirect(), and ilLanguage\txt().
301 if ($form->checkInput()) {
302 $b_ids = $form->getInput(
"booking_obj_ids");
303 $b_ids = is_array($b_ids)
310 $this->main_tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"book_all_pools_need_schedules"));
311 $form->setValuesByPost();
322 $handler =
new BookingManager\saveObjectSettingsCommandHandler($cmd, $repo);
325 $this->main_tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
328 $form->setValuesByPost();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjUseBookDBRepository $use_book_repo
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...
setContent(string $a_html)
Sets content for standard template.
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
checkBookingPoolsForSchedules(array $ids)
Check if all pools have schedules.
ilGlobalTemplateInterface $main_tpl
◆ selectPool()
ilBookingGatewayGUI::selectPool |
( |
| ) |
|
|
protected |
◆ setSubTabs()
ilBookingGatewayGUI::setSubTabs |
( |
string |
$active | ) |
|
|
protected |
Definition at line 216 of file class.ilBookingGatewayGUI.php.
References $ctrl, $lng, $tabs, ilTabsGUI\activateSubTab(), ilTabsGUI\addSubTab(), ilCtrl\getLinkTarget(), ilCtrl\getLinkTargetByClass(), and ilLanguage\txt().
Referenced by executeCommand(), and settings().
223 if ($this->pools_selected) {
226 $lng->
txt(
"book_booking_objects"),
235 if ($this->ref_id === $this->main_host_ref_id) {
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...
activateSubTab(string $a_id)
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
addSubTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
◆ settings()
ilBookingGatewayGUI::settings |
( |
| ) |
|
|
protected |
◆ show()
ilBookingGatewayGUI::show |
( |
| ) |
|
|
protected |
Definition at line 246 of file class.ilBookingGatewayGUI.php.
References $ctrl, ILIAS\Repository\lng(), ilCtrl\redirect(), and ilCtrl\redirectByClass().
249 if ($this->pools_selected) {
251 } elseif ($this->ref_id === $this->main_host_ref_id) {
255 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"book_no_pools_selected"));
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
◆ showPoolSelector()
ilBookingGatewayGUI::showPoolSelector |
( |
string |
$return_to | ) |
|
|
protected |
◆ $book_request
◆ $ctrl
ilCtrl ilBookingGatewayGUI::$ctrl |
|
protected |
◆ $current_pool_ref_id
int ilBookingGatewayGUI::$current_pool_ref_id |
|
protected |
◆ $current_settings
◆ $domain
◆ $help
◆ $lng
◆ $main_host_ref_id
int ilBookingGatewayGUI::$main_host_ref_id = 0 |
|
protected |
◆ $main_tpl
◆ $obj_id
int ilBookingGatewayGUI::$obj_id |
|
protected |
◆ $parent_gui
◆ $pool
◆ $pools_selected
bool ilBookingGatewayGUI::$pools_selected = false |
|
protected |
◆ $ref_id
int ilBookingGatewayGUI::$ref_id |
|
protected |
◆ $return_to
string ilBookingGatewayGUI::$return_to = "" |
|
protected |
◆ $seed
string ilBookingGatewayGUI::$seed |
|
protected |
◆ $sseed
string ilBookingGatewayGUI::$sseed |
|
protected |
◆ $tabs
◆ $toolbar
◆ $use_book_repo
The documentation for this class was generated from the following file: