ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCalendarMonthGUI Class Reference
+ Collaboration diagram for ilCalendarMonthGUI:

Public Member Functions

 __construct (ilDate $seed_date)
 Constructor.
 executeCommand ()
 Execute command.
 addScheduleFilter (ilCalendarScheduleFilter $a_filter)
 Add schedule filter.
 show ()
 fill data section
 getHTML ()

Protected Member Functions

 showEvents (ilDate $date)
 Show events.

Protected Attributes

 $num_appointments = 1
 $schedule_filters = array()
 $seed = null
 $user_settings = null
 $lng
 $ctrl
 $tabs_gui
 $tpl
 $timezone = 'UTC'

Detailed Description

Constructor & Destructor Documentation

ilCalendarMonthGUI::__construct ( ilDate  $seed_date)

Constructor.

public

Parameters

Definition at line 63 of file class.ilCalendarMonthGUI.php.

References $ilCtrl, $ilUser, $lng, $tpl, and ilCalendarUserSettings\_getInstanceByUserId().

{
global $ilCtrl, $lng, $ilUser,$ilTabs,$tpl;
$this->seed = $seed_date;
$this->tpl = $tpl;
$this->lng = $lng;
$this->ctrl = $ilCtrl;
$this->tabs_gui = $ilTabs;
$this->tabs_gui->setSubTabActive('app_month');
$this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
$this->app_colors = new ilCalendarAppointmentColors($ilUser->getId());
$this->timezone = $ilUser->getTimeZone();
}

+ Here is the call graph for this function:

Member Function Documentation

ilCalendarMonthGUI::addScheduleFilter ( ilCalendarScheduleFilter  $a_filter)

Add schedule filter.

Parameters
ilCalendarScheduleFilter$a_filter

Definition at line 126 of file class.ilCalendarMonthGUI.php.

{
$this->schedule_filters[] = $a_filter;
}
ilCalendarMonthGUI::executeCommand ( )

Execute command.

public

Definition at line 87 of file class.ilCalendarMonthGUI.php.

References $_GET, $_REQUEST, $_SESSION, $cmd, $ilCtrl, $tpl, and IL_CAL_DATE.

{
global $ilCtrl,$tpl;
$this->ctrl->saveParameter($this,'seed');
$next_class = $ilCtrl->getNextClass();
switch($next_class)
{
case 'ilcalendarappointmentgui':
$this->ctrl->setReturn($this,'');
$this->tabs_gui->setSubTabActive($_SESSION['cal_last_tab']);
include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
// initial date for new calendar appointments
$idate = new ilDate($_REQUEST['idate'], IL_CAL_DATE);
$app = new ilCalendarAppointmentGUI($this->seed,$idate,(int) $_GET['app_id']);
$this->ctrl->forwardCommand($app);
break;
default:
$time = microtime(true);
$cmd = $this->ctrl->getCmd("show");
$this->$cmd();
$tpl->setContent($this->tpl->get());
#echo "Zeit: ".(microtime(true) - $time);
break;
}
return true;
}
ilCalendarMonthGUI::getHTML ( )

Definition at line 302 of file class.ilCalendarMonthGUI.php.

References show().

Referenced by showEvents().

{
$this->show();
return $this->tpl->get();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarMonthGUI::show ( )

fill data section

public

Definition at line 137 of file class.ilCalendarMonthGUI.php.

References $_GET, $ilUser, $tpl, ilDateTime\_before(), ilCalendarUtil\_buildMonthDayList(), ilDateTime\_equals(), ilCalendarCategories\_getInstance(), ilCalendarSettings\_getInstance(), ilCalendarUtil\_isToday(), ilCalendarUtil\_numericDayToString(), ilUtil\getImagePath(), IL_CAL_DATE, IL_CAL_FKT_DATE, IL_CAL_MONTH, ilYuiUtil\initDragDrop(), ilYuiUtil\initPanel(), ilCalendarCategories\MODE_PORTFOLIO_CONSULTATION, ilDateTime\MONTH, showEvents(), and ilCalendarSchedule\TYPE_MONTH.

Referenced by getHTML().

{
global $tpl, $ilUser;
$this->tpl = new ilTemplate('tpl.month_view.html',true,true,'Services/Calendar');
include_once('./Services/YUI/classes/class.ilYuiUtil.php');
$navigation = new ilCalendarHeaderNavigationGUI($this,$this->seed,ilDateTime::MONTH);
$this->tpl->setVariable('NAVIGATION',$navigation->getHTML());
for($i = (int) $this->user_settings->getWeekStart();$i < (7 + (int) $this->user_settings->getWeekStart());$i++)
{
$this->tpl->setCurrentBlock('month_header_col');
$this->tpl->setVariable('TXT_WEEKDAY',ilCalendarUtil::_numericDayToString($i,true));
$this->tpl->parseCurrentBlock();
}
if(isset($_GET["bkid"]))
{
$user_id = $_GET["bkid"];
$disable_empty = true;
$no_add = true;
}
else
{
if($ilUser->getId() == ANONYMOUS_USER_ID)
{
$user_id = $ilUser->getId();
$disable_empty = false;
$no_add = true;
}
else
{
$user_id = $ilUser->getId();
$disable_empty = false;
$no_add = false;
}
}
$is_portfolio_embedded = false;
{
$no_add = true;
$is_portfolio_embedded = true;
}
include_once('Services/Calendar/classes/class.ilCalendarSchedule.php');
$this->scheduler = new ilCalendarSchedule($this->seed,ilCalendarSchedule::TYPE_MONTH,$user_id);
$this->scheduler->addSubitemCalendars(true);
if(sizeof($this->schedule_filters))
{
foreach($this->schedule_filters as $filter)
{
$this->scheduler->addFilter($filter);
}
}
$this->scheduler->calculate();
include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
$counter = 0;
foreach(ilCalendarUtil::_buildMonthDayList($this->seed->get(IL_CAL_FKT_DATE,'m'),
$this->seed->get(IL_CAL_FKT_DATE,'Y'),
$this->user_settings->getWeekStart())->get() as $date)
{
$counter++;
$has_events = (bool)$this->showEvents($date);
if(!$no_add)
{
if ($settings->getEnableGroupMilestones())
{
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->seed->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui','idate',$date->get(IL_CAL_DATE));
$this->tpl->setCurrentBlock("new_ms");
$this->tpl->setVariable('H_NEW_MS_SRC',ilUtil::getImagePath('ms_add.png'));
$this->tpl->setVariable('H_NEW_MS_ALT',$this->lng->txt('cal_new_ms'));
$this->tpl->setVariable('NEW_MS_LINK',$this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui','addMilestone'));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("new_app");
#$this->tpl->setVariable('NEW_SRC',ilUtil::getImagePath('new.png','calendar'));
$this->tpl->setVariable('NEW_SRC',ilUtil::getImagePath('date_add.png'));
$this->tpl->setVariable('NEW_ALT',$this->lng->txt('cal_new_app'));
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui','idate',$date->get(IL_CAL_DATE));
$this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->seed->get(IL_CAL_DATE));
$this->tpl->setVariable('ADD_LINK',$this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui','add'));
$this->tpl->parseCurrentBlock();
}
$day = $date->get(IL_CAL_FKT_DATE,'j');
$month = $date->get(IL_CAL_FKT_DATE,'n');
if($day == 1)
{
$month_day = '1 '.ilCalendarUtil::_numericMonthToString($month,false);
}
else
{
$month_day = $day;
}
if(!$is_portfolio_embedded &&
(!$disable_empty || $has_events))
{
$this->tpl->setCurrentBlock('month_day_link');
$this->ctrl->clearParametersByClass('ilcalendardaygui');
$this->ctrl->setParameterByClass('ilcalendardaygui','seed',$date->get(IL_CAL_DATE));
$this->tpl->setVariable('OPEN_DAY_VIEW',$this->ctrl->getLinkTargetByClass('ilcalendardaygui',''));
$this->ctrl->clearParametersByClass('ilcalendardaygui');
}
else
{
$this->tpl->setCurrentBlock('month_day_no_link');
}
$this->tpl->setVariable('MONTH_DAY',$month_day);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('month_col');
include_once('./Services/Calendar/classes/class.ilCalendarUtil.php');
{
$this->tpl->setVariable('TD_CLASS','caltoday');
}
#elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
#{
# $this->tpl->setVariable('TD_CLASS','calnow');
#}
elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_MONTH))
{
$this->tpl->setVariable('TD_CLASS','calstd');
}
elseif(ilDateTime::_before($date,$this->seed,IL_CAL_MONTH))
{
$this->tpl->setVariable('TD_CLASS','calprev');
}
else
{
$this->tpl->setVariable('TD_CLASS','calnext');
}
$this->tpl->parseCurrentBlock();
if($counter and !($counter % 7))
{
$this->tpl->setCurrentBlock('month_row');
$this->tpl->parseCurrentBlock();
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCalendarMonthGUI::showEvents ( ilDate  $date)
protected

Show events.

protected

Definition at line 314 of file class.ilCalendarMonthGUI.php.

References $ilUser, ilCalendarAppointmentPanelGUI\_getInstance(), ilCalendarUtil\calculateFontColor(), getHTML(), ilUtil\getImagePath(), IL_CAL_FKT_DATE, ilCalendarSettings\TIME_FORMAT_12, and ilCalendarSettings\TIME_FORMAT_24.

Referenced by show().

{
global $tree, $ilUser;
$count = 0;
foreach($this->scheduler->getByDay($date,$this->timezone) as $item)
{
$this->tpl->setCurrentBlock('panel_code');
$this->tpl->setVariable('NUM',$this->num_appointments);
$this->tpl->parseCurrentBlock();
// milestone icon
if ($item['event']->isMilestone())
{
$this->tpl->setCurrentBlock('fullday_ms_icon');
$this->tpl->setVariable('ALT_FD_MS', $this->lng->txt("cal_milestone"));
$this->tpl->setVariable('SRC_FD_MS', ilUtil::getImagePath("icon_ms_s.png"));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('il_event');
include_once('./Services/Calendar/classes/class.ilCalendarAppointmentPanelGUI.php');
$this->tpl->setVariable('PANEL_DATA',ilCalendarAppointmentPanelGUI::_getInstance($this->seed)->getHTML($item));
$this->tpl->setVariable('PANEL_NUM',$this->num_appointments);
$this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
$this->ctrl->setParameterByClass('ilcalendarappointmentgui','app_id',$item['event']->getEntryId());
$this->tpl->setVariable('EVENT_EDIT_LINK',$this->ctrl->getLinkTargetByClass('ilcalendarappointmentgui','edit'));
$this->tpl->setVariable('EVENT_NUM',$item['event']->getEntryId());
$compl = ($item['event']->isMilestone() && $item['event']->getCompletion() > 0)
? " (".$item['event']->getCompletion()."%)"
: "";
if($item['event']->isFullDay())
{
$title = $item['event']->getPresentationTitle().$compl;
}
else
{
switch($this->user_settings->getTimeFormat())
{
$title = $item['event']->getStart()->get(IL_CAL_FKT_DATE,'H:i',$this->timezone);
break;
$title = $item['event']->getStart()->get(IL_CAL_FKT_DATE,'h:ia',$this->timezone);
break;
}
$title .= (' '.$item['event']->getPresentationTitle());
}
$this->tpl->setVariable('EVENT_TITLE',$title);
$color = $this->app_colors->getColorByAppointment($item['event']->getEntryId());
$this->tpl->setVariable('EVENT_BGCOLOR',$color);
$this->tpl->setVariable('EVENT_ADD_STYLES',$item['event']->getPresentationStyle());
$this->tpl->setVariable('EVENT_FONTCOLOR',ilCalendarUtil::calculateFontColor($color));
$this->tpl->parseCurrentBlock();
$this->num_appointments++;
$count++;
}
return $count;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilCalendarMonthGUI::$ctrl
protected

Definition at line 50 of file class.ilCalendarMonthGUI.php.

ilCalendarMonthGUI::$lng
protected

Definition at line 49 of file class.ilCalendarMonthGUI.php.

Referenced by __construct().

ilCalendarMonthGUI::$num_appointments = 1
protected

Definition at line 43 of file class.ilCalendarMonthGUI.php.

ilCalendarMonthGUI::$schedule_filters = array()
protected

Definition at line 44 of file class.ilCalendarMonthGUI.php.

ilCalendarMonthGUI::$seed = null
protected

Definition at line 46 of file class.ilCalendarMonthGUI.php.

ilCalendarMonthGUI::$tabs_gui
protected

Definition at line 51 of file class.ilCalendarMonthGUI.php.

ilCalendarMonthGUI::$timezone = 'UTC'
protected

Definition at line 54 of file class.ilCalendarMonthGUI.php.

ilCalendarMonthGUI::$tpl
protected

Definition at line 52 of file class.ilCalendarMonthGUI.php.

Referenced by __construct(), executeCommand(), and show().

ilCalendarMonthGUI::$user_settings = null
protected

Definition at line 47 of file class.ilCalendarMonthGUI.php.


The documentation for this class was generated from the following file: