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) {
155 $v = $visibility->getVisible();
156 if (!in_array(
$info[
"cat_id"], $v)) {
157 $v[] =
$info[
"cat_id"];
159 $visibility->showSelected($v);
161 $this->ctrl->redirect($this,
"");
177 $cmd = $this->ctrl->getCmd();
181 include_once(
'./Services/Calendar/classes/class.ilCalendarSettings.php');
190 $this->help->setScreenIdComponent(
"cal");
193 case 'selectCHCalendarOfUser':
198 switch ($next_class) {
199 case 'ilcalendarinboxgui':
200 $this->tabs_gui->activateTab(
'cal_agenda');
205 $inbox_gui->addToolbarActions();
210 case 'ilconsultationhoursgui':
211 $this->tabs_gui->activateTab(
'app_consultation_hours');
212 $this->tabs_gui->clearTargets();
215 $this->tabs_gui->setBackTarget(
216 $this->lng->txt(
'cal_back_to_cal'),
217 $this->ctrl->getLinkTargetByClass($this->readLastClass())
220 include_once
'./Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursGUI.php';
222 $this->ctrl->forwardCommand($gui);
228 case 'ilcalendarmonthgui':
229 $this->tabs_gui->activateTab(
'cal_agenda');
235 $month_gui->addToolbarActions();
239 case 'ilcalendarweekgui':
240 $this->tabs_gui->activateTab(
'cal_agenda');
245 $week_gui->addToolbarActions();
250 case 'ilcalendardaygui':
251 $this->tabs_gui->activateTab(
'cal_agenda');
256 $day_gui->addToolbarActions();
260 case 'ilcalendarusersettingsgui':
261 $this->ctrl->setReturn($this,
'');
262 $this->tabs_gui->activateTab(
'settings');
265 include_once(
'./Services/Calendar/classes/class.ilCalendarUserSettingsGUI.php');
267 $this->ctrl->forwardCommand($user_settings);
271 case 'ilcalendarappointmentgui':
272 $this->ctrl->setReturn($this,
'');
273 $this->tabs_gui->activateTab(
$_SESSION[
'cal_last_tab']);
275 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
277 $this->ctrl->forwardCommand($app);
280 case 'ilcalendarsubscriptiongui':
281 $this->ctrl->setReturn($this,
'');
283 $this->tabs_gui->activateTab(
"cal_agenda");
284 include_once
'./Services/Calendar/classes/class.ilCalendarSubscriptionGUI.php';
286 $this->ctrl->forwardCommand($sub);
292 case 'ilcalendarcategorygui':
293 $this->ctrl->setReturn($this,
'');
294 $this->tabs_gui->activateTab(
"cal_manage");
295 include_once(
'Services/Calendar/classes/class.ilCalendarCategoryGUI.php');
297 if ($this->ctrl->forwardCommand($category)) {
304 #$this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, ""));
312 case 'ilcalendarblockgui':
314 $side_cal->setAvailableDetailLevels(2, 2);
316 $side_cal->setForceMonthView(
true);
317 $this->ctrl->forwardCommand($side_cal);
321 case 'ilpdcalendarblockgui':
323 $side_cal->setAvailableDetailLevels(2, 2);
325 $side_cal->setForceMonthView(
true);
326 $this->ctrl->forwardCommand($side_cal);
330 case 'ilpublicuserprofilegui':
331 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
333 $html = $this->ctrl->forwardCommand($user_profile);
334 $this->tpl->setContent(
$html);
338 $cmd = $this->ctrl->getCmd(
"show");
365 $lng->txt(
"app_day") =>
$ctrl->getLinkTargetByClass(
'ilCalendarDayGUI',
''),
366 $lng->txt(
"app_week") =>
$ctrl->getLinkTargetByClass(
'ilCalendarWeekGUI',
''),
367 $lng->txt(
"app_month") =>
$ctrl->getLinkTargetByClass(
'ilCalendarMonthGUI',
''),
368 $lng->txt(
"cal_list") =>
$ctrl->getLinkTargetByClass(
'ilCalendarInboxGUI',
'')
371 $aria_label =
$lng->txt(
"cal_change_calendar_view");
372 $view_control =
$f->viewControl()->mode($actions, $aria_label)->withActive(
$lng->txt($a_active));
374 $toolbar->addComponent($view_control);
376 $ctrl->setParameterByClass(
"ilcalendarappointmentgui",
"seed", $this->seed->get(
IL_CAL_DATE,
''));
377 $ctrl->setParameterByClass(
"ilcalendarappointmentgui",
"app_id",
"");
378 $ctrl->setParameterByClass(
"ilcalendarappointmentgui",
"dt",
"");
380 $extra_button_added =
false;
382 if ($this->category_id == 0 || $this->actions->checkAddEvent($this->category_id)) {
384 $extra_button_added =
true;
385 $add_button =
$f->button()->standard(
386 $lng->txt(
"cal_add_appointment"),
387 $ctrl->getLinkTargetByClass(
"ilcalendarappointmentgui",
"add")
389 $toolbar->addComponent($add_button);
393 if ($this->category_id > 0 && $this->actions->checkAddEvent($this->category_id)) {
394 if (!$extra_button_added) {
397 $add_button =
$f->button()->standard(
398 $lng->txt(
"cal_import_appointments"),
399 $ctrl->getLinkTargetByClass(
"ilcalendarcategorygui",
"importAppointments")
401 $toolbar->addComponent($add_button);
413 if (strlen($next_class = $this->ctrl->getNextClass())) {
416 if ($this->ctrl->getCmdClass() == strtolower(get_class($this)) or $this->ctrl->getCmdClass() ==
'') {
429 return $ilUser->getPref(
'cal_last_class') ?
$ilUser->getPref(
'cal_last_class') :
'ilcalendarinboxgui';
437 if ($this->ctrl->getCmdClass() == strtolower(get_class($this))) {
438 $this->ctrl->setCmdClass(strtolower($a_class));
453 case 'ilcalendarmonthgui':
454 $ilUser->writePref(
'cal_last_class', $a_class);
457 include_once(
'./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
459 $this->ctrl->forwardCommand($month_gui);
463 case 'ilcalendarweekgui':
464 $ilUser->writePref(
'cal_last_class', $a_class);
467 include_once(
'./Services/Calendar/classes/class.ilCalendarWeekGUI.php');
469 $this->ctrl->forwardCommand($week_gui);
473 case 'ilcalendardaygui':
474 $ilUser->writePref(
'cal_last_class', $a_class);
477 include_once(
'./Services/Calendar/classes/class.ilCalendarDayGUI.php');
479 $this->ctrl->forwardCommand($day_gui);
483 case 'ilcalendarinboxgui':
485 if ($view_option =
$_GET[
'cal_agenda_per']) {
490 $ilUser->writePref(
'cal_last_class', $a_class);
491 $_SESSION[
'cal_last_tab'] =
'cal_upcoming_events_header';
493 include_once(
'./Services/Calendar/classes/class.ilCalendarInboxGUI.php');
494 $inbox_gui =
new ilCalendarinboxGUI($this->seed);
495 $this->ctrl->forwardCommand($inbox_gui);
512 $this->ctrl->setCmd(
'');
513 $history =
$ilUser->getPref(
'cal_last_class') ?
$ilUser->getPref(
'cal_last_class') :
'ilcalendarmonthgui';
529 $tpl =
new ilTemplate(
'tpl.cal_side_block.html',
true,
true,
'Services/Calendar');
531 include_once(
"./Services/Calendar/classes/class.ilCalendarBlockGUI.php");
534 include_once(
"./Services/Calendar/classes/class.ilPDCalendarBlockGUI.php");
537 $side_cal->setAvailableDetailLevels(2, 2);
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());
573 $this->tabs_gui->clearTargets();
574 $ctrl->setParameterByClass(ilCalendarCategoryGUI::class,
"category_id", $_REQUEST[
"category_id"]);
576 $came_from_pd = $_REQUEST[
'backpd'];
578 $this->tabs_gui->setBack2Target(
579 $this->lng->txt(
'back_to_pd'),
580 $this->ctrl->getLinkTargetByClass(ilPersonalDesktopGUI::class,
'jumpToCalendar')
584 $this->tabs_gui->setBackTarget(
586 $this->ctrl->getParentReturn($this)
590 if (array_key_exists(
'backvm', $_REQUEST)) {
591 $this->tabs_gui->setBackTarget(
592 $this->lng->txt(
"back"),
593 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
'manage')
596 $ctrl->clearParameterByClass(ilCalendarPresentationGUI::class,
'category_id');
597 $this->tabs_gui->setBackTarget(
598 $this->lng->txt(
"back"),
599 $ctrl->getLinkTargetByClass(
'ilcalendarpresentationgui',
'')
602 $ctrl->setParameterByClass(ilCalendarPresentationGUI::class,
"category_id", $_REQUEST[
"category_id"]);
605 $this->tabs_gui->addTab(
607 $this->lng->txt(
"cal_agenda"),
608 $ctrl->getLinkTargetByClass(ilCalendarPresentationGUI::class,
"")
611 if ($this->actions->checkShareCal($this->category_id)) {
612 $this->tabs_gui->addTab(
614 $this->lng->txt(
"cal_share"),
615 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
"shareSearch")
618 if ($this->actions->checkSettingsCal($this->category_id)) {
619 $this->tabs_gui->addTab(
621 $this->lng->txt(
"settings"),
622 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
"edit")
626 $this->tabs_gui->activateTab(
'cal_agenda');
637 $access =
$DIC->access();
640 $came_from_pd = $_REQUEST[
'backpd'];
642 $this->tabs_gui->clearTargets();
645 $this->tabs_gui->setBack2Target(
646 $this->lng->txt(
'back_to_pd'),
647 $this->ctrl->getLinkTargetByClass(ilPersonalDesktopGUI::class,
'jumpToCalendar')
651 $this->tabs_gui->setBackTarget(
653 $this->ctrl->getParentReturn($this)
658 $category_id = $category->getCategoryID();
661 $this->tabs_gui->addTab(
663 $this->lng->txt(
'cal_agenda'),
664 $this->ctrl->getLinkTarget($this,
'')
668 if ($access->checkAccess(
'edit_event',
'', $this->ref_id)) {
669 $this->ctrl->setParameterByClass(ilCalendarCategoryGUI::class,
'category_id', $category_id);
670 $this->tabs_gui->addTab(
672 $this->lng->txt(
'settings'),
673 $this->ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class,
'edit')
675 $this->ctrl->clearParameterByClass(ilCalendarCategoryGUI::class,
'category_id');
679 $this->tabs_gui->addTab(
681 $this->lng->txt(
"cal_agenda"),
682 $this->ctrl->getLinkTarget($this,
'')
687 'add_consultation_hours',
692 $this->tabs_gui->addTab(
693 'app_consultation_hours',
694 $this->lng->txt(
'app_consultation_hours'),
695 $this->ctrl->getLinkTargetByClass(ilConsultationHoursGUI::class,
'')
710 $this->tabs_gui->addTarget(
'cal_manage', $this->ctrl->getLinkTargetByClass(
'ilCalendarCategoryGUI',
'manage'));
711 $this->tabs_gui->addTarget(
'settings', $this->ctrl->getLinkTargetByClass(
'ilCalendarUserSettingsGUI',
''));
725 if ($this->category_id) {
734 if ($this->category_id > 0) {
746 switch ($category->getType()) {
748 $header = $this->lng->txt(
'cal_type_personal') .
": " . $category->getTitle();
752 $header = $this->lng->txt(
'cal_type_system') .
": " . $category->getTitle();
756 $header = $this->lng->txt(
'cal_type_' . $category->getObjType()) .
": " . $category->getTitle();
764 $header = $category->getTitle();
771 $this->action_menu->setAsynch(
false);
772 $this->action_menu->setAsynchUrl(
'');
773 $this->action_menu->setListTitle(
$lng->txt(
'actions'));
774 $this->action_menu->setId(
'act_cal');
775 $this->action_menu->setSelectionHeaderClass(
'small');
776 $this->action_menu->setItemLinkClass(
'xsmall');
777 $this->action_menu->setLinksMode(
'il_ContainerItemCommand2');
779 $this->action_menu->setUseImages(
false);
782 $ctrl->setParameterByClass(
"ilcalendarsubscriptiongui",
"category_id", $this->category_id);
783 $this->action_menu->addItem(
$lng->txt(
"cal_ical_url"),
"",
$ctrl->getLinkTargetByClass(
"ilcalendarsubscriptiongui",
""));
786 if ($this->actions->checkDeleteCal($this->category_id)) {
787 $ctrl->setParameterByClass(
"ilcalendarcategorygui",
"category_id", $this->category_id);
788 $this->action_menu->addItem(
$lng->txt(
"cal_delete_cal"),
"",
$ctrl->getLinkTargetByClass(
"ilcalendarcategorygui",
"confirmDelete"));
791 $tpl->setHeaderActionMenu($this->action_menu->getHTML());
805 if (array_key_exists(
'seed', $_REQUEST)) {
813 $this->ctrl->setParameter($this,
'seed', $this->seed->get(
IL_CAL_DATE));
833 foreach ($cats->getCategoriesInfo() as $cat_id =>
$info) {
834 if (
$info[
'remote']) {
843 include_once
'./Services/Calendar/classes/class.ilCalendarRemoteReader.php';
845 $remote->setUser($category->getRemoteUser());
846 $remote->setPass($category->getRemotePass());
848 $remote->import($category);
859 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 getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
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)
if(!empty($this->data['faventry'])) $tabs