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');
66 $this->seed = $seed_date;
71 $this->tabs_gui = $ilTabs;
72 $this->tabs_gui->setSubTabActive(
'app_month');
77 $this->timezone = $ilUser->getTimeZone();
90 $this->ctrl->saveParameter($this,
'seed');
92 $next_class = $ilCtrl->getNextClass();
95 case 'ilcalendarappointmentgui':
96 $this->ctrl->setReturn($this,
'');
97 $this->tabs_gui->setSubTabActive(
$_SESSION[
'cal_last_tab']);
99 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
105 $this->ctrl->forwardCommand($app);
109 $time = microtime(
true);
110 $cmd = $this->ctrl->getCmd(
"show");
112 $tpl->setContent($this->tpl->get());
114 #echo "Zeit: ".(microtime(true) - $time);
128 global
$tpl, $ilUser;
130 $this->tpl =
new ilTemplate(
'tpl.month_view.html',
true,
true,
'Services/Calendar');
132 include_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
137 $this->tpl->setVariable(
'NAVIGATION',$navigation->getHTML());
139 for($i = (
int) $this->user_settings->getWeekStart();$i < (7 + (int) $this->user_settings->getWeekStart());$i++)
141 $this->tpl->setCurrentBlock(
'month_header_col');
143 $this->tpl->parseCurrentBlock();
146 if(isset(
$_GET[
"bkid"]))
148 $user_id =
$_GET[
"bkid"];
149 $disable_empty =
true;
152 elseif($ilUser->getId() == ANONYMOUS_USER_ID)
154 $user_id = $ilUser->getId();
155 $disable_empty =
false;
160 $user_id = $ilUser->getId();
161 $disable_empty =
false;
164 include_once(
'Services/Calendar/classes/class.ilCalendarSchedule.php');
166 $this->scheduler->addSubitemCalendars(
true);
167 $this->scheduler->calculate();
169 include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
175 $this->user_settings->getWeekStart())->
get() as $date)
182 if ($settings->getEnableGroupMilestones())
184 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
185 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'seed',$this->seed->get(
IL_CAL_DATE));
186 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'idate',$date->get(
IL_CAL_DATE));
187 $this->tpl->setCurrentBlock(
"new_ms");
189 $this->tpl->setVariable(
'H_NEW_MS_ALT',$this->lng->txt(
'cal_new_ms'));
190 $this->tpl->setVariable(
'NEW_MS_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'addMilestone'));
191 $this->tpl->parseCurrentBlock();
194 $this->tpl->setCurrentBlock(
"new_app");
195 #$this->tpl->setVariable('NEW_SRC',ilUtil::getImagePath('new.gif','calendar'));
197 $this->tpl->setVariable(
'NEW_ALT',$this->lng->txt(
'cal_new_app'));
198 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
199 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'idate',$date->get(
IL_CAL_DATE));
200 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'seed',$this->seed->get(
IL_CAL_DATE));
201 $this->tpl->setVariable(
'ADD_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'add'));
202 $this->tpl->parseCurrentBlock();
211 $month_day =
'1 '.ilCalendarUtil::_numericMonthToString($month,
false);
218 if(!$disable_empty || $has_events)
220 $this->tpl->setCurrentBlock(
'month_day_link');
221 $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
222 $this->ctrl->setParameterByClass(
'ilcalendardaygui',
'seed',$date->get(
IL_CAL_DATE));
223 $this->tpl->setVariable(
'OPEN_DAY_VIEW',$this->ctrl->getLinkTargetByClass(
'ilcalendardaygui',
''));
224 $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
228 $this->tpl->setCurrentBlock(
'month_day_no_link');
231 $this->tpl->setVariable(
'MONTH_DAY',$month_day);
233 $this->tpl->parseCurrentBlock();
236 $this->tpl->setCurrentBlock(
'month_col');
238 include_once(
'./Services/Calendar/classes/class.ilCalendarUtil.php');
241 $this->tpl->setVariable(
'TD_CLASS',
'caltoday');
243 #elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
245 # $this->tpl->setVariable('TD_CLASS','calnow');
249 $this->tpl->setVariable(
'TD_CLASS',
'calstd');
253 $this->tpl->setVariable(
'TD_CLASS',
'calprev');
257 $this->tpl->setVariable(
'TD_CLASS',
'calnext');
260 $this->tpl->parseCurrentBlock();
263 if($counter and !($counter % 7))
265 $this->tpl->setCurrentBlock(
'month_row');
266 $this->tpl->parseCurrentBlock();
279 global $tree, $ilUser;
282 foreach($this->scheduler->getByDay($date,$this->timezone) as $item)
285 $booking_subtitle =
false;
288 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
292 $booking_subtitle =
' '.$item[
'event']->getTitle();
293 if($entry->isOwner())
295 $max = (int)$entry->getNumberOfBookings();
296 $current = (int)$entry->getCurrentNumberOfBookings($item[
'event']->getEntryId());
299 $booking_subtitle .=
' ('.$current.
'/'.$max.
')';
301 else if($current == $max)
303 $booking_subtitle .=
' ('.$this->lng->txt(
'cal_booked_out').
')';
307 $booking_subtitle .=
' ('.$this->lng->txt(
'cal_book_free').
')';
310 else if($entry->hasBooked($item[
'event']->getEntryId()))
312 $booking_subtitle .=
' ('.$this->lng->txt(
'cal_date_booked').
')';
317 $this->tpl->setCurrentBlock(
'panel_code');
318 $this->tpl->setVariable(
'NUM',$this->num_appointments);
319 $this->tpl->parseCurrentBlock();
322 if ($item[
'event']->isMilestone())
324 $this->tpl->setCurrentBlock(
'fullday_ms_icon');
325 $this->tpl->setVariable(
'ALT_FD_MS', $this->lng->txt(
"cal_milestone"));
327 $this->tpl->parseCurrentBlock();
330 $this->tpl->setCurrentBlock(
'il_event');
332 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentPanelGUI.php');
334 $this->tpl->setVariable(
'PANEL_NUM',$this->num_appointments);
336 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
337 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id',$item[
'event']->getEntryId());
338 $this->tpl->setVariable(
'EVENT_EDIT_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'edit'));
339 $this->tpl->setVariable(
'EVENT_NUM',$item[
'event']->getEntryId());
341 $compl = ($item[
'event']->isMilestone() && $item[
'event']->getCompletion() > 0)
342 ?
" (".$item[
'event']->getCompletion().
"%)"
345 if($item[
'event']->isFullDay())
347 $title = $item[
'event']->getPresentationTitle().$compl;
351 switch($this->user_settings->getTimeFormat())
362 if(!$booking_subtitle)
364 $title .= (
' '.$item[
'event']->getPresentationTitle());
368 $title .= $booking_subtitle;
371 $this->tpl->setVariable(
'EVENT_TITLE',
$title);
372 $color = $this->app_colors->getColorByAppointment($item[
'event']->getEntryId());
373 $this->tpl->setVariable(
'EVENT_BGCOLOR',$color);
376 $this->tpl->parseCurrentBlock();
378 $this->num_appointments++;