4 include_once(
'Services/Calendar/classes/class.ilDate.php');
5 include_once(
'Services/Calendar/classes/class.ilCalendarHeaderNavigationGUI.php');
6 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
7 include_once(
'Services/Calendar/classes/class.ilCalendarAppointmentColors.php');
8 include_once(
'Services/Calendar/classes/class.ilCalendarViewGUI.php');
47 $this->tabs_gui->setSubTabActive(
'app_month');
66 $this->ctrl->saveParameter($this,
'seed');
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);
76 case 'ilcalendarappointmentgui':
77 $this->ctrl->setReturn($this,
'');
78 $this->tabs_gui->setSubTabActive(
$_SESSION[
'cal_last_tab']);
80 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
86 $this->ctrl->forwardCommand($app);
90 $time = microtime(
true);
91 $cmd = $this->ctrl->getCmd(
"show");
93 $tpl->setContent($this->tpl->get());
95 #echo "Zeit: ".(microtime(true) - $time); 108 $this->schedule_filters[] = $a_filter;
117 public function show()
125 $renderer = $DIC->ui()->renderer();
127 $this->tpl =
new ilTemplate(
'tpl.month_view.html',
true,
true,
'Services/Calendar');
129 include_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
133 $this->tpl->setVariable(
'NAVIGATION', $navigation->getHTML());
135 for (
$i = (
int) $this->user_settings->getWeekStart();
$i < (7 + (int) $this->user_settings->getWeekStart());
$i++) {
136 $this->tpl->setCurrentBlock(
'month_header_col');
138 $this->tpl->parseCurrentBlock();
141 if (isset(
$_GET[
"bkid"])) {
142 $user_id =
$_GET[
"bkid"];
143 $disable_empty =
true;
146 if ($this->
user->getId() == ANONYMOUS_USER_ID) {
147 $user_id = $this->
user->getId();
148 $disable_empty =
false;
151 $user_id = $this->
user->getId();
152 $disable_empty =
false;
157 $is_portfolio_embedded =
false;
160 $is_portfolio_embedded =
true;
163 include_once(
'Services/Calendar/classes/class.ilCalendarSchedule.php');
165 $this->scheduler->addSubitemCalendars(
true);
166 if (
sizeof($this->schedule_filters)) {
167 foreach ($this->schedule_filters as $filter) {
168 $this->scheduler->addFilter($filter);
171 $this->scheduler->calculate();
173 include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
180 $this->user_settings->getWeekStart()
183 $has_events = (bool) $this->
showEvents($date);
185 if (!$this->view_with_appointments && $has_events) {
186 $this->view_with_appointments =
true;
190 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
191 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'idate', $date->get(
IL_CAL_DATE));
192 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'seed', $this->seed->get(
IL_CAL_DATE));
193 $new_app_url = $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'add');
195 if ($settings->getEnableGroupMilestones()) {
196 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
197 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'seed', $this->seed->get(
IL_CAL_DATE));
198 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'idate', $date->get(
IL_CAL_DATE));
199 $new_ms_url = $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'addMilestone');
201 $this->tpl->setCurrentBlock(
"new_ms");
202 $this->tpl->setVariable(
'DD_ID', $date->get(
IL_CAL_UNIX));
203 $this->tpl->setVariable(
'DD_TRIGGER', $renderer->render(
$ui_factory->glyph()->add()));
204 $this->tpl->setVariable(
'URL_DD_NEW_APP', $new_app_url);
205 $this->tpl->setVariable(
'TXT_DD_NEW_APP', $this->lng->txt(
'cal_new_app'));
206 $this->tpl->setVariable(
'URL_DD_NEW_MS', $new_ms_url);
207 $this->tpl->setVariable(
'TXT_DD_NEW_MS', $this->lng->txt(
'cal_new_ms'));
208 $this->tpl->parseCurrentBlock();
210 $this->tpl->setCurrentBlock(
"new_app");
211 $this->tpl->setVariable(
'NEW_GLYPH', $renderer->render(
$ui_factory->glyph()->add($new_app_url)));
212 $this->tpl->parseCurrentBlock();
226 if (!$is_portfolio_embedded &&
227 (!$disable_empty || $has_events)) {
228 $this->tpl->setCurrentBlock(
'month_day_link');
229 $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
230 $this->ctrl->setParameterByClass(
'ilcalendardaygui',
'seed', $date->get(
IL_CAL_DATE));
231 $this->tpl->setVariable(
'OPEN_DAY_VIEW', $this->ctrl->getLinkTargetByClass(
'ilcalendardaygui',
''));
232 $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
234 $this->tpl->setCurrentBlock(
'month_day_no_link');
237 $this->tpl->setVariable(
'MONTH_DAY', $month_day);
239 $this->tpl->parseCurrentBlock();
242 $this->tpl->setCurrentBlock(
'month_col');
244 include_once(
'./Services/Calendar/classes/class.ilCalendarUtil.php');
246 $this->tpl->setVariable(
'TD_CLASS',
'caltoday');
248 #elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY)) 250 # $this->tpl->setVariable('TD_CLASS','calnow'); 253 $this->tpl->setVariable(
'TD_CLASS',
'calstd');
255 $this->tpl->setVariable(
'TD_CLASS',
'calprev');
257 $this->tpl->setVariable(
'TD_CLASS',
'calnext');
260 $this->tpl->parseCurrentBlock();
264 $this->tpl->setCurrentBlock(
'month_row');
265 $this->tpl->parseCurrentBlock();
274 return $this->tpl->get();
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());
297 $event_tpl =
new ilTemplate(
'tpl.month_event_view.html',
true,
true,
'Services/Calendar');
299 if ($item[
'event']->isMilestone()) {
300 $event_tpl->setCurrentBlock(
'fullday_ms_icon');
301 $event_tpl->setVariable(
'ALT_FD_MS', $this->lng->txt(
"cal_milestone"));
303 $event_tpl->parseCurrentBlock();
308 $compl = ($item[
'event']->isMilestone() && $item[
'event']->getCompletion() > 0)
309 ?
" (" . $item[
'event']->getCompletion() .
"%)" 312 if (!$item[
'event']->isFullDay()) {
313 switch ($this->user_settings->getTimeFormat()) {
329 $event_html =
$title . $compl;
331 $event_tpl->setCurrentBlock(
'il_event');
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());
344 if ($event_html_by_plugin = $this->
getContentByPlugins($item[
'event'], $item[
'dstart'], $event_html, $event_tpl)) {
345 $event_body_html = $event_html_by_plugin;
347 $event_tpl->parseCurrentBlock();
348 $event_body_html = $event_tpl->get();
351 $this->tpl->setCurrentBlock(
"event_nfd");
352 $this->tpl->setVariable(
"EVENT_CONTENT", $event_body_html);
353 $this->tpl->parseCurrentBlock();
355 $this->num_appointments++;
static _buildMonthDayList($a_month, $a_year, $weekstart)
Build a month day list.
showEvents(ilDate $date)
Show events.
static _getInstance()
get singleton instance
getAppointmentShyButton($a_calendar_entry, $a_dstart, $a_title_forced="")
static _numericDayToString($a_day, $a_long=true)
get
static _getInstanceByUserId($a_user_id)
get singleton instance
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 _getInstance(ilDate $seed, $a_app)
get singleton instance
const CAL_PRESENTATION_MONTH
getCurrentApp()
Get app for id.
addScheduleFilter(ilCalendarScheduleFilter $a_filter)
Add schedule filter.
static _numericMonthToString($a_month, $a_long=true)
numeric month to string
static _equals(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check if two date are equal.
Calendar schedule filter interface.
__construct(ilDate $seed_date)
Constructor.
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
static calculateFontColor($a_html_color_code)
Calculate best font color from html hex color code.
const MODE_PORTFOLIO_CONSULTATION
static _getInstance($a_usr_id=0)
get singleton instance
Create styles array
The data for the language used.
Administrate calendar appointments.
static initDragDrop()
Init YUI Drag and Drop.
static _isToday($date)
check if a date is today
getContentByPlugins($a_cal_entry, $a_start_date, $a_content, $a_tpl)
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
executeCommand()
Execute command.