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;
154 $user_id = $ilUser->getId();
155 $disable_empty =
false;
158 include_once(
'Services/Calendar/classes/class.ilCalendarSchedule.php');
160 $this->scheduler->addSubitemCalendars(
true);
161 $this->scheduler->calculate();
163 include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
169 $this->user_settings->getWeekStart())->
get() as $date)
176 if ($settings->getEnableGroupMilestones())
178 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
179 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'seed',$this->seed->get(
IL_CAL_DATE));
180 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'idate',$date->get(
IL_CAL_DATE));
181 $this->tpl->setCurrentBlock(
"new_ms");
183 $this->tpl->setVariable(
'H_NEW_MS_ALT',$this->lng->txt(
'cal_new_ms'));
184 $this->tpl->setVariable(
'NEW_MS_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'addMilestone'));
185 $this->tpl->parseCurrentBlock();
188 $this->tpl->setCurrentBlock(
"new_app");
189 #$this->tpl->setVariable('NEW_SRC',ilUtil::getImagePath('new.gif','calendar'));
191 $this->tpl->setVariable(
'NEW_ALT',$this->lng->txt(
'cal_new_app'));
192 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
193 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'idate',$date->get(
IL_CAL_DATE));
194 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'seed',$this->seed->get(
IL_CAL_DATE));
195 $this->tpl->setVariable(
'ADD_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'add'));
196 $this->tpl->parseCurrentBlock();
205 $month_day =
'1 '.ilCalendarUtil::_numericMonthToString($month,
false);
212 if(!$disable_empty || $has_events)
214 $this->tpl->setCurrentBlock(
'month_day_link');
215 $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
216 $this->ctrl->setParameterByClass(
'ilcalendardaygui',
'seed',$date->get(
IL_CAL_DATE));
217 $this->tpl->setVariable(
'OPEN_DAY_VIEW',$this->ctrl->getLinkTargetByClass(
'ilcalendardaygui',
''));
218 $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
222 $this->tpl->setCurrentBlock(
'month_day_no_link');
225 $this->tpl->setVariable(
'MONTH_DAY',$month_day);
227 $this->tpl->parseCurrentBlock();
230 $this->tpl->setCurrentBlock(
'month_col');
232 include_once(
'./Services/Calendar/classes/class.ilCalendarUtil.php');
235 $this->tpl->setVariable(
'TD_CLASS',
'caltoday');
237 #elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
239 # $this->tpl->setVariable('TD_CLASS','calnow');
243 $this->tpl->setVariable(
'TD_CLASS',
'calstd');
247 $this->tpl->setVariable(
'TD_CLASS',
'calprev');
251 $this->tpl->setVariable(
'TD_CLASS',
'calnext');
254 $this->tpl->parseCurrentBlock();
257 if($counter and !($counter % 7))
259 $this->tpl->setCurrentBlock(
'month_row');
260 $this->tpl->parseCurrentBlock();
273 global $tree, $ilUser;
276 foreach($this->scheduler->getByDay($date,$this->timezone) as $item)
279 $booking_subtitle =
false;
282 include_once
'Services/Booking/classes/class.ilBookingEntry.php';
286 $booking_subtitle =
' '.$item[
'event']->getTitle();
287 if($entry->isOwner())
289 $max = (int)$entry->getNumberOfBookings();
290 $current = (int)$entry->getCurrentNumberOfBookings($item[
'event']->getEntryId());
293 $booking_subtitle .=
' ('.$current.
'/'.$max.
')';
295 else if($current == $max)
297 $booking_subtitle .=
' ('.$this->lng->txt(
'cal_booked_out').
')';
301 $booking_subtitle .=
' ('.$this->lng->txt(
'cal_book_free').
')';
304 else if($entry->hasBooked($item[
'event']->getEntryId()))
306 $booking_subtitle .=
' ('.$this->lng->txt(
'cal_date_booked').
')';
311 $this->tpl->setCurrentBlock(
'panel_code');
312 $this->tpl->setVariable(
'NUM',$this->num_appointments);
313 $this->tpl->parseCurrentBlock();
316 if ($item[
'event']->isMilestone())
318 $this->tpl->setCurrentBlock(
'fullday_ms_icon');
319 $this->tpl->setVariable(
'ALT_FD_MS', $this->lng->txt(
"cal_milestone"));
321 $this->tpl->parseCurrentBlock();
324 $this->tpl->setCurrentBlock(
'il_event');
326 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentPanelGUI.php');
328 $this->tpl->setVariable(
'PANEL_NUM',$this->num_appointments);
330 $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
331 $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui',
'app_id',$item[
'event']->getEntryId());
332 $this->tpl->setVariable(
'EVENT_EDIT_LINK',$this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui',
'edit'));
333 $this->tpl->setVariable(
'EVENT_NUM',$item[
'event']->getEntryId());
335 $compl = ($item[
'event']->isMilestone() && $item[
'event']->getCompletion() > 0)
336 ?
" (".$item[
'event']->getCompletion().
"%)"
339 if($item[
'event']->isFullDay())
341 $title = $item[
'event']->getPresentationTitle().$compl;
345 switch($this->user_settings->getTimeFormat())
356 if(!$booking_subtitle)
358 $title .= (
' '.$item[
'event']->getPresentationTitle());
362 $title .= $booking_subtitle;
365 $this->tpl->setVariable(
'EVENT_TITLE',
$title);
366 $color = $this->app_colors->getColorByAppointment($item[
'event']->getEntryId());
367 $this->tpl->setVariable(
'EVENT_BGCOLOR',$color);
370 $this->tpl->parseCurrentBlock();
372 $this->num_appointments++;