4include_once(
'Services/Calendar/classes/class.ilDate.php');
 
    5include_once(
'Services/Calendar/classes/class.ilCalendarHeaderNavigationGUI.php');
 
    6include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
 
    7include_once(
'Services/Calendar/classes/class.ilCalendarAppointmentColors.php');
 
    8include_once(
'Services/Calendar/classes/class.ilCalendarViewGUI.php');
 
   47        $this->tabs_gui->setSubTabActive(
'app_month');
 
   53        $this->timezone = $this->
user->getTimeZone();
 
   69        $this->ctrl->saveParameter($this, 
'seed');
 
   71        $next_class = 
$ilCtrl->getNextClass();
 
   72        switch ($next_class) {
 
   73            case "ilcalendarappointmentpresentationgui":
 
   74                $this->ctrl->setReturn($this, 
"");
 
   75                include_once(
"./Services/Calendar/classes/class.ilCalendarAppointmentPresentationGUI.php");
 
   77                $this->ctrl->forwardCommand($gui);
 
   79            case 'ilcalendarappointmentgui':
 
   80                $this->ctrl->setReturn($this, 
'');
 
   81                $this->tabs_gui->setSubTabActive(
$_SESSION[
'cal_last_tab']);
 
   83                include_once(
'./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
 
   89                $this->ctrl->forwardCommand($app);
 
   93                $time = microtime(
true);
 
   94                $cmd = $this->ctrl->getCmd(
"show");
 
   96                $tpl->setContent($this->tpl->get());
 
   98                #echo "Zeit: ".(microtime(true) - $time);
 
  111        $this->schedule_filters[] = $a_filter;
 
  120    public function show()
 
  128        $renderer = 
$DIC->ui()->renderer();
 
  130        $this->tpl = 
new ilTemplate(
'tpl.month_view.html', 
true, 
true, 
'Services/Calendar');
 
  132        include_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
 
  136        $this->tpl->setVariable(
'NAVIGATION', $navigation->getHTML());
 
  138        for (
$i = (
int) $this->user_settings->getWeekStart();
$i < (7 + (
int) $this->user_settings->getWeekStart());
$i++) {
 
  139            $this->tpl->setCurrentBlock(
'month_header_col');
 
  141            $this->tpl->parseCurrentBlock();
 
  144        if (isset(
$_GET[
"bkid"])) {
 
  145            $user_id = 
$_GET[
"bkid"];
 
  146            $disable_empty = 
true;
 
  149            if ($this->
user->getId() == ANONYMOUS_USER_ID) {
 
  150                $user_id = $this->
user->getId();
 
  151                $disable_empty = 
false;
 
  154                $user_id = $this->
user->getId();
 
  155                $disable_empty = 
false;
 
  160        $is_portfolio_embedded = 
false;
 
  163            $is_portfolio_embedded = 
true;
 
  166        include_once(
'Services/Calendar/classes/class.ilCalendarSchedule.php');
 
  168        $this->scheduler->addSubitemCalendars(
true);
 
  169        if (
sizeof($this->schedule_filters)) {
 
  170            foreach ($this->schedule_filters as $filter) {
 
  171                $this->scheduler->addFilter($filter);
 
  174        $this->scheduler->calculate();
 
  176        include_once(
'Services/Calendar/classes/class.ilCalendarSettings.php');
 
  183            $this->user_settings->getWeekStart()
 
  186            $has_events = (bool) $this->
showEvents($date);
 
  188            if (!$this->view_with_appointments && $has_events) {
 
  189                $this->view_with_appointments = 
true;
 
  193                $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
 
  194                $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'idate', $date->get(
IL_CAL_DATE));
 
  195                $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'seed', $this->seed->get(
IL_CAL_DATE));
 
  196                $new_app_url = $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui', 
'add');
 
  198                if ($settings->getEnableGroupMilestones()) {
 
  199                    $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
 
  200                    $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'seed', $this->seed->get(
IL_CAL_DATE));
 
  201                    $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'idate', $date->get(
IL_CAL_DATE));
 
  202                    $new_ms_url = $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui', 
'addMilestone');
 
  204                    $this->tpl->setCurrentBlock(
"new_ms");
 
  205                    $this->tpl->setVariable(
'DD_ID', $date->get(
IL_CAL_UNIX));
 
  206                    $this->tpl->setVariable(
'DD_TRIGGER', $renderer->render(
$ui_factory->glyph()->add()));
 
  207                    $this->tpl->setVariable(
'URL_DD_NEW_APP', $new_app_url);
 
  208                    $this->tpl->setVariable(
'TXT_DD_NEW_APP', $this->lng->txt(
'cal_new_app'));
 
  209                    $this->tpl->setVariable(
'URL_DD_NEW_MS', $new_ms_url);
 
  210                    $this->tpl->setVariable(
'TXT_DD_NEW_MS', $this->lng->txt(
'cal_new_ms'));
 
  211                    $this->tpl->parseCurrentBlock();
 
  213                    $this->tpl->setCurrentBlock(
"new_app");
 
  214                    $this->tpl->setVariable(
'NEW_GLYPH', $renderer->render(
$ui_factory->glyph()->add($new_app_url)));
 
  215                    $this->tpl->parseCurrentBlock();
 
  229            if (!$is_portfolio_embedded &&
 
  230                (!$disable_empty || $has_events)) {
 
  231                $this->tpl->setCurrentBlock(
'month_day_link');
 
  232                $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
 
  233                $this->ctrl->setParameterByClass(
'ilcalendardaygui', 
'seed', $date->get(
IL_CAL_DATE));
 
  234                $this->tpl->setVariable(
'OPEN_DAY_VIEW', $this->ctrl->getLinkTargetByClass(
'ilcalendardaygui', 
''));
 
  235                $this->ctrl->clearParametersByClass(
'ilcalendardaygui');
 
  237                $this->tpl->setCurrentBlock(
'month_day_no_link');
 
  240            $this->tpl->setVariable(
'MONTH_DAY', $month_day);
 
  242            $this->tpl->parseCurrentBlock();
 
  245            $this->tpl->setCurrentBlock(
'month_col');
 
  247            include_once(
'./Services/Calendar/classes/class.ilCalendarUtil.php');
 
  249                $this->tpl->setVariable(
'TD_CLASS', 
'caltoday');
 
  251            #elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY)) 
  253            #   $this->tpl->setVariable('TD_CLASS','calnow'); 
  256                $this->tpl->setVariable(
'TD_CLASS', 
'calstd');
 
  258                $this->tpl->setVariable(
'TD_CLASS', 
'calprev');
 
  260                $this->tpl->setVariable(
'TD_CLASS', 
'calnext');
 
  263            $this->tpl->parseCurrentBlock();
 
  266            if ($counter and !($counter % 7)) {
 
  267                $this->tpl->setCurrentBlock(
'month_row');
 
  268                $this->tpl->parseCurrentBlock();
 
  277        return $this->tpl->get();
 
  298        foreach ($this->scheduler->getByDay($date, $this->timezone) as $item) {
 
  299            $this->ctrl->clearParametersByClass(
'ilcalendarappointmentgui');
 
  300            $this->ctrl->setParameterByClass(
'ilcalendarappointmentgui', 
'app_id', $item[
'event']->getEntryId());
 
  302            $event_tpl = 
new ilTemplate(
'tpl.month_event_view.html', 
true, 
true, 
'Services/Calendar');
 
  304            if ($item[
'event']->isMilestone()) {
 
  305                $event_tpl->setCurrentBlock(
'fullday_ms_icon');
 
  306                $event_tpl->setVariable(
'ALT_FD_MS', $this->lng->txt(
"cal_milestone"));
 
  308                $event_tpl->parseCurrentBlock();
 
  313            $compl = ($item[
'event']->isMilestone() && $item[
'event']->getCompletion() > 0)
 
  314                ? 
" (" . $item[
'event']->getCompletion() . 
"%)" 
  317            if (!$item[
'event']->isFullDay()) {
 
  318                switch ($this->user_settings->getTimeFormat()) {
 
  334            $event_html = 
$title . $compl;
 
  336            $event_tpl->setCurrentBlock(
'il_event');
 
  339            $event_tpl->setVariable(
'EVENT_EDIT_LINK', $this->ctrl->getLinkTargetByClass(
'ilcalendarappointmentgui', 
'edit'));
 
  340            $event_tpl->setVariable(
'EVENT_NUM', $item[
'event']->getEntryId());
 
  341            $event_tpl->setVariable(
'EVENT_CONTENT', $event_html);
 
  342            $color = $this->app_colors->getColorByAppointment($item[
'event']->getEntryId());
 
  343            $event_tpl->setVariable(
'EVENT_BGCOLOR', $color);
 
  344            $event_tpl->setVariable(
'EVENT_ADD_STYLES', $item[
'event']->getPresentationStyle());
 
  349            if ($event_html_by_plugin = $this->
getContentByPlugins($item[
'event'], $item[
'dstart'], $event_html, $event_tpl)) {
 
  350                $event_body_html = $event_html_by_plugin;
 
  352                $event_tpl->parseCurrentBlock();
 
  353                $event_body_html = $event_tpl->get();
 
  356            $this->tpl->setCurrentBlock(
"event_nfd");
 
  357            $this->tpl->setVariable(
"EVENT_CONTENT", $event_body_html);
 
  358            $this->tpl->parseCurrentBlock();
 
  360            $this->num_appointments++;
 
An exception for terminatinating execution or to throw for unit testing.
show()
returns the content of IniFile @access public
Administrate calendar appointments.
static _getInstance(ilDate $seed, $a_app)
get singleton instance
const MODE_PORTFOLIO_CONSULTATION
static _getInstance($a_usr_id=0)
get singleton instance
__construct(ilDate $seed_date)
Constructor.
executeCommand()
Execute command.
addScheduleFilter(ilCalendarScheduleFilter $a_filter)
Add schedule filter.
showEvents(ilDate $date)
Show events.
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
static _getInstance()
get singleton instance
static _getInstanceByUserId($a_user_id)
get singleton instance
static _isToday($date)
check if a date is today
static _numericDayToString($a_day, $a_long=true)
get
static _buildMonthDayList($a_month, $a_year, $weekstart)
Build a month day list.
static calculateFontColor($a_html_color_code)
Calculate best font color from html hex color code.
static _numericMonthToString($a_month, $a_long=true)
numeric month to string
getAppointmentShyButton($a_calendar_entry, $a_dstart, $a_title_forced="")
getCurrentApp()
Get app for id.
const CAL_PRESENTATION_MONTH
getContentByPlugins($a_cal_entry, $a_start_date, $a_content, $a_tpl)
static _equals(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check if two date are equal.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
special template class to simplify handling of ITX/PEAR
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static initDragDrop()
Init YUI Drag and Drop.
Calendar schedule filter interface.