66 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
70 $this->tpl = $DIC[
"tpl"];
71 $this->tabs = $DIC->tabs();
72 $this->nav_history = $DIC[
"ilNavigationHistory"];
73 $this->ctrl = $DIC->ctrl();
74 $this->lng = $DIC->language();
77 $this->lng->loadLanguageModule(
"book");
80 if (is_object($this->
object)) {
82 $DIC[
"ilHelp"]->setScreenIdComponent(
"book");
85 $this->user_profile_id = (int)
$_GET[
"user_id"];
86 $this->book_obj_id = (int) $_REQUEST[
'object_id'];
90 $this->profile_user_id = (int)
$_GET[
'user_id'];
92 $this->service = $DIC->bookingManager()->internal();
94 $this->user_id_assigner = $this->
user->getId();
96 $this->user_id_to_book = (int)
$_GET[
'bkusr'];
102 throw new ilException(
"Booking Object ID does not match Booking Pool.");
118 $next_class = $this->ctrl->getNextClass($this);
119 $cmd = $this->ctrl->getCmd();
121 if (!$next_class && $cmd ==
'render') {
125 $this->ctrl->setCmdClass(
'ilBookingPreferencesGUI');
127 $this->ctrl->setCmdClass(
'ilBookingObjectGUI');
129 $next_class = $this->ctrl->getNextClass($this);
131 $this->ctrl->redirect($this,
"infoscreen");
140 $ilNavigationHistory->addItem(
142 "./goto.php?target=book_" . $this->ref_id,
148 switch ($next_class) {
149 case 'ilpermissiongui':
151 $this->tabs_gui->setTabActive(
'perm_settings');
153 $this->ctrl->forwardCommand($perm_gui);
156 case 'ilbookingobjectgui':
158 $this->ctrl->redirect($this,
"infoScreen");
161 $this->tabs_gui->setTabActive(
'render');
168 $this->ctrl->forwardCommand($object_gui);
171 case 'ilbookingschedulegui':
173 $this->tabs_gui->setTabActive(
'schedules');
175 $this->ctrl->forwardCommand($schedule_gui);
178 case 'ilpublicuserprofilegui':
180 $ilTabs->clearTargets();
182 $profile->setBackUrl($this->ctrl->getLinkTargetByClass(
"ilbookingreservationsgui",
''));
183 $ret = $this->ctrl->forwardCommand($profile);
187 case 'ilinfoscreengui':
192 case "ilcommonactiondispatchergui":
195 $this->ctrl->forwardCommand($gui);
198 case "ilobjectcopygui":
201 $cp->setType(
"book");
202 $this->ctrl->forwardCommand($cp);
205 case 'ilobjectmetadatagui':
207 $this->tabs_gui->setTabActive(
'meta_data');
209 $this->ctrl->forwardCommand($md_gui);
212 case 'ilbookingparticipantgui':
214 $this->tabs_gui->setTabActive(
'participants');
216 $this->ctrl->forwardCommand($object_gui);
220 case "ilbookingreservationsgui":
221 $this->tabs_gui->setTabActive(
'log');
223 $this->ctrl->forwardCommand($res_gui);
226 case 'ilbookingpreferencesgui':
227 $this->tabs_gui->setTabActive(
'preferences');
228 $gui = $this->service->ui()->getPreferencesGUI($this->
object);
229 $this->ctrl->forwardCommand($gui);
234 if (!in_array($cmd, [
"create",
"save",
"infoScreen"])) {
237 $cmd = $this->ctrl->getCmd();
249 $forms = parent::initCreationForms($a_new_type);
250 unset($forms[self::CFORM_IMPORT]);
257 $a_new_object->setOffline(
true);
261 ilUtil::sendSuccess($this->lng->txt(
"book_pool_added"),
true);
262 $this->ctrl->setParameter($this,
"ref_id", $a_new_object->
getRefId());
263 $this->ctrl->redirect($this,
"edit");
269 return parent::editObject();
296 $type->setRequired(
true);
301 $type->setDisabled(
true);
305 $fixed->
setInfo($this->lng->txt(
"book_schedule_type_fixed_info"));
306 $type->addOption($fixed);
310 $period =
new ilNumberInputGUI($this->lng->txt(
"book_reservation_filter_period"),
"period");
311 $period->
setInfo($this->lng->txt(
"book_reservation_filter_period_info"));
312 $period->setSuffix($this->lng->txt(
"days"));
314 $period->setMinValue(0);
315 $fixed->addSubItem($period);
319 $rmd->
setChecked($this->object->getReminderStatus());
321 $rmd->setInfo($this->lng->txt(
"book_notification_cron_not_active"));
323 $fixed->addSubItem($rmd);
325 $rmd_day =
new ilNumberInputGUI($this->lng->txt(
"book_reminder_day"),
"rmd_day");
327 $rmd_day->setInfo($this->lng->txt(
"book_reminder_day_info"));
328 $rmd_day->setSize(3);
329 $rmd_day->setSuffix($this->lng->txt(
"book_reminder_days"));
330 $rmd_day->setValue(max($this->object->getReminderDay(), 1));
331 $rmd_day->setMinValue(1);
332 $rmd->addSubItem($rmd_day);
336 $none->
setInfo($this->lng->txt(
"book_schedule_type_none_direct_info"));
337 $type->addOption($none);
339 $limit =
new ilNumberInputGUI($this->lng->txt(
"book_overall_limit"),
"limit");
341 $limit->setMinValue(1);
342 $limit->setInfo($this->lng->txt(
"book_overall_limit_info"));
343 $none->addSubItem($limit);
347 $pref->
setInfo($this->lng->txt(
"book_schedule_type_none_preference_info"));
348 $type->addOption($pref);
351 $pref_nr =
new ilNumberInputGUI($this->lng->txt(
"book_nr_of_preferences"),
"preference_nr");
353 $pref_nr->setMinValue(1);
354 $pref_nr->setInfo($this->lng->txt(
"book_nr_of_preferences_info"));
355 $pref_nr->setRequired(
true);
356 $pref->addSubItem($pref_nr);
359 $pref_deadline =
new ilDateTimeInputGUI($this->lng->txt(
"book_pref_deadline"),
"pref_deadline");
361 $pref_deadline->setRequired(
true);
362 $pref->addSubItem($pref_deadline);
365 $public->
setInfo($this->lng->txt(
"book_public_log_info"));
370 $pres->setTitle($this->lng->txt(
'obj_presentation'));
374 $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->addTileImage();
378 $feat->setTitle($this->lng->txt(
'obj_features'));
384 $a_values[
"online"] = !$this->
object->isOffline();
385 $a_values[
"public"] = $this->
object->hasPublicLog();
386 $a_values[
"stype"] = $this->
object->getScheduleType();
387 $a_values[
"limit"] = $this->
object->getOverallLimit();
388 $a_values[
"period"] = $this->
object->getReservationFilterPeriod();
389 $a_values[
"rmd"] = $this->
object->getReminderStatus();
390 $a_values[
"rmd_day"] = $this->
object->getReminderDay();
391 $a_values[
"preference_nr"] = $this->
object->getPreferenceNumber();
392 if ($this->object->getPreferenceDeadline() > 0) {
402 $pref_deadline = $pref_deadline
406 $this->
object->setOffline(!$a_form->
getInput(
'online'));
407 $this->
object->setReminderStatus($a_form->
getInput(
'rmd'));
408 $this->
object->setReminderDay($a_form->
getInput(
'rmd_day'));
409 $this->
object->setPublicLog($a_form->
getInput(
'public'));
410 $this->
object->setScheduleType($a_form->
getInput(
'stype'));
411 $this->
object->setOverallLimit($a_form->
getInput(
'limit') ? $a_form->
getInput(
'limit') : null);
412 $this->
object->setReservationFilterPeriod(strlen($a_form->
getInput(
'period')) ? (
int) $a_form->
getInput(
'period') : null);
413 $this->
object->setPreferenceDeadline($pref_deadline);
414 $this->
object->setPreferenceNumber($a_form->
getInput(
'preference_nr'));
417 $obj_service->commonSettings()->legacyForm($a_form, $this->
object)->saveTileImage();
420 $this->object->getId(),
429 $this->object->getId(),
445 if (in_array($this->ctrl->getCmd(), array(
"create",
"save")) && !$this->ctrl->getNextClass()) {
452 $this->tabs_gui->addTab(
454 $this->lng->txt(
"book_pref_overview"),
455 $this->ctrl->getLinkTargetByClass(
"ilbookingpreferencesgui",
"")
461 $this->tabs_gui->addTab(
463 $this->lng->txt(
"book_booking_types"),
464 $this->ctrl->getLinkTarget($this,
"render")
469 $this->tabs_gui->addTab(
471 $this->lng->txt(
"info_short"),
472 $this->ctrl->getLinkTarget($this,
"infoscreen")
476 $this->tabs_gui->addTab(
478 $this->lng->txt(
"book_log"),
479 $this->ctrl->getLinkTargetByClass(
"ilbookingreservationsgui",
"")
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(
"settings"),
496 $this->ctrl->getLinkTarget($this,
"edit")
501 $mdtab = $mdgui->getTab();
503 $this->tabs_gui->addTarget(
507 "ilobjectmetadatagui" 513 $this->tabs_gui->addTab(
515 $this->lng->txt(
"participants"),
516 $this->ctrl->getLinkTargetByClass(
"ilbookingparticipantgui",
"render")
521 $this->tabs_gui->addTab(
523 $this->lng->txt(
"perm_settings"),
524 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
531 $this->
help->setHelpId($a_id);
535 switch ($this->object->getScheduleType()) {
541 $ilHelp->setScreenIdComponent(
'book');
542 $ilHelp->setScreenId(
'object' . $object_subtype);
543 $ilHelp->setSubScreenId($a_id);
546 public static function _goto($a_target)
550 $ilAccess = $DIC->access();
551 $lng = $DIC->language();
553 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
555 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
559 $lng->txt(
"msg_no_perm_read_item"),
573 $this->ctrl->setCmd(
"showSummary");
574 $this->ctrl->setCmdClass(
"ilinfoscreengui");
582 $this->tabs_gui->setTabActive(
'info');
588 $info->enablePrivateNotes();
595 $info->enableNewsEditing(
false);
598 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
600 if ($enable_internal_rss) {
601 $info->setBlockProperty(
"news",
"settings",
true);
602 $info->setBlockProperty(
"news",
"public_notifications_option",
true);
607 if ($ilCtrl->getNextClass() ==
"ilinfoscreengui") {
608 $ilCtrl->forwardCommand($info);
610 return $ilCtrl->getHTML($info);
620 $this->tabs_gui->clearTargets();
622 $user_id = $this->profile_user_id;
625 $profile->setBackUrl($this->ctrl->getLinkTarget($this,
'log'));
626 $tpl->setContent($ilCtrl->getHTML($profile));
633 if (is_object($this->
object)) {
634 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"render"),
"", $this->
object->getRefId());
648 $lng->loadLanguageModule(
"noti");
650 $lg = parent::initHeaderAction($a_sub_type, $a_sub_id);
652 if ($lg &&
$access->checkAccess(
"read",
"", $this->ref_id)) {
655 $this->
object->getReminderStatus()) {
660 $lng->txt(
"noti_notification_deactivated")
663 $ctrl->setParameter($this,
"ntf", 1);
664 $caption =
"noti_activate_notification";
669 $lng->txt(
"noti_notification_activated")
672 $ctrl->setParameter($this,
"ntf", 0);
673 $caption =
"noti_deactivate_notification";
676 $lg->addCustomCommand(
677 $ctrl->getLinkTarget($this,
"saveNotification"),
681 $ctrl->setParameter($this,
"ntf",
"");
697 switch (
$_GET[
"ntf"]) {
706 $ctrl->redirect($this,
"render");
Class ilObjBookingPoolGUI.
This class represents an option in a radio group.
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
getEditFormCustomValues(array &$a_values)
static getList($a_pool_id, $a_title=null)
Get list of booking objects for given type.
GUI class for the workflow of copying objects.
Help adapter for booking manager.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
initHeaderAction($a_sub_type=null, $a_sub_id=null)
static _lookupTitle($a_id)
lookup object title
saveNotificationObject()
Save notification.
updateCustom(ilPropertyFormGUI $a_form)
setInfo($a_info)
Set Info.
initCreationForms($a_new_type)
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
ilObjBookingPoolGUI constructor.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Class ilBookingParticipantGUI.
prepareOutput($a_show_subobjects=true)
prepare output
GUI class for public user profile presentation.
Class ilBookingObjectGUI.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
initEditCustomForm(ilPropertyFormGUI $a_form)
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static lookupPoolId($object_id)
Lookup pool id.
afterSave(ilObject $a_new_object)
__construct(Container $dic, ilPlugin $plugin)
Class ilBookingScheduleGUI.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
addExternalEditFormCustom(ilPropertyFormGUI $a_form)
getRefId()
get reference id public
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
setTabs()
set admin tabs public
getObjectService()
Get object service.
const TYPE_NO_SCHEDULE_PREFERENCES
update()
update object in db
static isJobActive($a_job_id)
Check if given job is currently active.
addHeaderAction()
Add header action menu.
infoScreenObject()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
static getList($a_pool_id)
Get list of booking objects for given pool.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
showNoScheduleMessage()
Show no schedule message.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call