6include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
104 $this->ctrl =
$DIC->ctrl();
105 $this->lng =
$DIC->language();
106 $this->lng->loadLanguageModule(
'dateplaner');
108 $this->tpl =
$DIC[
"tpl"];
109 $this->tabs_gui =
$DIC->tabs();
110 $this->
user = $DIC->user();
111 $this->rbacsystem =
$DIC->rbac()->system();
112 $this->
help = $DIC[
"ilHelp"];
113 $this->
ui = $DIC->ui();
114 $this->toolbar =
$DIC->toolbar();
115 $this->ref_id = $a_ref_id;
116 $this->category_id = (int)
$_GET[
"category_id"];
117 $this->ctrl->setParameter($this,
'category_id', $_REQUEST[
'category_id']);
121 $this->ctrl->saveParameter($this,
'backpd');
125 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
128 include_once
'./Services/Calendar/classes/class.ilCalendarUserSettings.php';
129 $this->repository_mode = $a_ref_id > 0;
131 if ($this->repository_mode && $this->category_id === 0) {
134 $this->category_id = is_null($category) ? 0 : $category->getCategoryID();
137 if ($this->category_id > 0) {
139 include_once(
"./Services/Calendar/classes/class.ilCalendarVisibility.php");
141 $vis->forceVisibility($this->category_id);
156 include_once(
"./Services/Calendar/classes/class.ilCalendarActions.php");
178 $consultation_hours_initialized =
false;
179 foreach ($this->cats->getCategoriesInfo() as $info) {
182 $info[
"obj_id"] ==
$_GET[
"ch_user_id"]
184 $v = $visibility->getVisible();
185 if (!in_array($info[
"cat_id"], $v)) {
186 $v[] = $info[
"cat_id"];
188 $visibility->showSelected($v);
190 $this->ctrl->setParameterByClass(\ilCalendarMonthGUI::class,
'seed', $this->seed);
191 $this->ctrl->redirectToURL(
192 $this->ctrl->getLinkTargetByClass(\ilCalendarMonthGUI::class,
'')
194 $consultation_hours_initialized =
true;
197 if (!$consultation_hours_initialized) {
198 $this->ctrl->redirectToURL(
199 $this->ctrl->getLinkTargetByClass(\ilCalendarMonthGUI::class,
'')
211 $request =
$DIC->http()->request();
213 if (!empty($request->getQueryParams()[
"cal_view"])) {
214 $this->cal_view = $request->getQueryParams()[
"cal_view"];
216 $this->cal_view = $this->cal_settings->getDefaultCal();
231 $cmd = $this->ctrl->getCmd();
235 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
244 $this->
help->setScreenIdComponent(
"cal");
247 case 'selectCHCalendarOfUser':
252 switch ($next_class) {
253 case 'ilcalendarinboxgui':
254 $this->tabs_gui->activateTab(
'cal_agenda');
259 $inbox_gui->addToolbarActions();
264 case 'ilconsultationhoursgui':
265 $this->tabs_gui->activateTab(
'app_consultation_hours');
266 $this->tabs_gui->clearTargets();
269 $this->tabs_gui->setBackTarget(
270 $this->lng->txt(
'cal_back_to_cal'),
271 $this->ctrl->getLinkTargetByClass($this->readLastClass())
274 include_once
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursGUI.php';
276 $this->ctrl->forwardCommand($gui);
282 case 'ilcalendarmonthgui':
283 $this->tabs_gui->activateTab(
'cal_agenda');
289 $month_gui->addToolbarActions();
293 case 'ilcalendarweekgui':
294 $this->tabs_gui->activateTab(
'cal_agenda');
299 $week_gui->addToolbarActions();
304 case 'ilcalendardaygui':
305 $this->tabs_gui->activateTab(
'cal_agenda');
310 $day_gui->addToolbarActions();
314 case 'ilcalendarusersettingsgui':
315 $this->ctrl->setReturn($this,
'');
316 $this->tabs_gui->activateTab(
'settings');
319 include_once(
'./Services/Calendar/classes/class.ilCalendarUserSettingsGUI.php');
321 $this->ctrl->forwardCommand($user_settings);
325 case 'ilcalendarappointmentgui':
326 $this->ctrl->setReturn($this,
'');
327 $this->tabs_gui->activateTab(
$_SESSION[
'cal_last_tab']);
329 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
331 $this->ctrl->forwardCommand(
$app);
334 case 'ilcalendarsubscriptiongui':
335 $this->ctrl->setReturn($this,
'');
337 $this->tabs_gui->activateTab(
"cal_agenda");
338 include_once
'./Services/Calendar/classes/class.ilCalendarSubscriptionGUI.php';
340 $this->ctrl->forwardCommand($sub);
346 case 'ilcalendarcategorygui':
347 $this->ctrl->setReturn($this,
'');
348 $this->tabs_gui->activateTab(
"cal_manage");
349 include_once(
'Services/Calendar/classes/class.ilCalendarCategoryGUI.php');
351 if ($this->ctrl->forwardCommand($category)) {
358 #$this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, ""));
366 case 'ilcalendarblockgui':
369 $side_cal->setForceMonthView(
true);
370 $this->ctrl->forwardCommand($side_cal);
374 case 'ilpdcalendarblockgui':
377 $side_cal->setForceMonthView(
true);
378 $this->ctrl->forwardCommand($side_cal);
382 case 'ilpublicuserprofilegui':
383 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
385 $html = $this->ctrl->forwardCommand($user_profile);
386 $this->tpl->setContent($html);
390 $cmd = $this->ctrl->getCmd(
"show");
417 $lng->txt(
"app_day") =>
$ctrl->getLinkTargetByClass(
'ilCalendarDayGUI',
''),
418 $lng->txt(
"app_week") =>
$ctrl->getLinkTargetByClass(
'ilCalendarWeekGUI',
''),
419 $lng->txt(
"app_month") =>
$ctrl->getLinkTargetByClass(
'ilCalendarMonthGUI',
''),
420 $lng->txt(
"cal_list") =>
$ctrl->getLinkTargetByClass(
'ilCalendarInboxGUI',
'')
423 $view_control =
$f->viewControl()->mode($actions,
"cal_change_calendar_view")->withActive(
$lng->txt($a_active));
425 $toolbar->addComponent($view_control);
427 $ctrl->setParameterByClass(
"ilcalendarappointmentgui",
"seed", $this->seed->get(
IL_CAL_DATE,
''));
428 $ctrl->setParameterByClass(
"ilcalendarappointmentgui",
"app_id",
"");
429 $ctrl->setParameterByClass(
"ilcalendarappointmentgui",
"dt",
"");
431 $extra_button_added =
false;
433 if ($this->category_id == 0 || $this->actions->checkAddEvent($this->category_id)) {
435 $extra_button_added =
true;
436 $add_button =
$f->button()->standard(
437 $lng->txt(
"cal_add_appointment"),
438 $ctrl->getLinkTargetByClass(
"ilcalendarappointmentgui",
"add")
440 $toolbar->addComponent($add_button);
444 if ($this->category_id > 0 && $this->actions->checkAddEvent($this->category_id)) {
445 if (!$extra_button_added) {
448 $ctrl->setParameterByClass(
"ilcalendarcategorygui",
"category_id", $this->category_id);
449 $add_button =
$f->button()->standard(
450 $lng->txt(
"cal_import_appointments"),
451 $ctrl->getLinkTargetByClass(
"ilcalendarcategorygui",
"importAppointments")
453 $ctrl->clearParameterByClass(
"ilcalendarcategorygui",
"category_id");
454 $toolbar->addComponent($add_button);
466 if (strlen($next_class = $this->ctrl->getNextClass())) {
469 if ($this->ctrl->getCmdClass() == strtolower(get_class($this)) or $this->ctrl->getCmdClass() ==
'') {
482 switch ($this->cal_view) {
484 $class =
"ilcalendardaygui";
487 $class =
"ilcalendarweekgui";
490 $class =
"ilcalendarmonthgui";
494 $class =
"ilcalendarinboxgui";
498 return $ilUser->getPref(
'cal_last_class') ?
$ilUser->getPref(
'cal_last_class') : $class;
506 if ($this->ctrl->getCmdClass() == strtolower(get_class($this))) {
507 $this->ctrl->setCmdClass(strtolower($a_class));
522 case 'ilcalendarmonthgui':
523 $ilUser->writePref(
'cal_last_class', $a_class);
526 include_once(
'./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
528 $this->ctrl->forwardCommand($month_gui);
532 case 'ilcalendarweekgui':
533 $ilUser->writePref(
'cal_last_class', $a_class);
536 include_once(
'./Services/Calendar/classes/class.ilCalendarWeekGUI.php');
538 $this->ctrl->forwardCommand($week_gui);
542 case 'ilcalendardaygui':
543 $ilUser->writePref(
'cal_last_class', $a_class);
546 include_once(
'./Services/Calendar/classes/class.ilCalendarDayGUI.php');
548 $this->ctrl->forwardCommand($day_gui);
552 case 'ilcalendarinboxgui':
553 $ilUser->writePref(
'cal_last_class', $a_class);
554 $_SESSION[
'cal_last_tab'] =
'cal_upcoming_events_header';
556 include_once(
'./Services/Calendar/classes/class.ilCalendarInboxGUI.php');
557 $inbox_gui =
new ilCalendarinboxGUI($this->seed);
558 $this->ctrl->forwardCommand($inbox_gui);
576 $tpl =
new ilTemplate(
'tpl.cal_side_block.html',
true,
true,
'Services/Calendar');
578 include_once(
"./Services/Calendar/classes/class.ilCalendarBlockGUI.php");
581 include_once(
"./Services/Calendar/classes/class.ilPDCalendarBlockGUI.php");
584 $side_cal->setParentGUI(
"ilCalendarPresentationGUI");
585 $side_cal->setForceMonthView(
true);
587 $tpl->setVariable(
'MINICAL', $ilCtrl->getHTML($side_cal));
589 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryGUI.php');
591 $tpl->setVariable(
'CATEGORIES', $ilCtrl->getHTML($cat));
593 $this->tpl->setRightContent(
$tpl->get());
606 $this->tabs_gui->clearTargets();
607 $ctrl->setParameterByClass(ilCalendarCategoryGUI::class,
"category_id", $_REQUEST[
"category_id"]);
609 $came_from_pd = $_REQUEST[
'backpd'];
611 $this->tabs_gui->setBack2Target(
612 $this->lng->txt(
'back_to_pd'),
613 $this->ctrl->getLinkTargetByClass(ilDashboardGUI::class,
'jumpToCalendar')
617 $this->tabs_gui->setBackTarget(
619 $this->ctrl->getParentReturn($this)
623 if (array_key_exists(
'backvm', $_REQUEST)) {
624 $this->tabs_gui->setBackTarget(
625 $this->lng->txt(
"back"),
626 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
'manage')
629 $ctrl->clearParameterByClass(ilCalendarPresentationGUI::class,
'category_id');
630 $this->tabs_gui->setBackTarget(
631 $this->lng->txt(
"back"),
632 $ctrl->getLinkTargetByClass(
'ilcalendarpresentationgui',
'')
635 $ctrl->setParameterByClass(ilCalendarPresentationGUI::class,
"category_id", $_REQUEST[
"category_id"]);
638 $this->tabs_gui->addTab(
640 $this->lng->txt(
"cal_agenda"),
641 $ctrl->getLinkTargetByClass(ilCalendarPresentationGUI::class,
"")
644 if ($this->actions->checkShareCal($this->category_id)) {
645 $this->tabs_gui->addTab(
647 $this->lng->txt(
"cal_share"),
648 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
"shareSearch")
651 if ($this->actions->checkSettingsCal($this->category_id)) {
652 $ctrl->setParameterByClass(
"ilcalendarcategorygui",
"category_id", $this->category_id);
653 $this->tabs_gui->addTab(
655 $this->lng->txt(
"settings"),
656 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
"edit")
658 $ctrl->clearParameterByClass(
"ilcalendarcategorygui",
"category_id");
661 $this->tabs_gui->activateTab(
'cal_agenda');
672 $access =
$DIC->access();
675 $came_from_pd = $_REQUEST[
'backpd'];
677 $this->tabs_gui->clearTargets();
680 $this->tabs_gui->setBack2Target(
681 $this->lng->txt(
'back_to_pd'),
682 $this->ctrl->getLinkTargetByClass(ilDashboardGUI::class,
'jumpToCalendar')
686 $this->tabs_gui->setBackTarget(
688 $this->ctrl->getParentReturn($this)
696 $this->tabs_gui->addTab(
698 $this->lng->txt(
'cal_agenda'),
699 $this->ctrl->getLinkTarget($this,
'')
703 if ($access->checkAccess(
'edit_event',
'', $this->ref_id)) {
704 $this->ctrl->setParameterByClass(ilCalendarCategoryGUI::class,
'category_id',
$category_id);
705 $this->tabs_gui->addTab(
707 $this->lng->txt(
'settings'),
708 $this->ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
'edit')
710 $this->ctrl->clearParameterByClass(ilCalendarCategoryGUI::class,
'category_id');
714 $this->tabs_gui->addTab(
716 $this->lng->txt(
"cal_agenda"),
717 $this->ctrl->getLinkTarget($this,
'')
722 'add_consultation_hours',
727 $this->tabs_gui->addTab(
728 'app_consultation_hours',
729 $this->lng->txt(
'app_consultation_hours'),
730 $this->ctrl->getLinkTargetByClass(ilConsultationHoursGUI::class,
'')
745 $this->tabs_gui->addTarget(
'cal_manage', $this->ctrl->getLinkTargetByClass(
'ilCalendarCategoryGUI',
'manage'));
746 $this->tabs_gui->addTarget(
'settings', $this->ctrl->getLinkTargetByClass(
'ilCalendarUserSettingsGUI',
''));
760 if ($this->category_id) {
769 if ($this->category_id > 0) {
781 switch ($category->getType()) {
783 $header = $this->lng->txt(
'cal_type_personal') .
": " . $category->getTitle();
787 $header = $this->lng->txt(
'cal_type_system') .
": " . $category->getTitle();
791 $header = $this->lng->txt(
'cal_type_' . $category->getObjType()) .
": " . $category->getTitle();
799 $header = $category->getTitle();
803 $tpl->setTitle($header);
806 $this->action_menu->setAsynch(
false);
807 $this->action_menu->setAsynchUrl(
'');
808 $this->action_menu->setListTitle(
$lng->txt(
'actions'));
809 $this->action_menu->setId(
'act_cal');
810 $this->action_menu->setSelectionHeaderClass(
'small');
811 $this->action_menu->setItemLinkClass(
'xsmall');
812 $this->action_menu->setLinksMode(
'il_ContainerItemCommand2');
814 $this->action_menu->setUseImages(
false);
817 $ctrl->setParameterByClass(
"ilcalendarsubscriptiongui",
"category_id", $this->category_id);
818 $this->action_menu->addItem(
$lng->txt(
"cal_ical_url"),
"",
$ctrl->getLinkTargetByClass(
"ilcalendarsubscriptiongui",
""));
821 if ($this->actions->checkDeleteCal($this->category_id)) {
822 $ctrl->setParameterByClass(
"ilcalendarcategorygui",
"category_id", $this->category_id);
823 $this->action_menu->addItem(
$lng->txt(
"cal_delete_cal"),
"",
$ctrl->getLinkTargetByClass(
"ilcalendarcategorygui",
"confirmDelete"));
826 $tpl->setHeaderActionMenu($this->action_menu->getHTML());
840 if (array_key_exists(
'seed', $_REQUEST)) {
848 $this->ctrl->setParameter($this,
'seed', $this->seed->get(
IL_CAL_DATE));
868 foreach ($cats->getCategoriesInfo() as $cat_id => $info) {
869 if ($info[
'remote']) {
874 $category->getRemoteSyncLastExecution()->isNull() ||
881 include_once
'./Services/Calendar/classes/class.ilCalendarRemoteReader.php';
883 $remote->setUser($category->getRemoteUser());
884 $remote->setPass($category->getRemotePass());
886 $remote->import($category);
897 if ($this->ctrl->getCmdClass() ==
"ilcalendarappointmentgui" || $this->ctrl->getCmdClass() ==
'ilconsultationhoursgui') {
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
static getInstance()
Get instance.
Administrate calendar appointments.
Calendar blocks, displayed in different contexts, e.g.
const MODE_PERSONAL_DESKTOP_MEMBERSHIP
const MODE_PERSONAL_DESKTOP_ITEMS
const MODE_SINGLE_CALENDAR
static _getInstance($a_usr_id=0)
get singleton instance
Administration, Side-Block presentation of calendar categories.
Stores calendar categories.
static _getInstanceByObjId($a_obj_id)
get instance by obj_id
showSideBlocks()
show side blocks
addCategoryTabs()
Add tabs for ilCategoryGUI context This cannot be done there since many views (Day Week Agenda) are i...
__construct($a_ref_id=0)
Constructor.
initSeed()
init the seed date for presentations (month view, minicalendar)
executeCommand()
Execute command.
getRepositoryMode()
Get RepositoryMode.
initCalendarView()
Initialises calendar view according to given settings.
addStandardTabs()
add standard tabs
forwardToClass($a_class)
forward to class
readLastClass()
Read last class from history.
initAndRedirectToConsultationHours()
Init and redirect to consultation hours.
showViewSelection($a_active="cal_list")
Show view selection.
getNextClass()
get next class
synchroniseExternalCalendars()
Sync external calendars.
Reader for remote ical calendars.
static _getInstance()
get singleton instance
Show calendar subscription info.
static _getInstance()
get instance for logged in user
const CAL_SELECTION_MEMBERSHIP
static _getInstanceByUserId($a_user_id, $a_ref_id=0)
get instance by user id
Consultation hours editor.
@classDescription Date and time handling
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static _lookupFullname($a_user_id)
Lookup Full Name.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
Calendar blocks, displayed on personal desktop.
GUI class for public user profile presentation.
static set($a_var, $a_val)
Set a value.
static get($a_var)
Get a value.
special template class to simplify handling of ITX/PEAR
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)