3declare(strict_types=1);
42 protected \ILIAS\DI\UIServices
$ui;
64 $this->
ctrl = $DIC->ctrl();
65 $this->
lng = $DIC->language();
66 $this->
lng->loadLanguageModule(
'dateplaner');
68 $this->
http = $DIC->http();
70 $this->tpl =
$DIC->ui()->mainTemplate();
71 $this->tabs_gui =
$DIC->tabs();
72 $this->
user = $DIC->user();
73 $this->rbacsystem =
$DIC->rbac()->system();
74 $this->
access = $DIC->access();
75 $this->
help = $DIC[
"ilHelp"];
76 $this->
ui = $DIC->ui();
77 $this->
toolbar = $DIC->toolbar();
78 $this->ref_id = $a_ref_id;
79 $this->category_id = 0;
80 if ($this->
http->wrapper()->query()->has(
'category_id')) {
81 $this->category_id = $this->
http->wrapper()->query()->retrieve(
87 $this->repository_mode = $a_ref_id > 0;
88 if ($this->repository_mode && $this->category_id === 0) {
91 $this->category_id = is_null($category) ? 0 : $category->getCategoryID();
93 $this->
ctrl->setParameter($this,
'category_id', $this->category_id);
97 $this->
ctrl->saveParameter($this,
'backpd');
102 if ($this->category_id > 0 && $this->ref_id <= 0) {
105 $vis->forceVisibility($this->category_id);
108 } elseif ($a_ref_id > 0) {
127 if ($this->
http->wrapper()->query()->has(
'app_id')) {
128 return $this->
http->wrapper()->query()->retrieve(
138 if ($this->
http->wrapper()->query()->has(
'category_id')) {
139 return $this->
http->wrapper()->query()->retrieve(
154 if ($this->
http->wrapper()->query()->has(
'ch_user_id')) {
155 $ch_user_id = $this->
http->wrapper()->query()->retrieve(
161 foreach ($this->cats->getCategoriesInfo() as $info) {
164 $info[
"obj_id"] == $ch_user_id
166 $v = $visibility->getVisible();
167 if (!in_array($info[
"cat_id"], $v)) {
168 $v[] = $info[
"cat_id"];
170 $visibility->showSelected($v);
172 $this->
ctrl->setParameterByClass(ilCalendarMonthGUI::class,
'category_id', $info[
'cat_id']);
176 $this->
ctrl->redirectToURL(
177 $this->
ctrl->getLinkTargetByClass(\ilCalendarMonthGUI::class,
'')
186 $this->cal_view = $this->cal_settings->getDefaultCal();
187 if ($this->
http->wrapper()->query()->has(
'cal_view')) {
188 $this->cal_view = $this->
http->wrapper()->query()->retrieve(
197 $cmd = $this->
ctrl->getCmd();
202 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
209 $this->
help->setScreenIdComponent(
"cal");
211 case 'selectCHCalendarOfUser':
215 switch ($next_class) {
216 case 'ilcalendarinboxgui':
217 $this->tabs_gui->activateTab(
'cal_agenda');
222 $inbox_gui->addToolbarFileDownload();
227 case 'ilconsultationhoursgui':
228 $this->tabs_gui->activateTab(
'app_consultation_hours');
229 $this->tabs_gui->clearTargets();
232 $this->tabs_gui->setBackTarget(
233 $this->
lng->txt(
'cal_back_to_cal'),
234 $this->ctrl->getLinkTargetByClass($this->readLastClass())
242 case 'ilcalendarmonthgui':
243 $this->tabs_gui->activateTab(
'cal_agenda');
249 $month_gui->addToolbarFileDownload();
253 case 'ilcalendarweekgui':
254 $this->tabs_gui->activateTab(
'cal_agenda');
259 $week_gui->addToolbarFileDownload();
264 case 'ilcalendardaygui':
265 $this->tabs_gui->activateTab(
'cal_agenda');
270 $day_gui->addToolbarFileDownload();
274 case 'ilcalendarusersettingsgui':
275 $this->
ctrl->setReturn($this,
'');
276 $this->tabs_gui->activateTab(
'settings');
280 $this->
ctrl->forwardCommand($user_settings);
284 case 'ilcalendarappointmentgui':
285 $this->
ctrl->setReturn($this,
'');
286 $this->tabs_gui->activateTab((
string)
ilSession::get(
'cal_last_tab'));
292 case 'ilcalendarsubscriptiongui':
293 $this->
ctrl->setReturn($this,
'');
294 $this->tabs_gui->activateTab(
"cal_agenda");
297 if ($this->
http->wrapper()->query()->has(
'ref_id')) {
298 $ref_id = $this->
http->wrapper()->query()->retrieve(
304 $this->
ctrl->forwardCommand($sub);
310 case 'ilcalendarcategorygui':
311 $this->
ctrl->setReturn($this,
'');
312 $this->tabs_gui->activateTab(
"cal_manage");
314 if ($this->
ctrl->forwardCommand($category)) {
322 case 'ilcalendarblockgui':
325 $side_cal->setForceMonthView(
true);
326 $this->
ctrl->forwardCommand($side_cal);
330 case 'ilpdcalendarblockgui':
333 $side_cal->setForceMonthView(
true);
334 $this->
ctrl->forwardCommand($side_cal);
338 case 'ilpublicuserprofilegui':
339 $user_id = $this->
user->getId();
340 if ($this->
http->wrapper()->query()->has(
'user_id')) {
341 $user_id = $this->
http->wrapper()->query()->retrieve(
347 $html = $this->
ctrl->forwardCommand($user_profile);
348 $this->tpl->setContent($html);
352 $cmd = $this->
ctrl->getCmd(
"show");
376 $view_control =
$f->viewControl()->mode(
$actions,
"cal_change_calendar_view")->withActive($this->
lng->txt($a_active));
383 $extra_button_added =
false;
385 if ($this->category_id == 0 || $this->actions->checkAddEvent($this->category_id)) {
387 $extra_button_added =
true;
388 $add_button =
$f->button()->standard(
389 $this->
lng->txt(
"cal_add_appointment"),
396 if ($this->category_id > 0 && $this->actions->checkAddEvent($this->category_id)) {
397 if (!$extra_button_added) {
400 $add_button =
$f->button()->standard(
401 $this->
lng->txt(
"cal_import_appointments"),
410 if (strlen($next_class = $this->
ctrl->getNextClass())) {
414 strcasecmp($this->
ctrl->getCmdClass(), ilCalendarPresentationGUI::class) === 0 ||
415 $this->ctrl->getCmdClass() ==
''
418 $this->
ctrl->setCmdClass($cmd_class);
430 switch ($this->cal_view) {
432 $class =
"ilcalendardaygui";
435 $class =
"ilcalendarweekgui";
438 $class =
"ilcalendarmonthgui";
442 $class =
"ilcalendarinboxgui";
448 $user_pref = $this->
user->getPref(
'cal_last_class');
449 $use_pref = $user_pref && ($user_pref !==
"") && !$this->
http->wrapper()->query()->has(
'cal_view');
451 return $use_pref ? $user_pref : $class;
458 if ($this->
ctrl->getCmdClass() == strtolower(get_class($this))) {
459 $this->
ctrl->setCmdClass(strtolower($a_class));
467 case 'ilcalendarmonthgui':
468 $this->
user->writePref(
'cal_last_class', $a_class);
472 $this->
ctrl->forwardCommand($month_gui);
475 case 'ilcalendarweekgui':
476 $this->
user->writePref(
'cal_last_class', $a_class);
480 $this->
ctrl->forwardCommand($week_gui);
483 case 'ilcalendardaygui':
484 $this->
user->writePref(
'cal_last_class', $a_class);
488 $this->
ctrl->forwardCommand($day_gui);
491 case 'ilcalendarinboxgui':
492 $this->
user->writePref(
'cal_last_class', $a_class);
496 $this->
ctrl->forwardCommand($inbox_gui);
504 $tpl =
new ilTemplate(
'tpl.cal_side_block.html',
true,
true,
'Services/Calendar');
510 $side_cal->setParentGUI(
"ilCalendarPresentationGUI");
511 $side_cal->setForceMonthView(
true);
518 $this->tpl->setRightContent(
$tpl->
get());
528 $this->tabs_gui->clearTargets();
531 if ($this->
http->wrapper()->query()->has(
'backpd')) {
532 $this->tabs_gui->setBack2Target(
533 $this->
lng->txt(
'back_to_pd'),
534 $this->ctrl->getLinkTargetByClass(ilDashboardGUI::class,
'jumpToCalendar')
538 $this->tabs_gui->setBackTarget(
540 $this->
ctrl->getParentReturn($this)
542 } elseif ($this->
http->wrapper()->query()->has(
'backvm')) {
545 $this->tabs_gui->setBackTarget(
546 $this->
lng->txt(
"back"),
551 $this->tabs_gui->setBackTarget(
552 $this->
lng->txt(
"back"),
558 $this->tabs_gui->addTab(
560 $this->
lng->txt(
"cal_agenda"),
564 if ($this->actions->checkShareCal($this->category_id)) {
565 $this->tabs_gui->addTab(
567 $this->
lng->txt(
"cal_share"),
571 if ($this->actions->checkSettingsCal($this->category_id)) {
573 $this->tabs_gui->addTab(
575 $this->
lng->txt(
"settings"),
580 $this->tabs_gui->activateTab(
'cal_agenda');
591 $this->tabs_gui->clearTargets();
593 if ($this->
http->wrapper()->query()->has(
'backpd')) {
594 $this->tabs_gui->setBack2Target(
595 $this->
lng->txt(
'back_to_pd'),
596 $this->ctrl->getLinkTargetByClass(ilDashboardGUI::class,
'jumpToCalendar')
600 $this->tabs_gui->setBackTarget(
602 $this->
ctrl->getParentReturn($this)
610 $this->tabs_gui->addTab(
612 $this->
lng->txt(
'cal_agenda'),
613 $this->ctrl->getLinkTarget($this,
'')
618 $this->
ctrl->setParameterByClass(ilCalendarCategoryGUI::class,
'category_id',
$category_id);
619 $this->tabs_gui->addTab(
621 $this->
lng->txt(
'settings'),
622 $this->ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
'edit')
624 $this->
ctrl->clearParameterByClass(ilCalendarCategoryGUI::class,
'category_id');
627 $this->tabs_gui->addTab(
629 $this->
lng->txt(
"cal_agenda"),
630 $this->ctrl->getLinkTarget($this,
'')
634 $this->rbacsystem->checkAccess(
635 'add_consultation_hours',
640 $this->tabs_gui->addTab(
641 'app_consultation_hours',
642 $this->
lng->txt(
'app_consultation_hours'),
643 $this->ctrl->getLinkTargetByClass(ilConsultationHoursGUI::class,
'')
646 $this->tabs_gui->addTarget(
648 $this->
ctrl->getLinkTargetByClass(
'ilCalendarCategoryGUI',
'manage')
650 $this->tabs_gui->addTarget(
'settings', $this->
ctrl->getLinkTargetByClass(
'ilCalendarUserSettingsGUI',
''));
656 if ($this->category_id) {
663 if ($this->category_id > 0) {
673 switch ($category->getType()) {
675 $header = $this->
lng->txt(
'cal_type_personal') .
": " . $category->getTitle();
679 $header = $this->
lng->txt(
'cal_type_system') .
": " . $category->getTitle();
683 $header = $this->
lng->txt(
'cal_type_' . $category->getObjType()) .
": " . $category->getTitle();
687 $header = str_replace(
690 $this->lng->txt(
"cal_consultation_hours_for_user")
695 $header = $category->getTitle();
702 $action_menu->setAsynch(
false);
703 $action_menu->setAsynchUrl(
'');
704 $action_menu->setListTitle($this->
lng->txt(
'actions'));
705 $action_menu->setId(
'act_cal');
706 $action_menu->setSelectionHeaderClass(
'small');
707 $action_menu->setItemLinkClass(
'xsmall');
708 $action_menu->setLinksMode(
'il_ContainerItemCommand2');
710 $action_menu->setUseImages(
false);
714 $action_menu->addItem(
715 $this->
lng->txt(
"cal_ical_url"),
721 if ($this->actions->checkDeleteCal($this->category_id)) {
723 $action_menu->addItem(
724 $this->
lng->txt(
"cal_delete_cal"),
736 if ($this->
http->wrapper()->query()->has(
'seed')) {
737 $seed = $this->
http->wrapper()->query()->retrieve(
739 $this->
refinery->kindlyTo()->string()
763 $this->
ctrl->setParameter($this,
'seed', $this->seed->get(
IL_CAL_DATE));
773 $this->
ctrl->getCmdClass() ==
"ilcalendarappointmentgui" ||
774 $this->
ctrl->getCmdClass() ==
'ilconsultationhoursgui'
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 getInstance()
Get instance.
Administrate calendar appointments.
Calendar blocks, displayed in different contexts, e.g.
class for calendar categories
const MODE_PERSONAL_DESKTOP_MEMBERSHIP
const MODE_PERSONAL_DESKTOP_ITEMS
initialize(int $a_mode, int $a_source_ref_id=0, bool $a_use_cache=false, int $a_cat_id=0)
initialize visible categories
const MODE_SINGLE_CALENDAR
static _getInstance($a_usr_id=0)
get singleton instance
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Stores calendar categories.
static _getInstanceByObjId(int $a_obj_id)
get instance by obj_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...
ilCalendarSettings $cal_settings
initAppointmentIdFromQuery()
RefineryFactory $refinery
addCategoryTabs()
Add tabs for ilCategoryGUI context This cannot be done there since many views (Day Week Agenda) are i...
ilGlobalTemplateInterface $tpl
initCategoryIdFromQuery()
ilCalendarActions $actions
showViewSelection(string $a_active="cal_list")
initSeed()
init the seed date for presentations (month view, minicalendar)
getRequestedSeedAsString()
ilCalendarCategories $cats
forwardToClass(string $a_class)
initCalendarView()
Initialises calendar view according to given settings.
addStandardTabs()
add standard tabs
readLastClass()
Read last class from history.
initAndRedirectToConsultationHours()
Init and redirect to consultation hours.
Stores all calendar relevant settings.
Show calendar subscription info.
const CAL_SELECTION_MEMBERSHIP
static _getInstanceByUserId(int $a_user_id, int $a_ref_id=0)
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 _lookupFullname(int $a_user_id)
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
Calendar blocks, displayed on personal desktop.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static redirect(string $a_script)
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...
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
Returns a link target for the given information.
clearParameterByClass(string $a_class, string $a_parameter)
Removes a specific parameter of a specific class that is currently set or saved.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
Sets a parameter for the given GUI class and appends the given value as well.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setHeaderActionMenu(string $a_header)
Set header action menu.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
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 http()
Fetches the global http state from ILIAS.