55 bool $a_call_by_reference,
56 bool $a_prepare_output =
true
59 $this->service =
$DIC->bookingManager()->internal();
61 $this->domain =
$domain = $this->service->domain();
62 $this->gui =
$gui = $this->service->gui();
64 $this->tpl =
$gui->mainTemplate();
65 $this->
tabs = $gui->tabs();
66 $this->nav_history =
$gui->navigationHistory();
67 $this->
ctrl = $gui->ctrl();
68 $this->
lng = $domain->lng();
74 $this->
lng->loadLanguageModule(
"book");
77 if (is_object($this->
object)) {
81 $DIC[
"ilHelp"]->setScreenIdComponent(
"book");
84 $this->book_obj_id = $this->book_request->getObjectId();
85 $this->seed = $this->book_request->getSeed();
86 $this->sseed = $this->book_request->getSSeed();
87 $this->reservation_id = $this->book_request->getReservationId();
88 $this->profile_user_id = $this->book_request->getUserId();
90 $this->user_id_assigner = $this->
user->getId();
91 if ($this->book_request->getBookedUser() > 0) {
92 $this->user_id_to_book = $this->book_request->getBookedUser();
97 if ($this->book_request->getObjectId() > 0 &&
99 throw new ilException(
"Booking Object ID does not match Booking Pool.");
101 $this->cron_manager =
$DIC->cron()->manager();
116 $next_class = $this->
ctrl->getNextClass($this);
117 $cmd = $this->
ctrl->getCmd();
119 if (!$next_class && $cmd ===
'render') {
122 !$this->checkPermissionBool(
'write')) {
123 $this->
ctrl->redirectByClass(ilBookingPreferencesGUI::class);
125 $this->
ctrl->redirectByClass(ilBookingObjectGUI::class);
127 $next_class = $this->
ctrl->getNextClass($this);
129 $this->
ctrl->redirect($this,
"infoscreen");
133 $ilNavigationHistory->addItem(
135 "./goto.php?target=book_" . $this->ref_id,
141 switch ($next_class) {
142 case 'ilpermissiongui':
144 $this->tabs_gui->setTabActive(
'perm_settings');
146 $this->
ctrl->forwardCommand($perm_gui);
149 case 'ilbookingobjectgui':
151 $this->
ctrl->redirect($this,
"infoScreen");
154 $this->tabs_gui->setTabActive(
'render');
161 $this->
ctrl->forwardCommand($object_gui);
164 case 'ilbookingschedulegui':
166 $this->tabs_gui->setTabActive(
'schedules');
168 $this->
ctrl->forwardCommand($schedule_gui);
171 case strtolower(PublicProfileGUI::class):
173 $ilTabs->clearTargets();
175 $profile->setBackUrl($this->
ctrl->getLinkTargetByClass(
"ilbookingreservationsgui",
''));
176 $ret = $this->
ctrl->forwardCommand($profile);
180 case 'ilinfoscreengui':
185 case "ilcommonactiondispatchergui":
189 $this->
ctrl->forwardCommand($gui);
193 case "ilobjectcopygui":
196 $cp->setType(
"book");
197 $this->
ctrl->forwardCommand($cp);
200 case 'ilobjectmetadatagui':
202 $this->tabs_gui->setTabActive(
'meta_data');
204 $this->
ctrl->forwardCommand($md_gui);
207 case 'ilbookingparticipantgui':
209 $this->tabs_gui->setTabActive(
'participants');
211 $this->
ctrl->forwardCommand($object_gui);
215 case "ilbookingreservationsgui":
216 $this->tabs_gui->setTabActive(
'log');
220 $this->
ctrl->forwardCommand($res_gui);
223 case 'ilbookingpreferencesgui':
224 $this->tabs_gui->setTabActive(
'preferences');
227 $gui = $this->service->gui()->
preferences()->BookingPreferencesGUI($pool);
228 $this->
ctrl->forwardCommand($gui);
231 case strtolower(SettingsGUI::class):
234 $ilTabs->activateTab(
"settings");
237 $this->requested_ref_id,
238 $this->getCreationMode(),
241 $this->
ctrl->forwardCommand($gui);
245 if (!in_array($cmd, [
"create",
"save",
"infoScreen"])) {
248 $cmd = $this->
ctrl->getCmd();
262 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"book_pool_added"),
true);
263 $this->
ctrl->setParameter($this,
"ref_id", $new_object->
getRefId());
264 $this->
ctrl->redirect($this,
"edit");
275 if ($new_tpl_id !== $current_tpl_id) {
277 $this->
ctrl->redirect(ilDidacticTemplateGUI::class,
"confirmTemplateSwitch");
280 parent::afterUpdate();
285 $this->
ctrl->redirectByClass(SettingsGUI::class,
"");
290 $schedule_manager = $this->domain->schedules($this->
object->getId());
294 !$schedule_manager->hasSchedules()) {
295 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"book_schedule_warning_edit"));
308 $type->setRequired(
true);
313 $type->setDisabled(
true);
317 $fixed->setInfo($this->
lng->txt(
"book_schedule_type_fixed_info"));
318 $type->addOption($fixed);
322 $period =
new ilNumberInputGUI($this->
lng->txt(
"book_reservation_filter_period"),
"period");
323 $period->setInfo($this->
lng->txt(
"book_reservation_filter_period_info"));
324 $period->setSuffix($this->
lng->txt(
"days"));
326 $period->setMinValue(0);
327 $fixed->addSubItem($period);
331 $rmd->setChecked((
bool) $this->
object->getReminderStatus());
332 $info = $this->
lng->txt(
"book_reminder_day_info");
333 if (!$this->cron_manager->isJobActive(
'book_notification')) {
334 $info .=
" " . $this->
lng->txt(
"book_notification_cron_not_active");
336 $rmd->setInfo(
$info);
337 $fixed->addSubItem($rmd);
340 $rmd_day->setRequired(
true);
341 $rmd_day->setSize(3);
342 $rmd_day->setSuffix($this->
lng->txt(
"book_reminder_days"));
343 $rmd_day->setValue(max($this->
object->getReminderDay(), 1));
344 $rmd_day->setMinValue(1);
345 $rmd->addSubItem($rmd_day);
349 $none->setInfo($this->
lng->txt(
"book_schedule_type_none_direct_info"));
350 $type->addOption($none);
354 $limit->setMinValue(1);
355 $limit->setSuffix($this->
lng->txt(
"book_bookings_per_user"));
356 $none->addSubItem($limit);
360 $pref->setInfo($this->
lng->txt(
"book_schedule_type_none_preference_info"));
361 $type->addOption($pref);
364 $pref_nr =
new ilNumberInputGUI($this->
lng->txt(
"book_nr_of_preferences"),
"preference_nr");
365 $pref_nr->setSize(4);
366 $pref_nr->setMinValue(1);
367 $pref_nr->setInfo($this->
lng->txt(
"book_nr_of_preferences_info"));
368 $pref_nr->setSuffix($this->
lng->txt(
"book_nr_preferences"));
369 $pref_nr->setRequired(
true);
370 $pref->addSubItem($pref_nr);
374 $pref_deadline->setInfo($this->
lng->txt(
"book_pref_deadline_info"));
375 $pref_deadline->setShowTime(
true);
376 $pref_deadline->setRequired(
true);
377 $pref->addSubItem($pref_deadline);
381 $public->setInfo($this->
lng->txt(
"book_public_log_info"));
386 $mess->setInfo($this->
lng->txt(
"book_messages_info"));
389 $this->
lng->loadLanguageModule(
"rep");
391 $section->setTitle($this->
lng->txt(
'rep_activation_availability'));
399 $pres->setTitle($this->
lng->txt(
'obj_presentation'));
403 $obj_service->commonSettings()->legacyForm($form, $this->
object)->addTileImage();
407 $feat->setTitle($this->
lng->txt(
'obj_features'));
425 protected function setTabs(): void
432 if (!$this->
ctrl->getNextClass() && in_array($this->
ctrl->getCmd(), array(
"create",
"save"))) {
439 $this->tabs_gui->addTab(
441 $this->
lng->txt(
"book_pref_overview"),
442 $this->ctrl->getLinkTargetByClass(
"ilbookingpreferencesgui",
"")
447 $this->checkPermissionBool(
'write')) {
448 $this->tabs_gui->addTab(
450 $this->
lng->txt(
"book_booking_objects"),
451 $this->ctrl->getLinkTarget($this,
"render")
457 $this->tabs_gui->addTab(
459 $this->
lng->txt(
"book_log"),
460 $this->ctrl->getLinkTargetByClass(
"ilbookingreservationsgui",
"")
464 $this->tabs_gui->addTab(
466 $this->
lng->txt(
"info_short"),
467 $this->ctrl->getLinkTarget($this,
"infoscreen")
479 $this->tabs_gui->addTab(
481 $this->
lng->txt(
"settings"),
482 $this->ctrl->getLinkTargetByClass(SettingsGUI::class,
"")
486 $this->tabs_gui->addTab(
488 $this->
lng->txt(
"book_schedules"),
489 $this->ctrl->getLinkTargetByClass(
"ilbookingschedulegui",
"render")
493 $this->tabs_gui->addTab(
495 $this->
lng->txt(
"participants"),
496 $this->ctrl->getLinkTargetByClass(
"ilbookingparticipantgui",
"render")
501 $mdtab = $mdgui->getTab();
503 $this->tabs_gui->addTarget(
507 "ilobjectmetadatagui"
514 $this->tabs_gui->addTab(
516 $this->
lng->txt(
"perm_settings"),
517 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
522 public static function _goto(
string $a_target): void
525 $main_tpl =
$DIC->ui()->mainTemplate();
527 $ilAccess =
$DIC->access();
530 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
532 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
535 $main_tpl->setOnScreenMessage(
'failure', sprintf(
536 $lng->
txt(
"msg_no_perm_read_item"),
548 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
555 $this->tabs_gui->setTabActive(
'info');
561 $info->enablePrivateNotes();
568 $info->enableNewsEditing(
false);
571 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
573 if ($enable_internal_rss) {
574 $info->setBlockProperty(
"news",
"settings",
true);
575 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
580 if ($ilCtrl->getNextClass() ===
"ilinfoscreengui") {
581 $ilCtrl->forwardCommand(
$info);
583 return $ilCtrl->getHTML(
$info);
594 $this->tabs_gui->clearTargets();
599 $profile->setBackUrl($this->
ctrl->getLinkTarget($this,
'log'));
607 if (is_object($this->
object)) {
608 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
"render"),
"", $this->object->getRefId());
621 $lg = parent::initHeaderAction($sub_type, $sub_id);
625 $this->object->getReminderStatus()) {
630 $this->object->getId()
635 $lng->
txt(
"noti_notification_deactivated")
639 $caption =
"noti_activate_notification";
644 $lng->
txt(
"noti_notification_activated")
648 $caption =
"noti_deactivate_notification";
651 $lg->addCustomCommand(
669 switch ($this->book_request->getNotification()) {
Author: Alexander Killing killing@leifos.de
@ilCtrl_Calls ILIAS\BookingManager\Settings\SettingsGUI: ilDidacticTemplateGUI
GUI class for public user profile presentation.
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...
static getList(int $a_pool_id, ?string $a_title=null)
Get list of booking objects.
static lookupPoolId(int $object_id)
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...
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
static lookupTemplateId(int $a_ref_id)
Base class for ILIAS Exception handling.
loadLanguageModule(string $a_module)
Load language module.
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...
Last visited history for repository items.
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
@ilCtrl_Calls ilObjBookingPoolGUI: ilPermissionGUI, ilBookingObjectGUI @ilCtrl_Calls ilObjBookingPool...
afterSave(ilObject $new_object)
Post (successful) object creation hook.
ilNavigationHistory $nav_history
afterUpdate()
Post (successful) object update hook.
ILIAS Cron Job JobManager $cron_manager
static _goto(string $a_target)
infoScreenObject()
this one is called from the info button in the repository
ilBookingHelpAdapter $help
initEditCustomForm(ilPropertyFormGUI $form)
Add custom fields to update form.
StandardGUIRequest $book_request
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
initHeaderAction(?string $sub_type=null, ?int $sub_id=null)
Add header action menu.
InternalDomainService $domain
addExternalEditFormCustom(ilPropertyFormGUI $form)
const TYPE_NO_SCHEDULE_PREFERENCES
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
ilGlobalTemplateInterface $tpl
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
initDidacticTemplate(ilPropertyFormGUI $form)
addHeaderAction()
Add header action menu.
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
prepareOutput(bool $show_sub_objects=true)
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
Class ilObject Basic functions for all objects.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This class represents an option in a radio group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setContent(string $a_html)
Sets content for standard template.
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc