ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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, timezone, 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  }
Set timezone
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, $ilCtrl, $time, $tpl, ilCalendarAppointmentPresentationGUI\_getInstance(), ilCalendarViewGUI\getCurrentApp(), and IL_CAL_DATE.

63  {
64  global $ilCtrl,$tpl;
65 
66  $this->ctrl->saveParameter($this, 'seed');
67 
68  $next_class = $ilCtrl->getNextClass();
69  switch ($next_class) {
70  case "ilcalendarappointmentpresentationgui":
71  $this->ctrl->setReturn($this, "");
72  include_once("./Services/Calendar/classes/class.ilCalendarAppointmentPresentationGUI.php");
74  $this->ctrl->forwardCommand($gui);
75  break;
76  case 'ilcalendarappointmentgui':
77  $this->ctrl->setReturn($this, '');
78  $this->tabs_gui->setSubTabActive($_SESSION['cal_last_tab']);
79 
80  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
81 
82  // initial date for new calendar appointments
83  $idate = new ilDate($_REQUEST['idate'], IL_CAL_DATE);
84 
85  $app = new ilCalendarAppointmentGUI($this->seed, $idate, (int) $_GET['app_id']);
86  $this->ctrl->forwardCommand($app);
87  break;
88 
89  default:
90  $time = microtime(true);
91  $cmd = $this->ctrl->getCmd("show");
92  $this->$cmd();
93  $tpl->setContent($this->tpl->get());
94 
95  #echo "Zeit: ".(microtime(true) - $time);
96  break;
97  }
98  return true;
99  }
$_SESSION["AccountId"]
$_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 271 of file class.ilCalendarMonthGUI.php.

272  {
273  $this->show();
274  return $this->tpl->get();
275  }

◆ showEvents()

ilCalendarMonthGUI::showEvents ( ilDate  $date)
protected

Show events.

protected

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

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

Referenced by addScheduleFilter().

284  {
285  global $tree;
286 
287  $f = $this->ui_factory;
289 
290  $count = 0;
291 
292 
293  foreach ($this->scheduler->getByDay($date, $this->timezone) as $item) {
294  $this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
295  $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'app_id', $item['event']->getEntryId());
296 
297  $event_tpl = new ilTemplate('tpl.month_event_view.html', true, true, 'Services/Calendar');
298  // milestone icon
299  if ($item['event']->isMilestone()) {
300  $event_tpl->setCurrentBlock('fullday_ms_icon');
301  $event_tpl->setVariable('ALT_FD_MS', $this->lng->txt("cal_milestone"));
302  $event_tpl->setVariable('SRC_FD_MS', ilUtil::getImagePath("icon_ms.svg"));
303  $event_tpl->parseCurrentBlock();
304  }
305 
306 
307 
308  $compl = ($item['event']->isMilestone() && $item['event']->getCompletion() > 0)
309  ? " (" . $item['event']->getCompletion() . "%)"
310  : "";
311 
312  if (!$item['event']->isFullDay()) {
313  switch ($this->user_settings->getTimeFormat()) {
315  $time = $item['event']->getStart()->get(IL_CAL_FKT_DATE, 'H:i', $this->timezone);
316  break;
317 
319  $time = $item['event']->getStart()->get(IL_CAL_FKT_DATE, 'h:ia', $this->timezone);
320  break;
321  }
322  }
323 
324  //plugins can change the modal title.
325  $shy = $this->getAppointmentShyButton($item['event'], $item['dstart'], "");
326 
327  $title = ($time != "")? $time . " " . $shy : $shy;
328 
329  $event_html = $title . $compl;
330 
331  $event_tpl->setCurrentBlock('il_event');
332 
333  //Start configuring the default template
334  $event_tpl->setVariable('EVENT_EDIT_LINK', $this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui', 'edit'));
335  $event_tpl->setVariable('EVENT_NUM', $item['event']->getEntryId());
336  $event_tpl->setVariable('EVENT_CONTENT', $event_html);
337  $color = $this->app_colors->getColorByAppointment($item['event']->getEntryId());
338  $event_tpl->setVariable('EVENT_BGCOLOR', $color);
339  $event_tpl->setVariable('EVENT_ADD_STYLES', $item['event']->getPresentationStyle());
340  $event_tpl->setVariable('EVENT_FONTCOLOR', ilCalendarUtil::calculateFontColor($color));
341 
342  //plugins can override the previous template variables. The plugin slot parses the current block because
343  //it needs to call the template get method to use the resulting HTML in the replaceContent method.
344  if ($event_html_by_plugin = $this->getContentByPlugins($item['event'], $item['dstart'], $event_html, $event_tpl)) {
345  $event_body_html = $event_html_by_plugin;
346  } else {
347  $event_tpl->parseCurrentBlock();
348  $event_body_html = $event_tpl->get();
349  }
350 
351  $this->tpl->setCurrentBlock("event_nfd");
352  $this->tpl->setVariable("EVENT_CONTENT", $event_body_html);
353  $this->tpl->parseCurrentBlock();
354 
355  $this->num_appointments++;
356  $count++;
357  }
358  return $count;
359  }
Set timezone
getAppointmentShyButton($a_calendar_entry, $a_dstart, $a_title_forced="")
$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: