24 include_once(
'Services/Calendar/classes/class.ilDate.php');
25 include_once(
'Services/Calendar/classes/class.ilCalendarHeaderNavigationGUI.php');
26 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
27 include_once(
'Services/Calendar/classes/class.ilCalendarAppointmentColors.php');
67 $this->seed = $seed_date;
72 $this->tabs_gui = $ilTabs;
73 $this->tabs_gui->setSubTabActive(
'app_month');
78 $this->timezone = $ilUser->getTimeZone();
91 $this->ctrl->saveParameter($this,
'seed');
93 $next_class = $ilCtrl->getNextClass();
96 case 'ilcalendarappointmentgui':
97 $this->ctrl->setReturn($this,
'');
98 $this->tabs_gui->setSubTabActive(
$_SESSION[
'cal_last_tab']);
100 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
106 $this->ctrl->forwardCommand($app);
110 $time = microtime(
true);
111 $cmd = $this->ctrl->getCmd(
"show");
113 $tpl->setContent($this->tpl->get());
115 #echo "Zeit: ".(microtime(true) - $time);
128 $this->schedule_filters[] = $a_filter;
141 $this->tpl =
new ilTemplate(
'tpl.month_view.html',
true,
true,
'Services/Calendar');
143 include_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
148 $this->tpl->setVariable(
'NAVIGATION',$navigation->getHTML());
150 for($i = (
int) $this->user_settings->getWeekStart();$i < (7 + (int) $this->user_settings->getWeekStart());$i++)
152 $this->tpl->setCurrentBlock(
'month_header_col');
154 $this->tpl->parseCurrentBlock();
157 if(isset(
$_GET[
"bkid"]))
159 $user_id =
$_GET[
"bkid"];
160 $disable_empty =
true;
165 if($ilUser->getId() == ANONYMOUS_USER_ID)
167 $user_id = $ilUser->getId();
168 $disable_empty =
false;
173 $user_id = $ilUser->getId();
174 $disable_empty =
false;
179 $is_portfolio_embedded =
false;
183 $is_portfolio_embedded =
true;
186 include_once(
'Services/Calendar/classes/class.ilCalendarSchedule.php');
188 $this->scheduler->addSubitemCalendars(
true);
189 if(
sizeof($this->schedule_filters))
191 foreach($this->schedule_filters as $filter)
193 $this->scheduler->addFilter($filter);
196 $this->scheduler->calculate();
198 include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
204 $this->user_settings->getWeekStart())->
get() as $date)
211 include_once
"Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
213 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
214 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'idate',$date->get(
IL_CAL_DATE));
215 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'seed',$this->seed->get(
IL_CAL_DATE));
216 $new_app_url = $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'add');
218 if ($settings->getEnableGroupMilestones())
220 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
221 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'seed',$this->seed->get(
IL_CAL_DATE));
222 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'idate',$date->get(
IL_CAL_DATE));
223 $new_ms_url = $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'addMilestone');
225 $this->tpl->setCurrentBlock(
"new_ms");
226 $this->tpl->setVariable(
'DD_ID', $date->get(
IL_CAL_UNIX));
228 $this->tpl->setVariable(
'URL_DD_NEW_APP', $new_app_url);
229 $this->tpl->setVariable(
'TXT_DD_NEW_APP', $this->lng->txt(
'cal_new_app'));
230 $this->tpl->setVariable(
'URL_DD_NEW_MS', $new_ms_url);
231 $this->tpl->setVariable(
'TXT_DD_NEW_MS', $this->lng->txt(
'cal_new_ms'));
232 $this->tpl->parseCurrentBlock();
236 $this->tpl->setCurrentBlock(
"new_app");
237 $this->tpl->setVariable(
'ADD_LINK', $new_app_url);
239 $this->tpl->parseCurrentBlock();
249 $month_day =
'1 '.ilCalendarUtil::_numericMonthToString($month,
false);
256 if(!$is_portfolio_embedded &&
257 (!$disable_empty || $has_events))
259 $this->tpl->setCurrentBlock(
'month_day_link');
260 $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
261 $this->ctrl->setParameterByClass(
'ilcalendardaygui',
'seed',$date->get(
IL_CAL_DATE));
262 $this->tpl->setVariable(
'OPEN_DAY_VIEW',$this->ctrl->getLinkTargetByClass(
'ilcalendardaygui',
''));
263 $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
267 $this->tpl->setCurrentBlock(
'month_day_no_link');
270 $this->tpl->setVariable(
'MONTH_DAY',$month_day);
272 $this->tpl->parseCurrentBlock();
275 $this->tpl->setCurrentBlock(
'month_col');
277 include_once(
'./Services/Calendar/classes/class.ilCalendarUtil.php');
280 $this->tpl->setVariable(
'TD_CLASS',
'caltoday');
282 #elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
284 # $this->tpl->setVariable('TD_CLASS','calnow');
288 $this->tpl->setVariable(
'TD_CLASS',
'calstd');
292 $this->tpl->setVariable(
'TD_CLASS',
'calprev');
296 $this->tpl->setVariable(
'TD_CLASS',
'calnext');
299 $this->tpl->parseCurrentBlock();
302 if($counter and !($counter % 7))
304 $this->tpl->setCurrentBlock(
'month_row');
305 $this->tpl->parseCurrentBlock();
314 return $this->tpl->get();
330 foreach($this->scheduler->getByDay($date,$this->timezone) as $item)
332 $this->tpl->setCurrentBlock(
'panel_code');
333 $this->tpl->setVariable(
'NUM',$this->num_appointments);
334 $this->tpl->parseCurrentBlock();
337 if ($item[
'event']->isMilestone())
339 $this->tpl->setCurrentBlock(
'fullday_ms_icon');
340 $this->tpl->setVariable(
'ALT_FD_MS', $this->lng->txt(
"cal_milestone"));
342 $this->tpl->parseCurrentBlock();
345 $this->tpl->setCurrentBlock(
'il_event');
347 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentPanelGUI.php');
349 $this->tpl->setVariable(
'PANEL_NUM',$this->num_appointments);
351 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
352 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id',$item[
'event']->getEntryId());
353 $this->tpl->setVariable(
'EVENT_EDIT_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'edit'));
354 $this->tpl->setVariable(
'EVENT_NUM',$item[
'event']->getEntryId());
356 $compl = ($item[
'event']->isMilestone() && $item[
'event']->getCompletion() > 0)
357 ?
" (".$item[
'event']->getCompletion().
"%)"
360 if($item[
'event']->isFullDay())
362 $title = $item[
'event']->getPresentationTitle().$compl;
366 switch($this->user_settings->getTimeFormat())
369 $title = $item[
'event']->getStart()->get(
IL_CAL_FKT_DATE,
'H:i',$this->timezone);
373 $title = $item[
'event']->getStart()->get(
IL_CAL_FKT_DATE,
'h:ia',$this->timezone);
377 $title .= (
' '.$item[
'event']->getPresentationTitle());
379 $this->tpl->setVariable(
'EVENT_TITLE',$title);
380 $color = $this->app_colors->getColorByAppointment($item[
'event']->getEntryId());
381 $this->tpl->setVariable(
'EVENT_BGCOLOR',$color);
382 $this->tpl->setVariable(
'EVENT_ADD_STYLES',$item[
'event']->getPresentationStyle());
385 $this->tpl->parseCurrentBlock();
387 $this->num_appointments++;