ILIAS  release_8 Revision v8.24
ilCalendarPresentationGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilCalendarPresentationGUI:

Public Member Functions

 __construct ($a_ref_id=0)
 
 getRepositoryMode ()
 
 executeCommand ()
 
 showViewSelection (string $a_active="cal_list")
 
 getNextClass ()
 
 readLastClass ()
 Read last class from history. More...
 
 setCmdClass ($a_class)
 
 initSeed ()
 init the seed date for presentations (month view, minicalendar) More...
 
 showToolbarAndSidebar ()
 

Protected Member Functions

 initAppointmentIdFromQuery ()
 
 initCategoryIdFromQuery ()
 
 initAndRedirectToConsultationHours ()
 Init and redirect to consultation hours. More...
 
 initCalendarView ()
 Initialises calendar view according to given settings. More...
 
 forwardToClass (string $a_class)
 
 showSideBlocks ()
 
 addCategoryTabs ()
 Add tabs for ilCategoryGUI context This cannot be done there since many views (Day Week Agenda) are initiated from these view. More...
 
 addStandardTabs ()
 add standard tabs More...
 
 prepareOutput ()
 
 getRequestedSeedAsString ()
 

Protected Attributes

ilCtrlInterface $ctrl
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs_gui
 
ilObjUser $user
 
ilHelpGUI $help
 
ilRbacSystem $rbacsystem
 
ILIAS DI UIServices $ui
 
ilToolbarGUI $toolbar
 
ilAccessHandler $access
 
HttpServices $http
 
RefineryFactory $refinery
 
ilCalendarSettings $cal_settings
 
ilCalendarActions $actions
 
ilCalendarCategories $cats
 
bool $repository_mode = false
 
int $ref_id = 0
 
int $category_id = 0
 
ilDate $seed = null
 
int $cal_view = 0
 
int $cal_period = 0
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$ @ilCtrl_Calls ilCalendarPresentationGUI: ilCalendarMonthGUI, ilCalendarUserSettingsGUI, ilCalendarCategoryGUI, ilCalendarWeekGUI @ilCtrl_Calls ilCalendarPresentationGUI: ilCalendarAppointmentGUI, ilCalendarDayGUI, ilCalendarInboxGUI, ilCalendarSubscriptionGUI @ilCtrl_Calls ilCalendarPresentationGUI: ilConsultationHoursGUI, ilCalendarBlockGUI, ilPDCalendarBlockGUI, ilPublicUserProfileGUI

Definition at line 33 of file class.ilCalendarPresentationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarPresentationGUI::__construct (   $a_ref_id = 0)

Definition at line 60 of file class.ilCalendarPresentationGUI.php.

61 {
62 global $DIC;
63
64 $this->ctrl = $DIC->ctrl();
65 $this->lng = $DIC->language();
66 $this->lng->loadLanguageModule('dateplaner');
67
68 $this->http = $DIC->http();
69 $this->refinery = $DIC->refinery();
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(
82 'category_id',
83 $this->refinery->kindlyTo()->int()
84 );
85 }
86
87 $this->repository_mode = $a_ref_id > 0;
88 if ($this->repository_mode && $this->category_id === 0) {
89 $obj_id = ilObject::_lookupObjId($this->ref_id);
90 $category = ilCalendarCategory::_getInstanceByObjId($obj_id);
91 $this->category_id = is_null($category) ? 0 : $category->getCategoryID();
92 }
93 $this->ctrl->setParameter($this, 'category_id', $this->category_id);
94 $this->cal_settings = ilCalendarSettings::_getInstance();
95
96 // show back to pd
97 $this->ctrl->saveParameter($this, 'backpd');
98
99 $this->initCalendarView();
101
102 if ($this->category_id > 0 && $this->ref_id <= 0) { // single calendar view
103 // ensure activation of this category
104 $vis = ilCalendarVisibility::_getInstanceByUserId($this->user->getId(), $a_ref_id);
105 $vis->forceVisibility($this->category_id);
106
107 $cats->initialize(ilCalendarCategories::MODE_SINGLE_CALENDAR, 0, false, $this->category_id);
108 } elseif ($a_ref_id > 0) {
112 } else {
114 }
115
116 $this->actions = ilCalendarActions::getInstance();
117 $this->cats = $cats;
118 }
static getInstance()
Get instance.
initialize(int $a_mode, int $a_source_ref_id=0, bool $a_use_cache=false, int $a_cat_id=0)
initialize visible categories
static _getInstance($a_usr_id=0)
get singleton instance
static _getInstanceByObjId(int $a_obj_id)
get instance by obj_id
initCalendarView()
Initialises calendar view according to given settings.
static _getInstanceByUserId(int $a_user_id, int $a_ref_id=0)
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.

References $cats, $DIC, ilCalendarCategories\_getInstance(), ilCalendarSettings\_getInstance(), ilCalendarUserSettings\_getInstance(), ilCalendarCategory\_getInstanceByObjId(), ilCalendarVisibility\_getInstanceByUserId(), ilObject\_lookupObjId(), ILIAS\Repository\access(), ilCalendarUserSettings\CAL_SELECTION_MEMBERSHIP, ILIAS\Repository\ctrl(), ilCalendarActions\getInstance(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), initCalendarView(), ilCalendarCategories\initialize(), ILIAS\Repository\lng(), ilCalendarCategories\MODE_PERSONAL_DESKTOP_ITEMS, ilCalendarCategories\MODE_PERSONAL_DESKTOP_MEMBERSHIP, ilCalendarCategories\MODE_REPOSITORY, ilCalendarCategories\MODE_SINGLE_CALENDAR, ILIAS\Repository\refinery(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addCategoryTabs()

ilCalendarPresentationGUI::addCategoryTabs ( )
protected

Add tabs for ilCategoryGUI context This cannot be done there since many views (Day Week Agenda) are initiated from these view.

Definition at line 525 of file class.ilCalendarPresentationGUI.php.

525 : void
526 {
528 $this->tabs_gui->clearTargets();
529 $ctrl->setParameterByClass(ilCalendarCategoryGUI::class, "category_id", $this->initCategoryIdFromQuery());
530 if ($this->getRepositoryMode()) {
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')
535 );
536 }
537 $label = $this->lng->txt('back_to_' . ilObject::_lookupType($this->ref_id, true));
538 $this->tabs_gui->setBackTarget(
539 $label,
540 $this->ctrl->getParentReturn($this)
541 );
542 } elseif ($this->http->wrapper()->query()->has('backvm')) {
543
544 // no object calendar => back is back to manage view
545 $this->tabs_gui->setBackTarget(
546 $this->lng->txt("back"),
547 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class, 'manage')
548 );
549 } else {
550 $ctrl->clearParameterByClass(ilCalendarPresentationGUI::class, 'category_id');
551 $this->tabs_gui->setBackTarget(
552 $this->lng->txt("back"),
553 $ctrl->getLinkTargetByClass('ilcalendarpresentationgui', '')
554 );
555 $ctrl->setParameterByClass(ilCalendarPresentationGUI::class, "category_id", $this->initCategoryIdFromQuery());
556 }
557
558 $this->tabs_gui->addTab(
559 "cal_agenda",
560 $this->lng->txt("cal_agenda"),
561 $ctrl->getLinkTargetByClass(ilCalendarPresentationGUI::class, "")
562 );
563
564 if ($this->actions->checkShareCal($this->category_id)) {
565 $this->tabs_gui->addTab(
566 "share",
567 $this->lng->txt("cal_share"),
568 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class, "shareSearch")
569 );
570 }
571 if ($this->actions->checkSettingsCal($this->category_id)) {
572 $ctrl->setParameterByClass(ilCalendarCategoryGUI::class, 'category_id', $this->category_id);
573 $this->tabs_gui->addTab(
574 "edit",
575 $this->lng->txt("settings"),
576 $ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class, "edit")
577 );
578 $ctrl->clearParameterByClass(ilCalendarCategoryGUI::class, 'category_id');
579 }
580 $this->tabs_gui->activateTab('cal_agenda');
581 }
static _lookupType(int $id, bool $reference=false)
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.

References $ctrl, ilObject\_lookupType(), ilCtrlInterface\clearParameterByClass(), ILIAS\Repository\ctrl(), ilCtrlInterface\getLinkTargetByClass(), getRepositoryMode(), ILIAS\FileDelivery\http(), initCategoryIdFromQuery(), ILIAS\Repository\lng(), and ilCtrlInterface\setParameterByClass().

Referenced by prepareOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addStandardTabs()

ilCalendarPresentationGUI::addStandardTabs ( )
protected

add standard tabs

Definition at line 586 of file class.ilCalendarPresentationGUI.php.

586 : void
587 {
590
591 $this->tabs_gui->clearTargets();
592 if ($this->getRepositoryMode()) {
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')
597 );
598 }
599 $label = $this->lng->txt('back_to_' . ilObject::_lookupType($this->ref_id, true));
600 $this->tabs_gui->setBackTarget(
601 $label,
602 $this->ctrl->getParentReturn($this)
603 );
604
605 $obj_id = ilObject::_lookupObjId($this->ref_id);
606 $category = ilCalendarCategory::_getInstanceByObjId($obj_id);
607 $category_id = $category->getCategoryID();
608
609 // agenda tab
610 $this->tabs_gui->addTab(
611 'cal_agenda',
612 $this->lng->txt('cal_agenda'),
613 $this->ctrl->getLinkTarget($this, '')
614 );
615
616 // settings tab
617 if ($access->checkAccess('edit_event', '', $this->ref_id)) {
618 $this->ctrl->setParameterByClass(ilCalendarCategoryGUI::class, 'category_id', $category_id);
619 $this->tabs_gui->addTab(
620 'cal_manage',
621 $this->lng->txt('settings'),
622 $this->ctrl->getLinkTargetByClass(ilCalendarCategoryGUI::class, 'edit')
623 );
624 $this->ctrl->clearParameterByClass(ilCalendarCategoryGUI::class, 'category_id');
625 }
626 } else {
627 $this->tabs_gui->addTab(
628 'cal_agenda',
629 $this->lng->txt("cal_agenda"),
630 $this->ctrl->getLinkTarget($this, '')
631 );
632
633 if (
634 $this->rbacsystem->checkAccess(
635 'add_consultation_hours',
636 ilCalendarSettings::_getInstance()->getCalendarSettingsId()
637 ) &&
638 ilCalendarSettings::_getInstance()->areConsultationHoursEnabled()
639 ) {
640 $this->tabs_gui->addTab(
641 'app_consultation_hours',
642 $this->lng->txt('app_consultation_hours'),
643 $this->ctrl->getLinkTargetByClass(ilConsultationHoursGUI::class, '')
644 );
645 }
646 $this->tabs_gui->addTarget(
647 'cal_manage',
648 $this->ctrl->getLinkTargetByClass('ilCalendarCategoryGUI', 'manage')
649 );
650 $this->tabs_gui->addTarget('settings', $this->ctrl->getLinkTargetByClass('ilCalendarUserSettingsGUI', ''));
651 }
652 }
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)

References $access, $category_id, $rbacsystem, ilCalendarSettings\_getInstance(), ilCalendarCategory\_getInstanceByObjId(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilRBACAccessHandler\checkAccess(), ILIAS\Repository\ctrl(), getRepositoryMode(), ILIAS\FileDelivery\http(), and ILIAS\Repository\lng().

Referenced by prepareOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilCalendarPresentationGUI::executeCommand ( )

Definition at line 195 of file class.ilCalendarPresentationGUI.php.

195 : void
196 {
197 $cmd = $this->ctrl->getCmd();
198 // now next class is not empty, which breaks old consultation hour implementation
199 $next_class = $this->getNextClass();
200
201 if (!ilCalendarSettings::_getInstance()->isEnabled()) {
202 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
203 ilUtil::redirect('ilias.php?baseClass=ilDashboardGUI');
204 }
205
206 $this->initSeed();
207 $this->prepareOutput();
208
209 $this->help->setScreenIdComponent("cal");
210 switch ($cmd) {
211 case 'selectCHCalendarOfUser':
213 break;
214 }
215 switch ($next_class) {
216 case 'ilcalendarinboxgui':
217 $this->tabs_gui->activateTab('cal_agenda');
218 $inbox_gui = $this->forwardToClass('ilcalendarinboxgui');
219 if ($this->showToolbarAndSidebar()) {
220 $this->showViewSelection("cal_list");
221 $this->showSideBlocks();
222 $inbox_gui->addToolbarFileDownload();
223 }
224
225 break;
226
227 case 'ilconsultationhoursgui':
228 $this->tabs_gui->activateTab('app_consultation_hours');
229 $this->tabs_gui->clearTargets();
230
231 // No side blocks
232 $this->tabs_gui->setBackTarget(
233 $this->lng->txt('cal_back_to_cal'),
234 $this->ctrl->getLinkTargetByClass($this->readLastClass())
235 );
236 $this->ctrl->forwardCommand(new ilConsultationHoursGUI());
237 if ($this->showToolbarAndSidebar()) {
238 $this->showSideBlocks();
239 }
240 return;
241
242 case 'ilcalendarmonthgui':
243 $this->tabs_gui->activateTab('cal_agenda');
244 $month_gui = $this->forwardToClass('ilcalendarmonthgui');
245
246 if ($this->showToolbarAndSidebar()) {
247 $this->showViewSelection("app_month");
248 $this->showSideBlocks();
249 $month_gui->addToolbarFileDownload();
250 }
251 break;
252
253 case 'ilcalendarweekgui':
254 $this->tabs_gui->activateTab('cal_agenda');
255 $week_gui = $this->forwardToClass('ilcalendarweekgui');
256 if ($this->showToolbarAndSidebar()) {
257 $this->showViewSelection("app_week");
258 $this->showSideBlocks();
259 $week_gui->addToolbarFileDownload();
260 }
261
262 break;
263
264 case 'ilcalendardaygui':
265 $this->tabs_gui->activateTab('cal_agenda');
266 $day_gui = $this->forwardToClass('ilcalendardaygui');
267 if ($this->showToolbarAndSidebar()) {
268 $this->showViewSelection("app_day");
269 $this->showSideBlocks();
270 $day_gui->addToolbarFileDownload();
271 }
272 break;
273
274 case 'ilcalendarusersettingsgui':
275 $this->ctrl->setReturn($this, '');
276 $this->tabs_gui->activateTab('settings');
277 $this->setCmdClass('ilcalendarusersettingsgui');
278
279 $user_settings = new ilCalendarUserSettingsGUI();
280 $this->ctrl->forwardCommand($user_settings);
281 // No side blocks
282 return;
283
284 case 'ilcalendarappointmentgui':
285 $this->ctrl->setReturn($this, '');
286 $this->tabs_gui->activateTab((string) ilSession::get('cal_last_tab'));
287
288 $app = new ilCalendarAppointmentGUI($this->seed, $this->seed, $this->initAppointmentIdFromQuery());
289 $this->ctrl->forwardCommand($app);
290 break;
291
292 case 'ilcalendarsubscriptiongui':
293 $this->ctrl->setReturn($this, '');
294 $this->tabs_gui->activateTab("cal_agenda");
295
296 $ref_id = 0;
297 if ($this->http->wrapper()->query()->has('ref_id')) {
298 $ref_id = $this->http->wrapper()->query()->retrieve(
299 'ref_id',
300 $this->refinery->kindlyTo()->int()
301 );
302 }
303 $sub = new ilCalendarSubscriptionGUI($this->category_id, $ref_id);
304 $this->ctrl->forwardCommand($sub);
305 if ($this->showToolbarAndSidebar()) {
306 $this->showSideBlocks();
307 }
308 break;
309
310 case 'ilcalendarcategorygui':
311 $this->ctrl->setReturn($this, '');
312 $this->tabs_gui->activateTab("cal_manage");
313 $category = new ilCalendarCategoryGUI($this->user->getId(), $this->seed, $this->ref_id);
314 if ($this->ctrl->forwardCommand($category)) {
315 return;
316 } else {
317 $this->showSideBlocks();
318 break;
319 }
320
321 // no break
322 case 'ilcalendarblockgui':
323 $side_cal = new ilCalendarBlockGUI();
324 $side_cal->setRepositoryMode($this->getRepositoryMode());
325 $side_cal->setForceMonthView(true);
326 $this->ctrl->forwardCommand($side_cal);
327 $this->showSideBlocks();
328 break;
329
330 case 'ilpdcalendarblockgui':
331 $side_cal = new ilPDCalendarBlockGUI();
332 $side_cal->setRepositoryMode($this->getRepositoryMode());
333 $side_cal->setForceMonthView(true);
334 $this->ctrl->forwardCommand($side_cal);
335 $this->showSideBlocks();
336 break;
337
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(
342 'user_id',
343 $this->refinery->kindlyTo()->int()
344 );
345 }
346 $user_profile = new ilPublicUserProfileGUI($user_id);
347 $html = $this->ctrl->forwardCommand($user_profile);
348 $this->tpl->setContent($html);
349 break;
350
351 default:
352 $cmd = $this->ctrl->getCmd("show");
353 $this->$cmd();
354 $this->showSideBlocks();
355 break;
356 }
357 }
Administrate calendar appointments.
Calendar blocks, displayed in different contexts, e.g.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showViewSelection(string $a_active="cal_list")
initSeed()
init the seed date for presentations (month view, minicalendar)
initAndRedirectToConsultationHours()
Init and redirect to consultation hours.
Show calendar subscription info.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Calendar blocks, displayed on personal desktop.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static get(string $a_var)
static redirect(string $a_script)
$app
Definition: cli.php:39

References $app, $ref_id, ilCalendarSettings\_getInstance(), ILIAS\Repository\ctrl(), forwardToClass(), ilSession\get(), getNextClass(), getRepositoryMode(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), initAndRedirectToConsultationHours(), initAppointmentIdFromQuery(), initSeed(), ILIAS\Repository\lng(), prepareOutput(), ilUtil\redirect(), ILIAS\Repository\refinery(), setCmdClass(), showSideBlocks(), showToolbarAndSidebar(), showViewSelection(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ forwardToClass()

ilCalendarPresentationGUI::forwardToClass ( string  $a_class)
protected

Definition at line 463 of file class.ilCalendarPresentationGUI.php.

464 {
466 switch ($a_class) {
467 case 'ilcalendarmonthgui':
468 $this->user->writePref('cal_last_class', $a_class);
469 ilSession::set('cal_last_tab', 'app_month');
470 $this->setCmdClass('ilcalendarmonthgui');
471 $month_gui = new ilCalendarMonthGUI($this->seed);
472 $this->ctrl->forwardCommand($month_gui);
473 return $month_gui;
474
475 case 'ilcalendarweekgui':
476 $this->user->writePref('cal_last_class', $a_class);
477 ilSession::set('cal_last_tab', 'app_week');
478 $this->setCmdClass('ilcalendarweekgui');
479 $week_gui = new ilCalendarWeekGUI($this->seed);
480 $this->ctrl->forwardCommand($week_gui);
481 return $week_gui;
482
483 case 'ilcalendardaygui':
484 $this->user->writePref('cal_last_class', $a_class);
485 ilSession::set('cal_last_tab', 'app_day');
486 $this->setCmdClass('ilcalendardaygui');
487 $day_gui = new ilCalendarDayGUI($this->seed);
488 $this->ctrl->forwardCommand($day_gui);
489 return $day_gui;
490
491 case 'ilcalendarinboxgui':
492 $this->user->writePref('cal_last_class', $a_class);
493 ilSession::set('cal_last_tab', 'cal_upcoming_events_header');
494 $this->setCmdClass('ilcalendarinboxgui');
495 $inbox_gui = new ilCalendarInboxGUI($this->seed);
496 $this->ctrl->forwardCommand($inbox_gui);
497 return $inbox_gui;
498 }
499 return null;
500 }
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...
static set(string $a_var, $a_val)
Set a value.
$ilUser
Definition: imgupload.php:34

References $ilUser, $user, ILIAS\Repository\ctrl(), ilSession\set(), setCmdClass(), and ILIAS\Repository\user().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNextClass()

ilCalendarPresentationGUI::getNextClass ( )

Definition at line 408 of file class.ilCalendarPresentationGUI.php.

408 : string
409 {
410 if (strlen($next_class = $this->ctrl->getNextClass())) {
411 return $next_class;
412 }
413 if (
414 strcasecmp($this->ctrl->getCmdClass(), ilCalendarPresentationGUI::class) === 0 ||
415 $this->ctrl->getCmdClass() == ''
416 ) {
417 $cmd_class = $this->readLastClass();
418 $this->ctrl->setCmdClass($cmd_class);
419 return $cmd_class;
420 }
421 return '';
422 }
readLastClass()
Read last class from history.

References ILIAS\Repository\ctrl(), and readLastClass().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRepositoryMode()

ilCalendarPresentationGUI::getRepositoryMode ( )

Definition at line 120 of file class.ilCalendarPresentationGUI.php.

120 : bool
121 {
123 }

References $repository_mode.

Referenced by addCategoryTabs(), addStandardTabs(), executeCommand(), initSeed(), and showSideBlocks().

+ Here is the caller graph for this function:

◆ getRequestedSeedAsString()

ilCalendarPresentationGUI::getRequestedSeedAsString ( )
protected

Definition at line 733 of file class.ilCalendarPresentationGUI.php.

733 : string
734 {
735 $seed = '';
736 if ($this->http->wrapper()->query()->has('seed')) {
737 $seed = $this->http->wrapper()->query()->retrieve(
738 'seed',
739 $this->refinery->kindlyTo()->string()
740 );
741 }
742 return $seed;
743 }

References $seed, ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by initAndRedirectToConsultationHours(), and initSeed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAndRedirectToConsultationHours()

ilCalendarPresentationGUI::initAndRedirectToConsultationHours ( )
protected

Init and redirect to consultation hours.

Definition at line 151 of file class.ilCalendarPresentationGUI.php.

151 : void
152 {
153 $ch_user_id = 0;
154 if ($this->http->wrapper()->query()->has('ch_user_id')) {
155 $ch_user_id = $this->http->wrapper()->query()->retrieve(
156 'ch_user_id',
157 $this->refinery->kindlyTo()->int()
158 );
159 }
160 $visibility = ilCalendarVisibility::_getInstanceByUserId($this->user->getId(), $this->ref_id);
161 foreach ($this->cats->getCategoriesInfo() as $info) {
162 if (
163 $info["type"] == ilCalendarCategory::TYPE_CH &&
164 $info["obj_id"] == $ch_user_id
165 ) {
166 $v = $visibility->getVisible();
167 if (!in_array($info["cat_id"], $v)) {
168 $v[] = $info["cat_id"];
169 }
170 $visibility->showSelected($v);
171 $visibility->save();
172 $this->ctrl->setParameterByClass(ilCalendarMonthGUI::class, 'category_id', $info['cat_id']);
173 $this->ctrl->setParameterByClass(\ilCalendarMonthGUI::class, 'seed', $this->getRequestedSeedAsString());
174 }
175 }
176 $this->ctrl->redirectToURL(
177 $this->ctrl->getLinkTargetByClass(\ilCalendarMonthGUI::class, '')
178 );
179 }

References ilCalendarVisibility\_getInstanceByUserId(), ILIAS\Repository\ctrl(), getRequestedSeedAsString(), ILIAS\FileDelivery\http(), ILIAS\Repository\refinery(), ilCalendarCategory\TYPE_CH, and ILIAS\Repository\user().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAppointmentIdFromQuery()

ilCalendarPresentationGUI::initAppointmentIdFromQuery ( )
protected

Definition at line 125 of file class.ilCalendarPresentationGUI.php.

125 : int
126 {
127 if ($this->http->wrapper()->query()->has('app_id')) {
128 return $this->http->wrapper()->query()->retrieve(
129 'app_id',
130 $this->refinery->kindlyTo()->int()
131 );
132 }
133 return 0;
134 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCalendarView()

ilCalendarPresentationGUI::initCalendarView ( )
protected

Initialises calendar view according to given settings.

Definition at line 184 of file class.ilCalendarPresentationGUI.php.

184 : void
185 {
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(
189 'cal_view',
190 $this->refinery->kindlyTo()->int()
191 );
192 }
193 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCategoryIdFromQuery()

ilCalendarPresentationGUI::initCategoryIdFromQuery ( )
protected

Definition at line 136 of file class.ilCalendarPresentationGUI.php.

136 : int
137 {
138 if ($this->http->wrapper()->query()->has('category_id')) {
139 return $this->http->wrapper()->query()->retrieve(
140 'category_id',
141 $this->refinery->kindlyTo()->int()
142 );
143 }
144 return 0;
145 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by addCategoryTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSeed()

ilCalendarPresentationGUI::initSeed ( )

init the seed date for presentations (month view, minicalendar)

Definition at line 748 of file class.ilCalendarPresentationGUI.php.

748 : void
749 {
751
752 // default to today
753 $now = new \ilDate(time(), IL_CAL_UNIX);
754 $this->seed = new \ilDate($now->get(IL_CAL_DATE), IL_CAL_DATE);
755 if ($seed) {
756 $this->seed = new ilDate($seed, IL_CAL_DATE);
757 } elseif (!$this->getRepositoryMode()) {
758 $session_seed = ilSession::get('cal_seed');
759 if ($session_seed) {
760 $this->seed = new ilDate($session_seed, IL_CAL_DATE);
761 }
762 }
763 $this->ctrl->setParameter($this, 'seed', $this->seed->get(IL_CAL_DATE));
764 ilSession::set('cal_seed', $this->seed->get(IL_CAL_DATE));
765 }
const IL_CAL_DATE
const IL_CAL_UNIX
Class for single dates.

References $seed, ILIAS\Repository\ctrl(), ilSession\get(), getRepositoryMode(), getRequestedSeedAsString(), IL_CAL_DATE, IL_CAL_UNIX, and ilSession\set().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareOutput()

ilCalendarPresentationGUI::prepareOutput ( )
protected

Definition at line 654 of file class.ilCalendarPresentationGUI.php.

654 : void
655 {
656 if ($this->category_id) {
657 $this->addCategoryTabs();
658 } else {
659 $this->addStandardTabs();
660 }
661
662 // if we are in single calendar view
663 if ($this->category_id > 0) {
664 $tabs = $this->tabs_gui;
668
669 $category = new ilCalendarCategory($this->category_id);
670
671 // Set header
672 $header = "";
673 switch ($category->getType()) {
675 $header = $this->lng->txt('cal_type_personal') . ": " . $category->getTitle();
676 break;
677
679 $header = $this->lng->txt('cal_type_system') . ": " . $category->getTitle();
680 break;
681
683 $header = $this->lng->txt('cal_type_' . $category->getObjType()) . ": " . $category->getTitle();
684 break;
685
687 $header = str_replace(
688 "%1",
689 ilObjUser::_lookupFullname($category->getObjId()),
690 $this->lng->txt("cal_consultation_hours_for_user")
691 );
692 break;
693
695 $header = $category->getTitle();
696 break;
697 }
698 $tpl->setTitleIcon(ilUtil::getImagePath("icon_cal.svg"));
699 $tpl->setTitle($header);
700
701 $action_menu = new ilAdvancedSelectionListGUI();
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');
709 $action_menu->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
710 $action_menu->setUseImages(false);
711
712 // iCal-Url
713 $ctrl->setParameterByClass("ilcalendarsubscriptiongui", "category_id", $this->category_id);
714 $action_menu->addItem(
715 $this->lng->txt("cal_ical_url"),
716 "",
717 $ctrl->getLinkTargetByClass("ilcalendarsubscriptiongui", "")
718 );
719
720 // delete action
721 if ($this->actions->checkDeleteCal($this->category_id)) {
722 $ctrl->setParameterByClass("ilcalendarcategorygui", "category_id", $this->category_id);
723 $action_menu->addItem(
724 $this->lng->txt("cal_delete_cal"),
725 "",
726 $ctrl->getLinkTargetByClass("ilcalendarcategorygui", "confirmDelete")
727 );
728 }
729 $tpl->setHeaderActionMenu($action_menu->getHTML());
730 }
731 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Stores calendar categories.
addCategoryTabs()
Add tabs for ilCategoryGUI context This cannot be done there since many views (Day Week Agenda) are i...
static _lookupFullname(int $a_user_id)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setHeaderActionMenu(string $a_header)
Set header action menu.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.

References $ctrl, $lng, $tabs_gui, $tpl, ilObjUser\_lookupFullname(), addCategoryTabs(), addStandardTabs(), ilAdvancedSelectionListGUI\DOWN_ARROW_DARK, ilUtil\getImagePath(), ilCtrlInterface\getLinkTargetByClass(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setHeaderActionMenu(), ilCtrlInterface\setParameterByClass(), ilGlobalTemplateInterface\setTitle(), ilGlobalTemplateInterface\setTitleIcon(), ilCalendarCategory\TYPE_BOOK, ilCalendarCategory\TYPE_CH, ilCalendarCategory\TYPE_GLOBAL, ilCalendarCategory\TYPE_OBJ, and ilCalendarCategory\TYPE_USR.

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readLastClass()

ilCalendarPresentationGUI::readLastClass ( )

Read last class from history.

Definition at line 427 of file class.ilCalendarPresentationGUI.php.

427 : string
428 {
430 switch ($this->cal_view) {
432 $class = "ilcalendardaygui";
433 break;
435 $class = "ilcalendarweekgui";
436 break;
438 $class = "ilcalendarmonthgui";
439 break;
441 default:
442 $class = "ilcalendarinboxgui";
443 break;
444 }
445
446 // see #34998, if cal_view is requested (e.g. through starting point)
447 // it must get high prio than history entry
448 $user_pref = $this->user->getPref('cal_last_class');
449 $use_pref = $user_pref && ($user_pref !== "") && !$this->http->wrapper()->query()->has('cal_view');
450
451 return $use_pref ? $user_pref : $class;
452 }

References $ilUser, $user, ilCalendarSettings\DEFAULT_CAL_DAY, ilCalendarSettings\DEFAULT_CAL_LIST, ilCalendarSettings\DEFAULT_CAL_MONTH, ilCalendarSettings\DEFAULT_CAL_WEEK, ILIAS\FileDelivery\http(), and ILIAS\Repository\user().

Referenced by getNextClass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCmdClass()

ilCalendarPresentationGUI::setCmdClass (   $a_class)

Definition at line 454 of file class.ilCalendarPresentationGUI.php.

454 : void
455 {
456 // If cmd class == 'ilcalendarpresentationgui' the cmd class is set to the the new forwarded class
457 // otherwise e.g ilcalendarmonthgui tries to forward (back) to ilcalendargui.
458 if ($this->ctrl->getCmdClass() == strtolower(get_class($this))) {
459 $this->ctrl->setCmdClass(strtolower($a_class));
460 }
461 }

References ILIAS\Repository\ctrl().

Referenced by executeCommand(), and forwardToClass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSideBlocks()

ilCalendarPresentationGUI::showSideBlocks ( )
protected

Definition at line 502 of file class.ilCalendarPresentationGUI.php.

502 : void
503 {
504 $tpl = new ilTemplate('tpl.cal_side_block.html', true, true, 'Services/Calendar');
505 if ($this->getRepositoryMode()) {
506 $side_cal = new ilCalendarBlockGUI();
507 } else {
508 $side_cal = new ilPDCalendarBlockGUI();
509 }
510 $side_cal->setParentGUI("ilCalendarPresentationGUI");
511 $side_cal->setForceMonthView(true);
512 $side_cal->setRepositoryMode($this->getRepositoryMode());
513 $tpl->setVariable('MINICAL', $this->ctrl->getHTML($side_cal));
514
515 $cat = new ilCalendarCategoryGUI($this->user->getId(), $this->seed, $this->ref_id);
516 $tpl->setVariable('CATEGORIES', $this->ctrl->getHTML($cat));
517
518 $this->tpl->setRightContent($tpl->get());
519 }
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References $tpl, ILIAS\Repository\ctrl(), ilGlobalTemplateInterface\get(), getRepositoryMode(), ilGlobalTemplateInterface\setVariable(), and ILIAS\Repository\user().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showToolbarAndSidebar()

ilCalendarPresentationGUI::showToolbarAndSidebar ( )

Definition at line 769 of file class.ilCalendarPresentationGUI.php.

769 : bool
770 {
771 #21783
772 return !(
773 $this->ctrl->getCmdClass() == "ilcalendarappointmentgui" ||
774 $this->ctrl->getCmdClass() == 'ilconsultationhoursgui'
775 );
776 }

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showViewSelection()

ilCalendarPresentationGUI::showViewSelection ( string  $a_active = "cal_list")

Definition at line 359 of file class.ilCalendarPresentationGUI.php.

359 : void
360 {
361 $ui = $this->ui;
365
366 $f = $ui->factory();
367
368 $actions = array(
369 $this->lng->txt("app_day") => $ctrl->getLinkTargetByClass('ilCalendarDayGUI', ''),
370 $this->lng->txt("app_week") => $ctrl->getLinkTargetByClass('ilCalendarWeekGUI', ''),
371 $this->lng->txt("app_month") => $ctrl->getLinkTargetByClass('ilCalendarMonthGUI', ''),
372 $this->lng->txt("cal_list") => $ctrl->getLinkTargetByClass('ilCalendarInboxGUI', '')
373 );
374
375
376 $view_control = $f->viewControl()->mode($actions, "cal_change_calendar_view")->withActive($this->lng->txt($a_active));
377 $toolbar->addComponent($view_control);
378 $ctrl->setParameterByClass("ilcalendarappointmentgui", "seed", $this->seed->get(IL_CAL_DATE, ''));
379 $ctrl->setParameterByClass("ilcalendarappointmentgui", "app_id", "");
380 $ctrl->setParameterByClass("ilcalendarappointmentgui", "dt", "");
381 $ctrl->setParameterByClass("ilcalendarappointmentgui", "idate", (new ilDate(time(), IL_CAL_UNIX))->get(IL_CAL_DATE));
382
383 $extra_button_added = false;
384 // add appointment
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"),
390 $ctrl->getLinkTargetByClass("ilcalendarappointmentgui", "add")
391 );
392 $toolbar->addComponent($add_button);
393 }
394
395 // import appointments
396 if ($this->category_id > 0 && $this->actions->checkAddEvent($this->category_id)) {
397 if (!$extra_button_added) {
399 }
400 $add_button = $f->button()->standard(
401 $this->lng->txt("cal_import_appointments"),
402 $ctrl->getLinkTargetByClass("ilcalendarcategorygui", "importAppointments")
403 );
404 $toolbar->addComponent($add_button);
405 }
406 }
addComponent(\ILIAS\UI\Component\Component $a_comp)

References $actions, $ctrl, Vendor\Package\$f, $lng, $toolbar, $ui, ilToolbarGUI\addComponent(), ilToolbarGUI\addSeparator(), ilCtrlInterface\getLinkTargetByClass(), IL_CAL_DATE, IL_CAL_UNIX, ILIAS\Repository\lng(), and ilCtrlInterface\setParameterByClass().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilCalendarPresentationGUI::$access
protected

Definition at line 44 of file class.ilCalendarPresentationGUI.php.

Referenced by addStandardTabs().

◆ $actions

ilCalendarActions ilCalendarPresentationGUI::$actions
protected

Definition at line 50 of file class.ilCalendarPresentationGUI.php.

Referenced by showViewSelection().

◆ $cal_period

int ilCalendarPresentationGUI::$cal_period = 0
protected

Definition at line 58 of file class.ilCalendarPresentationGUI.php.

◆ $cal_settings

ilCalendarSettings ilCalendarPresentationGUI::$cal_settings
protected

Definition at line 49 of file class.ilCalendarPresentationGUI.php.

◆ $cal_view

int ilCalendarPresentationGUI::$cal_view = 0
protected

Definition at line 57 of file class.ilCalendarPresentationGUI.php.

◆ $category_id

int ilCalendarPresentationGUI::$category_id = 0
protected

Definition at line 54 of file class.ilCalendarPresentationGUI.php.

Referenced by addStandardTabs().

◆ $cats

ilCalendarCategories ilCalendarPresentationGUI::$cats
protected

Definition at line 51 of file class.ilCalendarPresentationGUI.php.

Referenced by __construct().

◆ $ctrl

ilCtrlInterface ilCalendarPresentationGUI::$ctrl
protected

◆ $help

ilHelpGUI ilCalendarPresentationGUI::$help
protected

Definition at line 40 of file class.ilCalendarPresentationGUI.php.

◆ $http

HttpServices ilCalendarPresentationGUI::$http
protected

Definition at line 45 of file class.ilCalendarPresentationGUI.php.

◆ $lng

ilLanguage ilCalendarPresentationGUI::$lng
protected

Definition at line 36 of file class.ilCalendarPresentationGUI.php.

Referenced by prepareOutput(), and showViewSelection().

◆ $rbacsystem

ilRbacSystem ilCalendarPresentationGUI::$rbacsystem
protected

Definition at line 41 of file class.ilCalendarPresentationGUI.php.

Referenced by addStandardTabs().

◆ $ref_id

int ilCalendarPresentationGUI::$ref_id = 0
protected

Definition at line 53 of file class.ilCalendarPresentationGUI.php.

Referenced by executeCommand().

◆ $refinery

RefineryFactory ilCalendarPresentationGUI::$refinery
protected

Definition at line 46 of file class.ilCalendarPresentationGUI.php.

◆ $repository_mode

bool ilCalendarPresentationGUI::$repository_mode = false
protected

Definition at line 52 of file class.ilCalendarPresentationGUI.php.

Referenced by getRepositoryMode().

◆ $seed

ilDate ilCalendarPresentationGUI::$seed = null
protected

Definition at line 55 of file class.ilCalendarPresentationGUI.php.

Referenced by getRequestedSeedAsString(), and initSeed().

◆ $tabs_gui

ilTabsGUI ilCalendarPresentationGUI::$tabs_gui
protected

Definition at line 38 of file class.ilCalendarPresentationGUI.php.

Referenced by prepareOutput().

◆ $toolbar

ilToolbarGUI ilCalendarPresentationGUI::$toolbar
protected

Definition at line 43 of file class.ilCalendarPresentationGUI.php.

Referenced by showViewSelection().

◆ $tpl

ilGlobalTemplateInterface ilCalendarPresentationGUI::$tpl
protected

Definition at line 37 of file class.ilCalendarPresentationGUI.php.

Referenced by prepareOutput(), and showSideBlocks().

◆ $ui

ILIAS DI UIServices ilCalendarPresentationGUI::$ui
protected

Definition at line 42 of file class.ilCalendarPresentationGUI.php.

Referenced by showViewSelection().

◆ $user

ilObjUser ilCalendarPresentationGUI::$user
protected

Definition at line 39 of file class.ilCalendarPresentationGUI.php.

Referenced by forwardToClass(), and readLastClass().


The documentation for this class was generated from the following file: