/** * Get overview. */ function getOverview() { global $ilUser, $lng, $ilCtrl; include_once './Services/Calendar/classes/class.ilCalendarSchedule.php'; $schedule = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_INBOX); $events = $schedule->getChangedEvents(true); $ilCtrl->setParameterByClass('ilcalendarinboxgui', 'changed', 1); $link = '<a href=' . $ilCtrl->getLinkTargetByClass('ilcalendarinboxgui', '') . '>'; $ilCtrl->setParameterByClass('ilcalendarinboxgui', 'changed', ''); $text = '<div class="small">' . (int) count($events) . " " . $lng->txt("cal_changed_events_header") . "</div>"; $end_link = '</a>'; return $link . $text . $end_link; }
/** * show inbox * * @access protected * @return */ protected function inbox() { global $ilCtrl; $this->tpl = new ilTemplate('tpl.inbox.html', true, true, 'Services/Calendar'); include_once './Services/Calendar/classes/class.ilCalendarInboxSharedTableGUI.php'; include_once './Services/Calendar/classes/class.ilCalendarShared.php'; $table = new ilCalendarInboxSharedTableGUI($this, 'inbox'); $table->setCalendars(ilCalendarShared::getSharedCalendarsForUser()); if ($table->parse()) { $this->tpl->setVariable('SHARED_CAL_TABLE', $table->getHTML()); } include_once './Services/Calendar/classes/class.ilCalendarChangedAppointmentsTableGUI.php'; $table_gui = new ilCalendarChangedAppointmentsTableGUI($this, 'inbox'); $schedule = new ilCalendarSchedule(new ilDate(time(), IL_CAL_UNIX), ilCalendarSchedule::TYPE_INBOX); $schedule->setEventsLimit($table_gui->getLimit()); $schedule->addSubitemCalendars(true); $schedule->calculate(); if (isset($_GET['changed'])) { $title = $this->lng->txt('cal_changed_events_header'); $events = $schedule->getChangedEvents(true); $ilCtrl->setParameter($this, 'changed', 1); } else { // type inbox will show upcoming events (today or later) $title = $this->lng->txt('cal_upcoming_events_header'); //$events = $schedule->getEvents(); $events = $schedule->getScheduledEvents(); } $table_gui->setTitle($title); $table_gui->setAppointments($events); $this->tpl->setVariable('CHANGED_TABLE', $table_gui->getHTML()); }