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 if ($settings->getEnableGroupMilestones())
213 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
214 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'seed',$this->seed->get(
IL_CAL_DATE));
215 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'idate',$date->get(
IL_CAL_DATE));
216 $this->tpl->setCurrentBlock(
"new_ms");
218 $this->tpl->setVariable(
'H_NEW_MS_ALT',$this->lng->txt(
'cal_new_ms'));
219 $this->tpl->setVariable(
'NEW_MS_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'addMilestone'));
220 $this->tpl->parseCurrentBlock();
223 $this->tpl->setCurrentBlock(
"new_app");
224 #$this->tpl->setVariable('NEW_SRC',ilUtil::getImagePath('new.png','calendar'));
226 $this->tpl->setVariable(
'NEW_ALT',$this->lng->txt(
'cal_new_app'));
227 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
228 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'idate',$date->get(
IL_CAL_DATE));
229 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'seed',$this->seed->get(
IL_CAL_DATE));
230 $this->tpl->setVariable(
'ADD_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'add'));
231 $this->tpl->parseCurrentBlock();
240 $month_day =
'1 '.ilCalendarUtil::_numericMonthToString($month,
false);
247 if(!$is_portfolio_embedded &&
248 (!$disable_empty || $has_events))
250 $this->tpl->setCurrentBlock(
'month_day_link');
251 $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
252 $this->ctrl->setParameterByClass(
'ilcalendardaygui',
'seed',$date->get(
IL_CAL_DATE));
253 $this->tpl->setVariable(
'OPEN_DAY_VIEW',$this->ctrl->getLinkTargetByClass(
'ilcalendardaygui',
''));
254 $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
258 $this->tpl->setCurrentBlock(
'month_day_no_link');
261 $this->tpl->setVariable(
'MONTH_DAY',$month_day);
263 $this->tpl->parseCurrentBlock();
266 $this->tpl->setCurrentBlock(
'month_col');
268 include_once(
'./Services/Calendar/classes/class.ilCalendarUtil.php');
271 $this->tpl->setVariable(
'TD_CLASS',
'caltoday');
273 #elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
275 # $this->tpl->setVariable('TD_CLASS','calnow');
279 $this->tpl->setVariable(
'TD_CLASS',
'calstd');
283 $this->tpl->setVariable(
'TD_CLASS',
'calprev');
287 $this->tpl->setVariable(
'TD_CLASS',
'calnext');
290 $this->tpl->parseCurrentBlock();
293 if($counter and !($counter % 7))
295 $this->tpl->setCurrentBlock(
'month_row');
296 $this->tpl->parseCurrentBlock();
305 return $this->tpl->get();
321 foreach($this->scheduler->getByDay($date,$this->timezone) as $item)
323 $this->tpl->setCurrentBlock(
'panel_code');
324 $this->tpl->setVariable(
'NUM',$this->num_appointments);
325 $this->tpl->parseCurrentBlock();
328 if ($item[
'event']->isMilestone())
330 $this->tpl->setCurrentBlock(
'fullday_ms_icon');
331 $this->tpl->setVariable(
'ALT_FD_MS', $this->lng->txt(
"cal_milestone"));
333 $this->tpl->parseCurrentBlock();
336 $this->tpl->setCurrentBlock(
'il_event');
338 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentPanelGUI.php');
340 $this->tpl->setVariable(
'PANEL_NUM',$this->num_appointments);
342 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
343 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id',$item[
'event']->getEntryId());
344 $this->tpl->setVariable(
'EVENT_EDIT_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'edit'));
345 $this->tpl->setVariable(
'EVENT_NUM',$item[
'event']->getEntryId());
347 $compl = ($item[
'event']->isMilestone() && $item[
'event']->getCompletion() > 0)
348 ?
" (".$item[
'event']->getCompletion().
"%)"
351 if($item[
'event']->isFullDay())
353 $title = $item[
'event']->getPresentationTitle().$compl;
357 switch($this->user_settings->getTimeFormat())
360 $title = $item[
'event']->getStart()->get(
IL_CAL_FKT_DATE,
'H:i',$this->timezone);
364 $title = $item[
'event']->getStart()->get(
IL_CAL_FKT_DATE,
'h:ia',$this->timezone);
368 $title .= (
' '.$item[
'event']->getPresentationTitle());
370 $this->tpl->setVariable(
'EVENT_TITLE',$title);
371 $color = $this->app_colors->getColorByAppointment($item[
'event']->getEntryId());
372 $this->tpl->setVariable(
'EVENT_BGCOLOR',$color);
373 $this->tpl->setVariable(
'EVENT_ADD_STYLES',$item[
'event']->getPresentationStyle());
376 $this->tpl->parseCurrentBlock();
378 $this->num_appointments++;