24 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
25 include_once
'./Services/Calendar/classes/class.ilCalendarCategories.php';
60 $lng->loadLanguageModule(
"dateplaner");
61 include_once(
"./Services/News/classes/class.ilNewsItem.php");
73 $this->
setTitle($lng->txt(
"calendar"));
76 $this->allow_moving =
false;
79 include_once(
'Services/Calendar/classes/class.ilDate.php');
80 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
82 $seed_str = (
$_GET[
"seed"] ==
"")
86 if (
$_GET[
"seed"] !=
"")
102 $tpl->addCSS(
"./Services/Calendar/css/calendar.css");
104 $tpl->addCSS(
"./Services/Calendar/templates/default/delos.css");
134 $cmd_class = $ilCtrl->getCmdClass();
136 if ($cmd_class ==
"ilcalendarappointmentgui" ||
137 $cmd_class ==
"ilcalendardaygui" ||
138 $cmd_class ==
"ilcalendarweekgui" ||
139 $cmd_class ==
"ilcalendarmonthgui" ||
140 $cmd_class ==
"ilcalendarinboxgui" ||
141 $_GET[
'cmd'] ==
'showCalendarSubscription')
146 switch($ilCtrl->getCmd())
165 $next_class = $ilCtrl->getNextClass();
166 $cmd = $ilCtrl->getCmd(
"getHTML");
172 case "ilcalendarappointmentgui":
173 include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
175 $ilCtrl->forwardCommand($app_gui);
178 case "ilcalendardaygui":
179 $ilTabs->setSubTabActive(
'app_day');
180 include_once(
'./Services/Calendar/classes/class.ilCalendarDayGUI.php');
182 $ilCtrl->forwardCommand($day_gui);
185 case "ilcalendarweekgui":
186 $ilTabs->setSubTabActive(
'app_week');
187 include_once(
'./Services/Calendar/classes/class.ilCalendarWeekGUI.php');
189 $ilCtrl->forwardCommand($week_gui);
192 case "ilcalendarmonthgui":
193 $ilTabs->setSubTabActive(
'app_month');
194 include_once(
'./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
196 $ilCtrl->forwardCommand($month_gui);
199 case "ilcalendarinboxgui":
200 include_once(
'./Services/Calendar/classes/class.ilCalendarInboxGUI.php');
202 $ilCtrl->forwardCommand($inbox);
206 return $this->
$cmd();
217 $this->enable_edit = $a_enable_edit;
227 return $this->enable_edit;
238 "Services/Calendar");
258 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
259 $a_tpl->setCurrentBlock(
'month_header_col');
260 $a_tpl->setVariable(
'TXT_WEEKDAY', $lng->txt(
"cal_week_abbrev"));
261 $a_tpl->parseCurrentBlock();
262 for($i = (
int) $this->user_settings->getWeekStart();$i < (7 + (int) $this->user_settings->getWeekStart());$i++)
264 $a_tpl->setCurrentBlock(
'month_header_col');
266 $a_tpl->parseCurrentBlock();
269 include_once(
'Services/Calendar/classes/class.ilCalendarSchedule.php');
271 $this->scheduler->addSubitemCalendars(
true);
272 $this->scheduler->calculate();
277 $this->user_settings->getWeekStart())->
get() as $date)
283 $a_tpl->setCurrentBlock(
'month_col');
285 if(count($this->scheduler->getByDay($date,$ilUser->getTimeZone())))
287 $a_tpl->setVariable(
'DAY_CLASS',
'calminiapp');
288 #$a_tpl->setVariable('TD_CLASS','calminiapp');
290 include_once(
'./Services/Calendar/classes/class.ilCalendarUtil.php');
293 $a_tpl->setVariable(
'TD_CLASS',
'calminitoday');
295 #elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
297 # $a_tpl->setVariable('TD_CLASS','calmininow');
301 $a_tpl->setVariable(
'TD_CLASS',
'calministd');
305 $a_tpl->setVariable(
'TD_CLASS',
'calminiprev');
309 $a_tpl->setVariable(
'TD_CLASS',
'calmininext');
317 $ilCtrl->clearParametersByClass(
'ilcalendardaygui');
318 $ilCtrl->setParameterByClass(
'ilcalendardaygui',
'seed',$date->get(
IL_CAL_DATE));
319 $a_tpl->setVariable(
'OPEN_DAY_VIEW', $ilCtrl->getLinkTargetByClass(
'ilcalendardaygui',
''));
320 $ilCtrl->clearParametersByClass(
'ilcalendardaygui');
322 $a_tpl->setVariable(
'MONTH_DAY',$month_day);
330 $a_tpl->parseCurrentBlock();
332 if($counter and !($counter % 7))
334 $a_tpl->setCurrentBlock(
'month_row');
335 $ilCtrl->clearParametersByClass(
'ilcalendarweekgui');
336 $ilCtrl->setParameterByClass(
'ilcalendarweekgui',
'seed',$date->get(
IL_CAL_DATE));
337 $a_tpl->setVariable(
'OPEN_WEEK_VIEW', $ilCtrl->getLinkTargetByClass(
'ilcalendarweekgui',
''));
338 $ilCtrl->clearParametersByClass(
'ilcalendarweekgui');
339 $a_tpl->setVariable(
'TD_CLASS',
'calminiweek');
340 $a_tpl->setVariable(
'WEEK',
342 $a_tpl->parseCurrentBlock();
345 $a_tpl->setCurrentBlock(
'mini_month');
346 $a_tpl->setVariable(
'TXT_MONTH_OVERVIEW', $lng->txt(
"cal_month_overview"));
347 $a_tpl->setVariable(
'TXT_MONTH',
350 $myseed = clone($this->seed);
351 $ilCtrl->setParameterByClass(
'ilcalendarmonthgui',
'seed',$myseed->get(
IL_CAL_DATE));
352 $a_tpl->setVariable(
'OPEN_MONTH_VIEW',$ilCtrl->getLinkTargetByClass(
'ilcalendarmonthgui',
''));
355 $ilCtrl->setParameter($this,
'seed',$myseed->get(
IL_CAL_DATE));
358 $a_tpl->setVariable(
'BL_ID', $this->
getBlockId());
360 $a_tpl->setVariable(
'PREV_MONTH',
361 $ilCtrl->getLinkTarget($this,
"setSeed"));
362 $a_tpl->setVariable(
'PREV_MONTH_ASYNC',
363 $ilCtrl->getLinkTarget($this,
"setSeed",
"",
true));
366 $ilCtrl->setParameter($this,
'seed',$myseed->get(
IL_CAL_DATE));
367 $a_tpl->setVariable(
'NEXT_MONTH',
368 $ilCtrl->getLinkTarget($this,
"setSeed"));
369 $a_tpl->setVariable(
'NEXT_MONTH_ASYNC',
370 $ilCtrl->getLinkTarget($this,
"setSeed",
"",
true));
372 $ilCtrl->setParameter($this,
'seed',
"");
373 $a_tpl->parseCurrentBlock();
389 #if ($this->getEnableEdit())
395 $this->ctrl->getLinkTarget($this,
'showCalendarSubscription'),
396 $lng->txt(
'ical_export'),
405 $ilAccess->checkAccess(
'edit_event',
'',(
int)
$_GET[
'ref_id']))
408 $ilCtrl->setParameter($this,
"add_mode",
"block");
410 $ilCtrl->getLinkTargetByClass(
"ilCalendarAppointmentGUI",
412 $lng->txt(
"add_appointment"));
413 $ilCtrl->setParameter($this,
"add_mode",
"");
419 $ilCtrl->getLinkTarget($this,
"editSettings"),
420 $lng->txt(
"settings"));
423 $ilCtrl->setParameterByClass(
"ilcolumngui",
"seed", $_GET[
"seed"]);
425 $ilCtrl->setParameterByClass(
"ilcolumngui",
"seed",
"");
446 include_once(
'./Services/Calendar/classes/class.ilCalendarSchedule.php');
448 $events = $schedule->getChangedEvents(
true);
450 $link =
'<a href='.$ilCtrl->getLinkTargetByClass(
'ilcalendarinboxgui',
'').
'>';
451 $text =
'<div class="small">'.((int) count($events)).
" ".$lng->txt(
"cal_changed_events_header").
"</div>";
454 return $link.$text.$end_link;
461 $a_content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
462 $lng->txt(
"close"),
true);
476 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
489 $ilTabs->clearSubTabs();
496 $ilTabs->addSubTabTarget(
'app_day',$this->ctrl->getLinkTargetByClass(
'ilCalendarDayGUI',
''));
497 $ilTabs->addSubTabTarget(
'app_week',$this->ctrl->getLinkTargetByClass(
'ilCalendarWeekGUI',
''));
498 $ilTabs->addSubTabTarget(
'app_month',$this->ctrl->getLinkTargetByClass(
'ilCalendarMonthGUI',
''));
513 if ($ilCtrl->isAsynch())
531 $ilCtrl->returnToParent($this);
537 global
$lng, $ilUser;
539 $tpl =
new ilTemplate(
'tpl.show_calendar_subscription.html',
true,
true,
'Services/Calendar');
541 $tpl->setVariable(
'TXT_TITLE',$lng->txt(
'cal_subscription_header'));
542 $tpl->setVariable(
'TXT_INFO',$lng->txt(
'cal_subscription_info'));
543 $tpl->setVariable(
'TXT_CAL_URL',$lng->txt(
'cal_subscription_url'));
545 include_once
'./Services/Calendar/classes/class.ilCalendarAuthenticationToken.php';
569 $token->setCalendar($calendar);
570 $hash = $token->add();
572 $url = ILIAS_HTTP_PATH.
'/calendar.php?client_id='.CLIENT_ID.
'&token='.$hash;
574 $tpl->setVariable(
'VAL_CAL_URL',$url);
575 $tpl->setVariable(
'VAL_CAL_URL_TXT',$url);
577 include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
579 $content_block->setContent(
$tpl->get());
580 $content_block->setTitle($lng->txt(
"calendar"));
581 #$content_block->setImage(ilUtil::getImagePath("icon_news.gif"));
582 $content_block->addHeaderCommand($this->ctrl->getParentReturn($this),
583 $lng->txt(
"selected_items_back"));
585 return $content_block->getHTML();