ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCalendarMonthGUI Class Reference
+ Inheritance diagram for ilCalendarMonthGUI:
+ Collaboration diagram for ilCalendarMonthGUI:

Public Member Functions

 __construct (ilDate $seed_date)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 addScheduleFilter (ilCalendarScheduleFilter $a_filter)
 Add schedule filter. More...
 
 getHTML ()
 
- Public Member Functions inherited from ilCalendarViewGUI
 __construct (ilDate $seed, $presentation_type)
 
 setConsulationHoursUserId ($a_user_id)
 
 getConsultationHoursUserId ()
 
 initialize ($a_calendar_presentation_type)
 View initialization. More...
 
 getCurrentApp ()
 Get app for id. More...
 
 getEvents ()
 Get events. More...
 
 getDatesForItem ($item)
 Get start/end date for item. More...
 
 getModalForApp ()
 Get modal for appointment (see similar code in ilCalendarBlockGUI) More...
 
 getAppointmentShyButton ($a_calendar_entry, $a_dstart, $a_title_forced="")
 
 getActivePlugins ($a_slot_id)
 
 getModalTitleByPlugins ($a_current_title)
 
 getContentByPlugins ($a_cal_entry, $a_start_date, $a_content, $a_tpl)
 
 addToolbarActions ()
 Add download link to toolbar. More...
 
 downloadFiles ()
 Download files related to the appointments showed in the current calendar view (day,week,month,list). More...
 
 getBucketTitle ()
 get proper label to add in the background task popover More...
 
 countEventsInView ()
 get the events starting between 2 dates based in seed + view options. More...
 

Protected Member Functions

 showEvents (ilDate $date)
 Show events. More...
 

Protected Attributes

 $num_appointments = 1
 
 $schedule_filters = array()
 
 $user_settings = null
 
 $lng
 
 $ctrl
 
 $tabs_gui
 
 $tpl
 
 $ui_factory
 
 $ui_renderer
 
 $user
 
 $timezone = 'UTC'
 
- Protected Attributes inherited from ilCalendarViewGUI
 $ui_factory
 
 $ui_renderer
 
 $ctrl
 
 $presentation_type
 
 $toolbar
 
 $logger
 
 $ui
 
 $view_with_appointments
 
 $lng
 
 $user
 
 $seed
 
 $ch_user_id = 0
 

Additional Inherited Members

- Data Fields inherited from ilCalendarViewGUI
const CAL_PRESENTATION_DAY = 1
 
const CAL_PRESENTATION_WEEK = 2
 
const CAL_PRESENTATION_MONTH = 3
 
const CAL_PRESENTATION_AGENDA_LIST = 9
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCalendarMonthGUI::__construct ( ilDate  $seed_date)

Constructor.

public

Parameters

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

References ilCalendarUserSettings\_getInstanceByUserId(), ilCalendarViewGUI\CAL_PRESENTATION_MONTH, and user().

45  {
46  parent::__construct($seed_date, ilCalendarViewGUI::CAL_PRESENTATION_MONTH);
47  $this->tabs_gui->setSubTabActive('app_month');
48 
49 
50  $this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($this->user->getId());
51  $this->app_colors = new ilCalendarAppointmentColors($this->user->getId());
52 
53  $this->timezone = $this->user->getTimeZone();
54  }
static _getInstanceByUserId($a_user_id)
get singleton instance
user()
Definition: user.php:4
+ Here is the call graph for this function:

Member Function Documentation

◆ addScheduleFilter()

◆ executeCommand()

ilCalendarMonthGUI::executeCommand ( )

Execute command.

public

Definition at line 62 of file class.ilCalendarMonthGUI.php.

References $_GET, $_SESSION, $DIC, $ilCtrl, $time, $tpl, ilCalendarAppointmentPresentationGUI\_getInstance(), ilCalendarViewGUI\getCurrentApp(), and IL_CAL_DATE.

63  {
64  global $DIC;
65 
66  $ilCtrl = $DIC['ilCtrl'];
67  $tpl = $DIC['tpl'];
68 
69  $this->ctrl->saveParameter($this, 'seed');
70 
71  $next_class = $ilCtrl->getNextClass();
72  switch ($next_class) {
73  case "ilcalendarappointmentpresentationgui":
74  $this->ctrl->setReturn($this, "");
75  include_once("./Services/Calendar/classes/class.ilCalendarAppointmentPresentationGUI.php");
77  $this->ctrl->forwardCommand($gui);
78  break;
79  case 'ilcalendarappointmentgui':
80  $this->ctrl->setReturn($this, '');
81  $this->tabs_gui->setSubTabActive($_SESSION['cal_last_tab']);
82 
83  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
84 
85  // initial date for new calendar appointments
86  $idate = new ilDate($_REQUEST['idate'], IL_CAL_DATE);
87 
88  $app = new ilCalendarAppointmentGUI($this->seed, $idate, (int) $_GET['app_id']);
89  $this->ctrl->forwardCommand($app);
90  break;
91 
92  default:
93  $time = microtime(true);
94  $cmd = $this->ctrl->getCmd("show");
95  $this->$cmd();
96  $tpl->setContent($this->tpl->get());
97 
98  #echo "Zeit: ".(microtime(true) - $time);
99  break;
100  }
101  return true;
102  }
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _getInstance(ilDate $seed, $a_app)
get singleton instance
getCurrentApp()
Get app for id.
global $ilCtrl
Definition: ilias.php:18
$time
Definition: cron.php:21
Class for single dates.
const IL_CAL_DATE
Administrate calendar appointments.
+ Here is the call graph for this function:

◆ getHTML()

ilCalendarMonthGUI::getHTML ( )

Definition at line 274 of file class.ilCalendarMonthGUI.php.

275  {
276  $this->show();
277  return $this->tpl->get();
278  }

◆ showEvents()

ilCalendarMonthGUI::showEvents ( ilDate  $date)
protected

Show events.

protected

Definition at line 286 of file class.ilCalendarMonthGUI.php.

References $DIC, $f, $r, $time, $title, $tree, $ui_factory, $ui_renderer, ilCalendarUtil\calculateFontColor(), ilCalendarViewGUI\getAppointmentShyButton(), ilCalendarViewGUI\getContentByPlugins(), ilUtil\getImagePath(), IL_CAL_FKT_DATE, ilCalendarSettings\TIME_FORMAT_12, and ilCalendarSettings\TIME_FORMAT_24.

Referenced by addScheduleFilter().

287  {
288  global $DIC;
289 
290  $tree = $DIC['tree'];
291 
294 
295  $count = 0;
296 
297 
298  foreach ($this->scheduler->getByDay($date, $this->timezone) as $item) {
299  $this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
300  $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $item['event']->getEntryId());
301 
302  $event_tpl = new ilTemplate('tpl.month_event_view.html', true, true, 'Services/Calendar');
303  // milestone icon
304  if ($item['event']->isMilestone()) {
305  $event_tpl->setCurrentBlock('fullday_ms_icon');
306  $event_tpl->setVariable('ALT_FD_MS', $this->lng->txt("cal_milestone"));
307  $event_tpl->setVariable('SRC_FD_MS', ilUtil::getImagePath("icon_ms.svg"));
308  $event_tpl->parseCurrentBlock();
309  }
310 
311 
312 
313  $compl = ($item['event']->isMilestone() && $item['event']->getCompletion() > 0)
314  ? " (" . $item['event']->getCompletion() . "%)"
315  : "";
316 
317  if (!$item['event']->isFullDay()) {
318  switch ($this->user_settings->getTimeFormat()) {
320  $time = $item['event']->getStart()->get(IL_CAL_FKT_DATE, 'H:i', $this->timezone);
321  break;
322 
324  $time = $item['event']->getStart()->get(IL_CAL_FKT_DATE, 'h:ia', $this->timezone);
325  break;
326  }
327  }
328 
329  //plugins can change the modal title.
330  $shy = $this->getAppointmentShyButton($item['event'], $item['dstart'], "");
331 
332  $title = ($time != "")? $time . " " . $shy : $shy;
333 
334  $event_html = $title . $compl;
335 
336  $event_tpl->setCurrentBlock('il_event');
337 
338  //Start configuring the default template
339  $event_tpl->setVariable('EVENT_EDIT_LINK', $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'edit'));
340  $event_tpl->setVariable('EVENT_NUM', $item['event']->getEntryId());
341  $event_tpl->setVariable('EVENT_CONTENT', $event_html);
342  $color = $this->app_colors->getColorByAppointment($item['event']->getEntryId());
343  $event_tpl->setVariable('EVENT_BGCOLOR', $color);
344  $event_tpl->setVariable('EVENT_ADD_STYLES', $item['event']->getPresentationStyle());
345  $event_tpl->setVariable('EVENT_FONTCOLOR', ilCalendarUtil::calculateFontColor($color));
346 
347  //plugins can override the previous template variables. The plugin slot parses the current block because
348  //it needs to call the template get method to use the resulting HTML in the replaceContent method.
349  if ($event_html_by_plugin = $this->getContentByPlugins($item['event'], $item['dstart'], $event_html, $event_tpl)) {
350  $event_body_html = $event_html_by_plugin;
351  } else {
352  $event_tpl->parseCurrentBlock();
353  $event_body_html = $event_tpl->get();
354  }
355 
356  $this->tpl->setCurrentBlock("event_nfd");
357  $this->tpl->setVariable("EVENT_CONTENT", $event_body_html);
358  $this->tpl->parseCurrentBlock();
359 
360  $this->num_appointments++;
361  $count++;
362  }
363  return $count;
364  }
getAppointmentShyButton($a_calendar_entry, $a_dstart, $a_title_forced="")
global $DIC
Definition: saml.php:7
$time
Definition: cron.php:21
$r
Definition: example_031.php:79
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
const IL_CAL_FKT_DATE
static calculateFontColor($a_html_color_code)
Calculate best font color from html hex color code.
getContentByPlugins($a_cal_entry, $a_start_date, $a_content, $a_tpl)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCalendarMonthGUI::$ctrl
protected

Definition at line 28 of file class.ilCalendarMonthGUI.php.

◆ $lng

ilCalendarMonthGUI::$lng
protected

Definition at line 27 of file class.ilCalendarMonthGUI.php.

◆ $num_appointments

ilCalendarMonthGUI::$num_appointments = 1
protected

Definition at line 22 of file class.ilCalendarMonthGUI.php.

◆ $schedule_filters

ilCalendarMonthGUI::$schedule_filters = array()
protected

Definition at line 23 of file class.ilCalendarMonthGUI.php.

◆ $tabs_gui

ilCalendarMonthGUI::$tabs_gui
protected

Definition at line 29 of file class.ilCalendarMonthGUI.php.

◆ $timezone

ilCalendarMonthGUI::$timezone = 'UTC'
protected

Definition at line 35 of file class.ilCalendarMonthGUI.php.

◆ $tpl

ilCalendarMonthGUI::$tpl
protected

Definition at line 30 of file class.ilCalendarMonthGUI.php.

Referenced by executeCommand().

◆ $ui_factory

ilCalendarMonthGUI::$ui_factory
protected

Definition at line 31 of file class.ilCalendarMonthGUI.php.

Referenced by addScheduleFilter(), and showEvents().

◆ $ui_renderer

ilCalendarMonthGUI::$ui_renderer
protected

Definition at line 32 of file class.ilCalendarMonthGUI.php.

Referenced by showEvents().

◆ $user

ilCalendarMonthGUI::$user
protected

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

◆ $user_settings

ilCalendarMonthGUI::$user_settings = null
protected

Definition at line 25 of file class.ilCalendarMonthGUI.php.


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