6include_once
'./Services/Calendar/classes/class.ilCalendarSettings.php';
84 $this->ctrl =
$DIC->ctrl();
85 $this->lng =
$DIC->language();
86 $this->lng->loadLanguageModule(
'dateplaner');
88 $this->tpl =
$DIC[
"tpl"];
89 $this->tabs_gui =
$DIC->tabs();
90 $this->
user = $DIC->user();
91 $this->rbacsystem =
$DIC->rbac()->system();
92 $this->
help = $DIC[
"ilHelp"];
93 $this->
ui = $DIC->ui();
94 $this->toolbar =
$DIC->toolbar();
95 $this->ref_id = $a_ref_id;
96 $this->category_id =
$_GET[
"category_id"];
97 $this->ctrl->setParameter($this,
'category_id', $_REQUEST[
'category_id']);
100 $this->ctrl->saveParameter($this,
'backpd');
102 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
105 include_once
'./Services/Calendar/classes/class.ilCalendarUserSettings.php';
107 $this->repository_mode =
true;
109 if ($this->category_id > 0) {
111 include_once(
"./Services/Calendar/classes/class.ilCalendarVisibility.php");
113 $vis->forceVisibility($this->category_id);
128 include_once(
"./Services/Calendar/classes/class.ilCalendarActions.php");
150 foreach ($this->cats->getCategoriesInfo() as $info) {
153 $info[
"obj_id"] ==
$_GET[
"ch_user_id"]
155 $v = $visibility->getVisible();
156 if (!in_array($info[
"cat_id"], $v)) {
157 $v[] = $info[
"cat_id"];
159 $visibility->showSelected($v);
161 $this->ctrl->setParameterByClass(\ilCalendarMonthGUI::class,
'seed' , $this->seed);
162 $this->ctrl->redirectToURL(
163 $this->ctrl->getLinkTargetByClass(\ilCalendarMonthGUI::class,
'')
180 $cmd = $this->ctrl->getCmd();
184 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
193 $this->
help->setScreenIdComponent(
"cal");
196 case 'selectCHCalendarOfUser':
201 switch ($next_class) {
202 case 'ilcalendarinboxgui':
203 $this->tabs_gui->activateTab(
'cal_agenda');
208 $inbox_gui->addToolbarActions();
213 case 'ilconsultationhoursgui':
214 $this->tabs_gui->activateTab(
'app_consultation_hours');
215 $this->tabs_gui->clearTargets();
218 $this->tabs_gui->setBackTarget(
219 $this->lng->txt(
'cal_back_to_cal'),
220 $this->ctrl->getLinkTargetByClass($this->readLastClass())
223 include_once
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursGUI.php';
225 $this->ctrl->forwardCommand($gui);
231 case 'ilcalendarmonthgui':
232 $this->tabs_gui->activateTab(
'cal_agenda');
238 $month_gui->addToolbarActions();
242 case 'ilcalendarweekgui':
243 $this->tabs_gui->activateTab(
'cal_agenda');
248 $week_gui->addToolbarActions();
253 case 'ilcalendardaygui':
254 $this->tabs_gui->activateTab(
'cal_agenda');
259 $day_gui->addToolbarActions();
263 case 'ilcalendarusersettingsgui':
264 $this->ctrl->setReturn($this,
'');
265 $this->tabs_gui->activateTab(
'settings');
268 include_once(
'./Services/Calendar/classes/class.ilCalendarUserSettingsGUI.php');
270 $this->ctrl->forwardCommand($user_settings);
274 case 'ilcalendarappointmentgui':
275 $this->ctrl->setReturn($this,
'');
276 $this->tabs_gui->activateTab(
$_SESSION[
'cal_last_tab']);
278 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
280 $this->ctrl->forwardCommand(
$app);
283 case 'ilcalendarsubscriptiongui':
284 $this->ctrl->setReturn($this,
'');
286 $this->tabs_gui->activateTab(
"cal_agenda");
287 include_once
'./Services/Calendar/classes/class.ilCalendarSubscriptionGUI.php';
289 $this->ctrl->forwardCommand($sub);
295 case 'ilcalendarcategorygui':
296 $this->ctrl->setReturn($this,
'');
297 $this->tabs_gui->activateTab(
"cal_manage");
298 include_once(
'Services/Calendar/classes/class.ilCalendarCategoryGUI.php');
300 if ($this->ctrl->forwardCommand($category)) {
307 #$this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, ""));
315 case 'ilcalendarblockgui':
318 $side_cal->setForceMonthView(
true);
319 $this->ctrl->forwardCommand($side_cal);
323 case 'ilpdcalendarblockgui':
326 $side_cal->setForceMonthView(
true);
327 $this->ctrl->forwardCommand($side_cal);
331 case 'ilpublicuserprofilegui':
332 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
334 $html = $this->ctrl->forwardCommand($user_profile);
335 $this->tpl->setContent($html);
339 $cmd = $this->ctrl->getCmd(
"show");
366 $lng->txt(
"app_day") =>
$ctrl->getLinkTargetByClass(
'ilCalendarDayGUI',
''),
367 $lng->txt(
"app_week") =>
$ctrl->getLinkTargetByClass(
'ilCalendarWeekGUI',
''),
368 $lng->txt(
"app_month") =>
$ctrl->getLinkTargetByClass(
'ilCalendarMonthGUI',
''),
369 $lng->txt(
"cal_list") =>
$ctrl->getLinkTargetByClass(
'ilCalendarInboxGUI',
'')
372 $aria_label =
$lng->txt(
"cal_change_calendar_view");
373 $view_control =
$f->viewControl()->mode($actions, $aria_label)->withActive(
$lng->txt($a_active));
375 $toolbar->addComponent($view_control);
377 $ctrl->setParameterByClass(
"ilcalendarappointmentgui",
"seed", $this->seed->get(
IL_CAL_DATE,
''));
378 $ctrl->setParameterByClass(
"ilcalendarappointmentgui",
"app_id",
"");
379 $ctrl->setParameterByClass(
"ilcalendarappointmentgui",
"dt",
"");
381 $extra_button_added =
false;
383 if ($this->category_id == 0 || $this->actions->checkAddEvent($this->category_id)) {
385 $extra_button_added =
true;
386 $add_button =
$f->button()->standard(
387 $lng->txt(
"cal_add_appointment"),
388 $ctrl->getLinkTargetByClass(
"ilcalendarappointmentgui",
"add")
390 $toolbar->addComponent($add_button);
394 if ($this->category_id > 0 && $this->actions->checkAddEvent($this->category_id)) {
395 if (!$extra_button_added) {
398 $add_button =
$f->button()->standard(
399 $lng->txt(
"cal_import_appointments"),
400 $ctrl->getLinkTargetByClass(
"ilcalendarcategorygui",
"importAppointments")
402 $toolbar->addComponent($add_button);
414 if (strlen($next_class = $this->ctrl->getNextClass())) {
417 if ($this->ctrl->getCmdClass() == strtolower(get_class($this)) or $this->ctrl->getCmdClass() ==
'') {
430 return $ilUser->getPref(
'cal_last_class') ?
$ilUser->getPref(
'cal_last_class') :
'ilcalendarinboxgui';
438 if ($this->ctrl->getCmdClass() == strtolower(get_class($this))) {
439 $this->ctrl->setCmdClass(strtolower($a_class));
454 case 'ilcalendarmonthgui':
455 $ilUser->writePref(
'cal_last_class', $a_class);
458 include_once(
'./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
460 $this->ctrl->forwardCommand($month_gui);
464 case 'ilcalendarweekgui':
465 $ilUser->writePref(
'cal_last_class', $a_class);
468 include_once(
'./Services/Calendar/classes/class.ilCalendarWeekGUI.php');
470 $this->ctrl->forwardCommand($week_gui);
474 case 'ilcalendardaygui':
475 $ilUser->writePref(
'cal_last_class', $a_class);
478 include_once(
'./Services/Calendar/classes/class.ilCalendarDayGUI.php');
480 $this->ctrl->forwardCommand($day_gui);
484 case 'ilcalendarinboxgui':
486 if ($view_option =
$_GET[
'cal_agenda_per']) {
491 $ilUser->writePref(
'cal_last_class', $a_class);
492 $_SESSION[
'cal_last_tab'] =
'cal_upcoming_events_header';
494 include_once(
'./Services/Calendar/classes/class.ilCalendarInboxGUI.php');
495 $inbox_gui =
new ilCalendarinboxGUI($this->seed);
496 $this->ctrl->forwardCommand($inbox_gui);
513 $this->ctrl->setCmd(
'');
514 $history =
$ilUser->getPref(
'cal_last_class') ?
$ilUser->getPref(
'cal_last_class') :
'ilcalendarmonthgui';
530 $tpl =
new ilTemplate(
'tpl.cal_side_block.html',
true,
true,
'Services/Calendar');
532 include_once(
"./Services/Calendar/classes/class.ilCalendarBlockGUI.php");
535 include_once(
"./Services/Calendar/classes/class.ilPDCalendarBlockGUI.php");
538 $side_cal->setParentGUI(
"ilCalendarPresentationGUI");
539 $side_cal->setForceMonthView(
true);
541 $tpl->setVariable(
'MINICAL',
$ilCtrl->getHTML($side_cal));
543 include_once(
'./Services/Calendar/classes/class.ilCalendarCategoryGUI.php');
545 $tpl->setVariable(
'CATEGORIES',
$ilCtrl->getHTML($cat));
547 $this->tpl->setRightContent(
$tpl->get());
560 $this->tabs_gui->clearTargets();
561 $ctrl->setParameterByClass(ilCalendarCategoryGUI::class,
"category_id", $_REQUEST[
"category_id"]);
563 $came_from_pd = $_REQUEST[
'backpd'];
565 $this->tabs_gui->setBack2Target(
566 $this->lng->txt(
'back_to_pd'),
567 $this->ctrl->getLinkTargetByClass(ilDashboardGUI::class,
'jumpToCalendar')
571 $this->tabs_gui->setBackTarget(
573 $this->ctrl->getParentReturn($this)
577 if (array_key_exists(
'backvm', $_REQUEST)) {
578 $this->tabs_gui->setBackTarget(
579 $this->lng->txt(
"back"),
580 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
'manage')
583 $ctrl->clearParameterByClass(ilCalendarPresentationGUI::class,
'category_id');
584 $this->tabs_gui->setBackTarget(
585 $this->lng->txt(
"back"),
586 $ctrl->getLinkTargetByClass(
'ilcalendarpresentationgui',
'')
589 $ctrl->setParameterByClass(ilCalendarPresentationGUI::class,
"category_id", $_REQUEST[
"category_id"]);
592 $this->tabs_gui->addTab(
594 $this->lng->txt(
"cal_agenda"),
595 $ctrl->getLinkTargetByClass(ilCalendarPresentationGUI::class,
"")
598 if ($this->actions->checkShareCal($this->category_id)) {
599 $this->tabs_gui->addTab(
601 $this->lng->txt(
"cal_share"),
602 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
"shareSearch")
605 if ($this->actions->checkSettingsCal($this->category_id)) {
606 $this->tabs_gui->addTab(
608 $this->lng->txt(
"settings"),
609 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
"edit")
613 $this->tabs_gui->activateTab(
'cal_agenda');
624 $access =
$DIC->access();
627 $came_from_pd = $_REQUEST[
'backpd'];
629 $this->tabs_gui->clearTargets();
632 $this->tabs_gui->setBack2Target(
633 $this->lng->txt(
'back_to_pd'),
634 $this->ctrl->getLinkTargetByClass(ilDashboardGUI::class,
'jumpToCalendar')
638 $this->tabs_gui->setBackTarget(
640 $this->ctrl->getParentReturn($this)
645 $category_id = $category->getCategoryID();
648 $this->tabs_gui->addTab(
650 $this->lng->txt(
'cal_agenda'),
651 $this->ctrl->getLinkTarget($this,
'')
655 if ($access->checkAccess(
'edit_event',
'', $this->ref_id)) {
656 $this->ctrl->setParameterByClass(ilCalendarCategoryGUI::class,
'category_id', $category_id);
657 $this->tabs_gui->addTab(
659 $this->lng->txt(
'settings'),
660 $this->ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
'edit')
662 $this->ctrl->clearParameterByClass(ilCalendarCategoryGUI::class,
'category_id');
666 $this->tabs_gui->addTab(
668 $this->lng->txt(
"cal_agenda"),
669 $this->ctrl->getLinkTarget($this,
'')
674 'add_consultation_hours',
679 $this->tabs_gui->addTab(
680 'app_consultation_hours',
681 $this->lng->txt(
'app_consultation_hours'),
682 $this->ctrl->getLinkTargetByClass(ilConsultationHoursGUI::class,
'')
697 $this->tabs_gui->addTarget(
'cal_manage', $this->ctrl->getLinkTargetByClass(
'ilCalendarCategoryGUI',
'manage'));
698 $this->tabs_gui->addTarget(
'settings', $this->ctrl->getLinkTargetByClass(
'ilCalendarUserSettingsGUI',
''));
712 if ($this->category_id) {
721 if ($this->category_id > 0) {
733 switch ($category->getType()) {
735 $header = $this->lng->txt(
'cal_type_personal') .
": " . $category->getTitle();
739 $header = $this->lng->txt(
'cal_type_system') .
": " . $category->getTitle();
743 $header = $this->lng->txt(
'cal_type_' . $category->getObjType()) .
": " . $category->getTitle();
751 $header = $category->getTitle();
755 $tpl->setTitle($header);
758 $this->action_menu->setAsynch(
false);
759 $this->action_menu->setAsynchUrl(
'');
760 $this->action_menu->setListTitle(
$lng->txt(
'actions'));
761 $this->action_menu->setId(
'act_cal');
762 $this->action_menu->setSelectionHeaderClass(
'small');
763 $this->action_menu->setItemLinkClass(
'xsmall');
764 $this->action_menu->setLinksMode(
'il_ContainerItemCommand2');
766 $this->action_menu->setUseImages(
false);
769 $ctrl->setParameterByClass(
"ilcalendarsubscriptiongui",
"category_id", $this->category_id);
770 $this->action_menu->addItem(
$lng->txt(
"cal_ical_url"),
"",
$ctrl->getLinkTargetByClass(
"ilcalendarsubscriptiongui",
""));
773 if ($this->actions->checkDeleteCal($this->category_id)) {
774 $ctrl->setParameterByClass(
"ilcalendarcategorygui",
"category_id", $this->category_id);
775 $this->action_menu->addItem(
$lng->txt(
"cal_delete_cal"),
"",
$ctrl->getLinkTargetByClass(
"ilcalendarcategorygui",
"confirmDelete"));
778 $tpl->setHeaderActionMenu($this->action_menu->getHTML());
792 if (array_key_exists(
'seed', $_REQUEST)) {
800 $this->ctrl->setParameter($this,
'seed', $this->seed->get(
IL_CAL_DATE));
820 foreach ($cats->getCategoriesInfo() as $cat_id => $info) {
821 if ($info[
'remote']) {
826 $category->getRemoteSyncLastExecution()->isNull() ||
833 include_once
'./Services/Calendar/classes/class.ilCalendarRemoteReader.php';
835 $remote->setUser($category->getRemoteUser());
836 $remote->setPass($category->getRemotePass());
838 $remote->import($category);
849 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
loadHistory()
forward to last presentation class
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.
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)