29 protected \ILIAS\BookingManager\InternalDomainService
$domain;
32 protected \ILIAS\BookingManager\InternalService
$service;
47 bool $a_call_by_reference,
48 bool $a_prepare_output =
true 52 $this->tpl = $DIC[
"tpl"];
53 $this->
tabs = $DIC->tabs();
54 $this->nav_history = $DIC[
"ilNavigationHistory"];
55 $this->
ctrl = $DIC->ctrl();
56 $this->
lng = $DIC->language();
59 $this->book_request = $DIC->bookingManager()
65 $this->
lng->loadLanguageModule(
"book");
68 if (is_object($this->
object)) {
72 $DIC[
"ilHelp"]->setScreenIdComponent(
"book");
75 $this->book_obj_id = $this->book_request->getObjectId();
76 $this->seed = $this->book_request->getSeed();
77 $this->sseed = $this->book_request->getSSeed();
78 $this->reservation_id = $this->book_request->getReservationId();
79 $this->profile_user_id = $this->book_request->getUserId();
81 $this->service = $DIC->bookingManager()->internal();
83 $this->user_id_assigner = $this->
user->getId();
84 if ($this->book_request->getBookedUser() > 0) {
85 $this->user_id_to_book = $this->book_request->getBookedUser();
90 if ($this->book_request->getObjectId() > 0 &&
92 throw new ilException(
"Booking Object ID does not match Booking Pool.");
94 $this->cron_manager = $DIC->cron()->manager();
95 $this->domain = $DIC->bookingManager()->internal()->domain();
110 $next_class = $this->
ctrl->getNextClass($this);
111 $cmd = $this->
ctrl->getCmd();
113 if (!$next_class && $cmd ===
'render') {
117 $this->
ctrl->setCmdClass(
'ilBookingPreferencesGUI');
119 $this->
ctrl->setCmdClass(
'ilBookingObjectGUI');
121 $next_class = $this->
ctrl->getNextClass($this);
123 $this->
ctrl->redirect($this,
"infoscreen");
127 $ilNavigationHistory->addItem(
129 "./goto.php?target=book_" . $this->ref_id,
135 switch ($next_class) {
136 case 'ilpermissiongui':
138 $this->tabs_gui->setTabActive(
'perm_settings');
140 $this->
ctrl->forwardCommand($perm_gui);
143 case 'ilbookingobjectgui':
145 $this->
ctrl->redirect($this,
"infoScreen");
148 $this->tabs_gui->setTabActive(
'render');
155 $this->
ctrl->forwardCommand($object_gui);
158 case 'ilbookingschedulegui':
160 $this->tabs_gui->setTabActive(
'schedules');
162 $this->
ctrl->forwardCommand($schedule_gui);
165 case 'ilpublicuserprofilegui':
167 $ilTabs->clearTargets();
169 $profile->setBackUrl($this->
ctrl->getLinkTargetByClass(
"ilbookingreservationsgui",
''));
170 $ret = $this->
ctrl->forwardCommand($profile);
174 case 'ilinfoscreengui':
179 case "ilcommonactiondispatchergui":
183 $this->
ctrl->forwardCommand($gui);
187 case "ilobjectcopygui":
190 $cp->setType(
"book");
191 $this->
ctrl->forwardCommand($cp);
194 case 'ilobjectmetadatagui':
196 $this->tabs_gui->setTabActive(
'meta_data');
198 $this->
ctrl->forwardCommand($md_gui);
201 case 'ilbookingparticipantgui':
203 $this->tabs_gui->setTabActive(
'participants');
205 $this->
ctrl->forwardCommand($object_gui);
209 case "ilbookingreservationsgui":
210 $this->tabs_gui->setTabActive(
'log');
214 $this->
ctrl->forwardCommand($res_gui);
217 case 'ilbookingpreferencesgui':
218 $this->tabs_gui->setTabActive(
'preferences');
221 $gui = $this->service->gui()->preferences()->BookingPreferencesGUI($pool);
222 $this->
ctrl->forwardCommand($gui);
225 case 'ildidactictemplategui':
226 $this->
ctrl->setReturn($this,
'edit');
228 $this->
ctrl->forwardCommand($did);
233 if (!in_array($cmd, [
"create",
"save",
"infoScreen"])) {
236 $cmd = $this->
ctrl->getCmd();
247 $forms = parent::initCreationForms($new_type);
248 unset($forms[self::CFORM_IMPORT]);
255 $new_object->setOffline(
true);
259 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"book_pool_added"),
true);
260 $this->
ctrl->setParameter($this,
"ref_id", $new_object->
getRefId());
261 $this->
ctrl->redirect($this,
"edit");
272 if ($new_tpl_id !== $current_tpl_id) {
274 $this->
ctrl->setReturn($this,
'edit');
275 $this->
ctrl->setCmdClass(
'ildidactictemplategui');
276 $this->
ctrl->setCmd(
'confirmTemplateSwitch');
278 $this->
ctrl->forwardCommand($dtpl_gui);
281 parent::afterUpdate();
288 $this->error->raiseError($this->
lng->txt(
"msg_no_perm_write"), $this->error->MESSAGE);
291 $this->tabs_gui->activateTab(
"settings");
296 $form->setValuesByArray($values,
true);
301 $this->tpl->setContent($form->getHTML());
309 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"book_schedule_warning_edit"));
322 $type->setRequired(
true);
327 $type->setDisabled(
true);
331 $fixed->
setInfo($this->
lng->txt(
"book_schedule_type_fixed_info"));
332 $type->addOption($fixed);
336 $period =
new ilNumberInputGUI($this->
lng->txt(
"book_reservation_filter_period"),
"period");
337 $period->
setInfo($this->
lng->txt(
"book_reservation_filter_period_info"));
338 $period->setSuffix($this->
lng->txt(
"days"));
340 $period->setMinValue(0);
341 $fixed->addSubItem($period);
346 $info = $this->
lng->txt(
"book_reminder_day_info");
347 if (!$this->cron_manager->isJobActive(
'book_notification')) {
348 $info .=
" " . $this->
lng->txt(
"book_notification_cron_not_active");
350 $rmd->setInfo($info);
351 $fixed->addSubItem($rmd);
355 $rmd_day->setSize(3);
356 $rmd_day->setSuffix($this->
lng->txt(
"book_reminder_days"));
357 $rmd_day->setValue(max($this->
object->getReminderDay(), 1));
358 $rmd_day->setMinValue(1);
359 $rmd->addSubItem($rmd_day);
363 $none->
setInfo($this->
lng->txt(
"book_schedule_type_none_direct_info"));
364 $type->addOption($none);
368 $limit->setMinValue(1);
369 $limit->setSuffix($this->
lng->txt(
"book_bookings_per_user"));
370 $none->addSubItem($limit);
374 $pref->
setInfo($this->
lng->txt(
"book_schedule_type_none_preference_info"));
375 $type->addOption($pref);
377 $pref_options_disabled =
false;
379 $pref_manager = $this->domain->preferences($this->
object);
380 $pref_options_disabled = $pref_manager->hasRun();
384 $pref_nr =
new ilNumberInputGUI($this->
lng->txt(
"book_nr_of_preferences"),
"preference_nr");
386 $pref_nr->setMinValue(1);
387 $pref_nr->setInfo($this->
lng->txt(
"book_nr_of_preferences_info"));
388 $pref_nr->setSuffix($this->
lng->txt(
"book_nr_preferences"));
389 $pref_nr->setRequired(
true);
390 $pref_nr->setDisabled($pref_options_disabled);
391 $pref->addSubItem($pref_nr);
395 $pref_deadline->
setInfo($this->
lng->txt(
"book_pref_deadline_info"));
396 $pref_deadline->setShowTime(
true);
397 $pref_deadline->setRequired(
true);
398 $pref_deadline->setDisabled($pref_options_disabled);
399 $pref->addSubItem($pref_deadline);
402 $public->
setInfo($this->
lng->txt(
"book_public_log_info"));
405 $this->
lng->loadLanguageModule(
"rep");
407 $section->setTitle($this->
lng->txt(
'rep_activation_availability'));
415 $pres->setTitle($this->
lng->txt(
'obj_presentation'));
419 $obj_service->commonSettings()->legacyForm($form, $this->
object)->addTileImage();
423 $feat->setTitle($this->
lng->txt(
'obj_features'));
430 $a_values[
"online"] = !$this->
object->isOffline();
431 $a_values[
"public"] = $this->
object->hasPublicLog();
432 $a_values[
"stype"] = $this->
object->getScheduleType();
433 $a_values[
"limit"] = $this->
object->getOverallLimit();
434 $a_values[
"period"] = $this->
object->getReservationFilterPeriod();
435 $a_values[
"rmd"] = $this->
object->getReminderStatus();
436 $a_values[
"rmd_day"] = $this->
object->getReminderDay();
437 $a_values[
"preference_nr"] = $this->
object->getPreferenceNumber();
438 if ($this->
object->getPreferenceDeadline() > 0) {
448 if ($pref_deadline !== null) {
449 $pref_deadline = $pref_deadline->getDate();
450 $pref_deadline = $pref_deadline
454 $this->
object->setOffline(!$form->
getInput(
'online'));
455 $this->
object->setReminderStatus((
int) $form->
getInput(
'rmd'));
456 $this->
object->setReminderDay($form->
getInput(
'rmd_day'));
457 $this->
object->setPublicLog($form->
getInput(
'public'));
458 $this->
object->setScheduleType($form->
getInput(
'stype'));
459 $this->
object->setOverallLimit($form->
getInput(
'limit') ?: null);
460 $this->
object->setReservationFilterPeriod($form->
getInput(
'period') !=
'' ? (
int) $form->
getInput(
'period') : null);
461 $this->
object->setPreferenceDeadline($pref_deadline);
462 $this->
object->setPreferenceNumber($form->
getInput(
'preference_nr'));
465 $obj_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
489 protected function setTabs():
void 496 if (!$this->
ctrl->getNextClass() && in_array($this->
ctrl->getCmd(), array(
"create",
"save"))) {
503 $this->tabs_gui->addTab(
505 $this->
lng->txt(
"book_pref_overview"),
506 $this->
ctrl->getLinkTargetByClass(
"ilbookingpreferencesgui",
"")
512 $this->tabs_gui->addTab(
514 $this->
lng->txt(
"book_booking_objects"),
515 $this->
ctrl->getLinkTarget($this,
"render")
521 $this->tabs_gui->addTab(
523 $this->
lng->txt(
"book_log"),
524 $this->
ctrl->getLinkTargetByClass(
"ilbookingreservationsgui",
"")
528 $this->tabs_gui->addTab(
530 $this->
lng->txt(
"info_short"),
531 $this->
ctrl->getLinkTarget($this,
"infoscreen")
536 $this->tabs_gui->addTab(
538 $this->
lng->txt(
"settings"),
539 $this->
ctrl->getLinkTarget($this,
"edit")
543 $this->tabs_gui->addTab(
545 $this->
lng->txt(
"book_schedules"),
546 $this->
ctrl->getLinkTargetByClass(
"ilbookingschedulegui",
"render")
550 $this->tabs_gui->addTab(
552 $this->
lng->txt(
"participants"),
553 $this->
ctrl->getLinkTargetByClass(
"ilbookingparticipantgui",
"render")
558 $mdtab = $mdgui->getTab();
560 $this->tabs_gui->addTarget(
564 "ilobjectmetadatagui" 571 $this->tabs_gui->addTab(
573 $this->
lng->txt(
"perm_settings"),
574 $this->
ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
579 public static function _goto(
string $a_target): void
582 $main_tpl = $DIC->ui()->mainTemplate();
584 $ilAccess = $DIC->access();
585 $lng = $DIC->language();
587 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
589 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
592 $main_tpl->setOnScreenMessage(
'failure', sprintf(
593 $lng->
txt(
"msg_no_perm_read_item"),
605 $this->
ctrl->setCmd(
"showSummary");
606 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
614 $this->tabs_gui->setTabActive(
'info');
620 $info->enablePrivateNotes();
627 $info->enableNewsEditing(
false);
630 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
632 if ($enable_internal_rss) {
633 $info->setBlockProperty(
"news",
"settings",
true);
634 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
639 if ($ilCtrl->getNextClass() ===
"ilinfoscreengui") {
640 $ilCtrl->forwardCommand($info);
642 return $ilCtrl->getHTML($info);
653 $this->tabs_gui->clearTargets();
658 $profile->setBackUrl($this->
ctrl->getLinkTarget($this,
'log'));
666 if (is_object($this->
object)) {
667 $ilLocator->
addItem($this->
object->getTitle(), $this->
ctrl->getLinkTarget($this,
"render"),
"", $this->
object->getRefId());
680 $lg = parent::initHeaderAction($sub_type, $sub_id);
684 $this->
object->getReminderStatus()) {
689 $this->
object->getId()
694 $lng->
txt(
"noti_notification_deactivated")
698 $caption =
"noti_activate_notification";
703 $lng->
txt(
"noti_notification_activated")
707 $caption =
"noti_deactivate_notification";
710 $lg->addCustomCommand(
728 switch ($this->book_request->getNotification()) {
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...
updateCustom(ilPropertyFormGUI $form)
initCreationForms(string $new_type)
getEditFormCustomValues(array &$a_values)
ilNavigationHistory $nav_history
static _goto(string $a_target)
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...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
GUI class for the workflow of copying objects.
addExternalEditFormCustom(ilPropertyFormGUI $form)
__construct($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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) ...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
static getList(int $a_pool_id)
Get list of booking objects for given pool.
loadLanguageModule(string $a_module)
Load language module.
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initEditCustomForm(ilPropertyFormGUI $form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupTemplateId(int $a_ref_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...
ilGlobalTemplateInterface $tpl
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
ilCronManager $cron_manager
ilBookingHelpAdapter $help
initDidacticTemplate(ilPropertyFormGUI $form)
Class ilObjectGUI Basic methods of all Output classes.
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
ILIAS BookingManager InternalDomainService $domain
Navigation History of Repository Items.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
initHeaderAction(?string $sub_type=null, ?int $sub_id=null)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static lookupPoolId(int $object_id)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
const TYPE_NO_SCHEDULE_PREFERENCES
afterSave(ilObject $new_object)
addHeaderAction()
Add header action menu.
infoScreenObject()
this one is called from the info button in the repository
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getList(int $a_pool_id, string $a_title=null)
Get list of booking objects.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
ILIAS BookingManager StandardGUIRequest $book_request
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
ILIAS BookingManager InternalService $service