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()
63 $this->domain = $DIC->bookingManager()->internal()->domain();
66 $this->
lng->loadLanguageModule(
"book");
69 if (is_object($this->
object)) {
73 $DIC[
"ilHelp"]->setScreenIdComponent(
"book");
76 $this->book_obj_id = $this->book_request->getObjectId();
77 $this->seed = $this->book_request->getSeed();
78 $this->sseed = $this->book_request->getSSeed();
79 $this->reservation_id = $this->book_request->getReservationId();
80 $this->profile_user_id = $this->book_request->getUserId();
82 $this->service = $DIC->bookingManager()->internal();
84 $this->user_id_assigner = $this->
user->getId();
85 if ($this->book_request->getBookedUser() > 0) {
86 $this->user_id_to_book = $this->book_request->getBookedUser();
91 if ($this->book_request->getObjectId() > 0 &&
93 throw new ilException(
"Booking Object ID does not match Booking Pool.");
95 $this->cron_manager = $DIC->cron()->manager();
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());
306 $schedule_manager = $this->domain->schedules($this->
object->getId());
310 !$schedule_manager->hasSchedules()) {
311 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"book_schedule_warning_edit"));
324 $type->setRequired(
true);
329 $type->setDisabled(
true);
333 $fixed->
setInfo($this->
lng->txt(
"book_schedule_type_fixed_info"));
334 $type->addOption($fixed);
338 $period =
new ilNumberInputGUI($this->
lng->txt(
"book_reservation_filter_period"),
"period");
339 $period->setInfo($this->
lng->txt(
"book_reservation_filter_period_info"));
340 $period->setSuffix($this->
lng->txt(
"days"));
342 $period->setMinValue(0);
343 $fixed->addSubItem($period);
347 $rmd->setChecked((
bool) $this->
object->getReminderStatus());
348 $info = $this->
lng->txt(
"book_reminder_day_info");
349 if (!$this->cron_manager->isJobActive(
'book_notification')) {
350 $info .=
" " . $this->
lng->txt(
"book_notification_cron_not_active");
352 $rmd->setInfo($info);
353 $fixed->addSubItem($rmd);
356 $rmd_day->setRequired(
true);
357 $rmd_day->setSize(3);
358 $rmd_day->setSuffix($this->
lng->txt(
"book_reminder_days"));
359 $rmd_day->setValue(max($this->
object->getReminderDay(), 1));
360 $rmd_day->setMinValue(1);
361 $rmd->addSubItem($rmd_day);
365 $none->
setInfo($this->
lng->txt(
"book_schedule_type_none_direct_info"));
366 $type->addOption($none);
370 $limit->setMinValue(1);
371 $limit->setSuffix($this->
lng->txt(
"book_bookings_per_user"));
372 $none->addSubItem($limit);
376 $pref->
setInfo($this->
lng->txt(
"book_schedule_type_none_preference_info"));
377 $type->addOption($pref);
379 $pref_options_disabled =
false;
381 $pref_manager = $this->domain->preferences($this->
object);
382 $pref_options_disabled = $pref_manager->hasRun();
386 $pref_nr =
new ilNumberInputGUI($this->
lng->txt(
"book_nr_of_preferences"),
"preference_nr");
387 $pref_nr->setSize(4);
388 $pref_nr->setMinValue(1);
389 $pref_nr->setInfo($this->
lng->txt(
"book_nr_of_preferences_info"));
390 $pref_nr->setSuffix($this->
lng->txt(
"book_nr_preferences"));
391 $pref_nr->setRequired(
true);
392 $pref_nr->setDisabled($pref_options_disabled);
393 $pref->addSubItem($pref_nr);
397 $pref_deadline->
setInfo($this->
lng->txt(
"book_pref_deadline_info"));
398 $pref_deadline->setShowTime(
true);
399 $pref_deadline->setRequired(
true);
400 $pref_deadline->setDisabled($pref_options_disabled);
401 $pref->addSubItem($pref_deadline);
405 $public->setInfo($this->
lng->txt(
"book_public_log_info"));
410 $mess->setInfo($this->
lng->txt(
"book_messages_info"));
413 $this->
lng->loadLanguageModule(
"rep");
415 $section->setTitle($this->
lng->txt(
'rep_activation_availability'));
423 $pres->setTitle($this->
lng->txt(
'obj_presentation'));
427 $obj_service->commonSettings()->legacyForm($form, $this->
object)->addTileImage();
431 $feat->setTitle($this->
lng->txt(
'obj_features'));
438 $a_values[
"online"] = !$this->
object->isOffline();
439 $a_values[
"public"] = $this->
object->hasPublicLog();
440 $a_values[
"messages"] = $this->
object->usesMessages();
441 $a_values[
"stype"] = $this->
object->getScheduleType();
442 $a_values[
"limit"] = $this->
object->getOverallLimit();
443 $a_values[
"period"] = $this->
object->getReservationFilterPeriod();
444 $a_values[
"rmd"] = $this->
object->getReminderStatus();
445 $a_values[
"rmd_day"] = $this->
object->getReminderDay();
446 $a_values[
"preference_nr"] = $this->
object->getPreferenceNumber();
447 if ($this->
object->getPreferenceDeadline() > 0) {
457 if ($pref_deadline !== null) {
458 $pref_deadline = $pref_deadline->getDate();
459 $pref_deadline = $pref_deadline
463 $this->
object->setOffline(!$form->
getInput(
'online'));
464 $this->
object->setReminderStatus((
int) $form->
getInput(
'rmd'));
465 $this->
object->setReminderDay($form->
getInput(
'rmd_day'));
466 $this->
object->setPublicLog($form->
getInput(
'public'));
467 $this->
object->setScheduleType($form->
getInput(
'stype'));
468 $this->
object->setMessages((
bool) (
int) $form->
getInput(
'messages'));
469 $this->
object->setOverallLimit($form->
getInput(
'limit') ?: null);
470 $this->
object->setReservationFilterPeriod($form->
getInput(
'period') !=
'' ? (
int) $form->
getInput(
'period') : null);
471 $this->
object->setPreferenceDeadline($pref_deadline);
472 $this->
object->setPreferenceNumber($form->
getInput(
'preference_nr'));
475 $obj_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
499 protected function setTabs():
void 506 if (!$this->
ctrl->getNextClass() && in_array($this->
ctrl->getCmd(), array(
"create",
"save"))) {
513 $this->tabs_gui->addTab(
515 $this->
lng->txt(
"book_pref_overview"),
516 $this->
ctrl->getLinkTargetByClass(
"ilbookingpreferencesgui",
"")
522 $this->tabs_gui->addTab(
524 $this->
lng->txt(
"book_booking_objects"),
525 $this->
ctrl->getLinkTarget($this,
"render")
531 $this->tabs_gui->addTab(
533 $this->
lng->txt(
"book_log"),
534 $this->
ctrl->getLinkTargetByClass(
"ilbookingreservationsgui",
"")
538 $this->tabs_gui->addTab(
540 $this->
lng->txt(
"info_short"),
541 $this->
ctrl->getLinkTarget($this,
"infoscreen")
546 $this->tabs_gui->addTab(
548 $this->
lng->txt(
"settings"),
549 $this->
ctrl->getLinkTarget($this,
"edit")
553 $this->tabs_gui->addTab(
555 $this->
lng->txt(
"book_schedules"),
556 $this->
ctrl->getLinkTargetByClass(
"ilbookingschedulegui",
"render")
560 $this->tabs_gui->addTab(
562 $this->
lng->txt(
"participants"),
563 $this->
ctrl->getLinkTargetByClass(
"ilbookingparticipantgui",
"render")
568 $mdtab = $mdgui->getTab();
570 $this->tabs_gui->addTarget(
574 "ilobjectmetadatagui" 581 $this->tabs_gui->addTab(
583 $this->
lng->txt(
"perm_settings"),
584 $this->
ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
589 public static function _goto(
string $a_target): void
592 $main_tpl = $DIC->ui()->mainTemplate();
594 $ilAccess = $DIC->access();
595 $lng = $DIC->language();
597 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
599 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
602 $main_tpl->setOnScreenMessage(
'failure', sprintf(
603 $lng->
txt(
"msg_no_perm_read_item"),
615 $this->
ctrl->setCmd(
"showSummary");
616 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
624 $this->tabs_gui->setTabActive(
'info');
630 $info->enablePrivateNotes();
637 $info->enableNewsEditing(
false);
640 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
642 if ($enable_internal_rss) {
643 $info->setBlockProperty(
"news",
"settings",
true);
644 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
649 if ($ilCtrl->getNextClass() ===
"ilinfoscreengui") {
650 $ilCtrl->forwardCommand($info);
652 return $ilCtrl->getHTML($info);
663 $this->tabs_gui->clearTargets();
668 $profile->setBackUrl($this->
ctrl->getLinkTarget($this,
'log'));
676 if (is_object($this->
object)) {
677 $ilLocator->
addItem($this->
object->getTitle(), $this->
ctrl->getLinkTarget($this,
"render"),
"", $this->
object->getRefId());
690 $lg = parent::initHeaderAction($sub_type, $sub_id);
694 $this->
object->getReminderStatus()) {
699 $this->
object->getId()
704 $lng->
txt(
"noti_notification_deactivated")
708 $caption =
"noti_activate_notification";
713 $lng->
txt(
"noti_notification_activated")
717 $caption =
"noti_deactivate_notification";
720 $lg->addCustomCommand(
738 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="")
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)
GUI class for public user profile presentation.
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
Last visited history for 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)
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