2 include_once
'./Services/Calendar/classes/class.ilCalendarViewGUI.php';
56 $this->ctrl->saveParameter($this,
"cal_agenda_per");
60 $this->ctrl->setParameterByClass(
"ilcalendarinboxgui",
"seed", $this->seed->get(
IL_CAL_DATE));
74 $qp = $DIC->http()->request()->getQueryParams();
75 if ((
int) $qp[
"cal_agenda_per"] > 0 && (
int) $qp[
"cal_agenda_per"] <= 4) {
76 $this->period = $qp[
"cal_agenda_per"];
77 } elseif (!empty($this->
user->getPref(
'cal_list_view'))) {
78 $this->period = intval($this->
user->getPref(
'cal_list_view'));
80 $this->period = $cal_setting->getDefaultPeriod();
83 $this->
user->writePref(
'cal_list_view', $this->period);
93 switch ($this->period) {
94 case self::PERIOD_DAY:
98 case self::PERIOD_WEEK:
102 case self::PERIOD_MONTH:
106 case self::PERIOD_HALF_YEAR:
110 $this->period_end_day = $end_date->get(
IL_CAL_DATE);
118 $next_class = $this->ctrl->getNextClass($this);
119 $cmd = $this->ctrl->getCmd(
"getHTML");
121 switch ($next_class) {
122 case "ilcalendarappointmentpresentationgui":
123 $this->ctrl->setReturn($this,
"");
124 include_once(
"./Services/Calendar/classes/class.ilCalendarAppointmentPresentationGUI.php");
126 $this->ctrl->forwardCommand($gui);
130 $this->ctrl->setReturn($this,
"");
131 if (in_array($cmd, array(
"getHTML",
"getModalForApp"))) {
132 return $this->$cmd();
146 $navigation->getHTML();
149 $this->ctrl->setReturn($this,
"");
155 $df = new \ILIAS\Data\Factory();
162 foreach ($events as
$e) {
163 if ($e[
'event']->isFullDay()) {
195 if ($group_date->isNull()) {
204 $groups[] = $this->ui_factory->item()->group(
220 $properties = array();
229 $this->ctrl->setParameter($this,
'app_id', $e[
"event"]->getEntryId());
230 $this->ctrl->setParameter($this,
'dt', $e[
'dstart']);
231 $this->ctrl->setParameter($this,
'seed', $this->seed->get(
IL_CAL_DATE));
233 $url = $this->ctrl->getLinkTarget($this,
"getModalForApp",
"",
true,
false);
234 $this->ctrl->setParameter($this,
"app_id",
$_GET[
"app_id"]);
235 $this->ctrl->setParameter($this,
"dt",
$_GET[
"dt"]);
236 $this->ctrl->setParameter($this,
'modal_title',
$_GET[
"modal_title"]);
237 $modal = $this->ui_factory->modal()->roundtrip(
'', [])->withAsyncRenderUrl(
$url);
238 $shy = $this->ui_factory->button()->shy($e[
"event"]->getPresentationTitle(
false),
"")->withOnClick($modal->getShowSignal());
241 if ($e[
'event']->isFullDay()) {
242 $lead_text = $this->lng->txt(
"cal_all_day");
246 $li = $this->ui_factory->item()->standard($shy)
247 ->withDescription(
"" . nl2br(strip_tags($e[
"event"]->getDescription())))
248 ->withLeadText($lead_text)
249 ->withProperties($properties)
250 ->withColor($df->color(
'#' . $cat_info[
"color"]));
253 $li = $li_edited_by_plugin;
257 include_once(
"./Services/Calendar/classes/class.ilCalendarAppointmentPresentationGUI.php");
259 $app_gui->setListItemMode($li);
260 $this->ctrl->getHTML($app_gui);
261 $items[] = $app_gui->getListItem();
264 if (!$group_date->isNull()) {
265 $groups[] = $this->ui_factory->item()->group(
272 $images = array_fill(1, 4,
"<span class=\"ilAdvNoImg\"></span>");
273 if ($cal_agenda_per = (
int)
$_GET[
'cal_agenda_per']) {
274 $images[$cal_agenda_per] =
"<img src='./templates/default/images/icon_checked.svg' alt='Month'>";
276 $images[
$this->period] =
"<img src='./templates/default/images/icon_checked.svg' alt='Month'>";
279 #21479 Set seed if the view does not contain any event. 280 $this->ctrl->setParameter($this,
'seed', $this->seed->get(
IL_CAL_DATE));
283 $this->ctrl->setParameter($this,
"cal_agenda_per", self::PERIOD_DAY);
284 $items[] = $this->ui_factory->button()->shy($images[1] .
"1 " . $this->lng->txt(
"day"), $this->ctrl->getLinkTarget($this,
"getHTML"));
285 $this->ctrl->setParameter($this,
"cal_agenda_per", self::PERIOD_WEEK);
286 $items[] = $this->ui_factory->button()->shy($images[2] .
"1 " . $this->lng->txt(
"week"), $this->ctrl->getLinkTarget($this,
"getHTML"));
287 $this->ctrl->setParameter($this,
"cal_agenda_per", self::PERIOD_MONTH);
288 $items[] = $this->ui_factory->button()->shy($images[3] .
"1 " . $this->lng->txt(
"month"), $this->ctrl->getLinkTarget($this,
"getHTML"));
289 $this->ctrl->setParameter($this,
"cal_agenda_per", self::PERIOD_HALF_YEAR);
290 $items[] = $this->ui_factory->button()->shy($images[4] .
"6 " . $this->lng->txt(
"months"), $this->ctrl->getLinkTarget($this,
"getHTML"));
291 $this->ctrl->setParameter($this,
"cal_agenda_per", $this->period);
294 $actions = $this->ui_factory->dropdown()->standard($items)->withLabel($this->lng->txt(
"cal_period"));
298 if ($this->period != self::PERIOD_DAY) {
304 $list = $this->ui_factory->panel()->listing()->standard($list_title, $groups)
305 ->withActions($actions);
308 $comps = array_merge($modals, array($list));
310 $html = $this->ui_renderer->render($comps);
312 if (count($groups) == 0) {
328 $plugin->setAppointment($appointment, $appointment->getStart());
329 $li = $plugin->editAgendaItem($a_item);
346 $qp = $DIC->http()->request()->getQueryParams();
347 if ((
int) $qp[
"cal_agenda_per"] > 0 && (
int) $qp[
"cal_agenda_per"] <= 4) {
348 return $qp[
"cal_agenda_per"];
352 return $settings->getDefaultPeriod();
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static _lookupCategory($a_cal_id)
Lookup category id.
static _getInstance()
get singleton instance
__construct(ilDate $seed)
Constructor.
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
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.
static _getInstance(ilDate $seed, $a_app)
get singleton instance
getCurrentApp()
Get app for id.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
const CAL_PRESENTATION_AGENDA_LIST
static _equals(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check if two date are equal.
static getPeriod()
needed in CalendarInboxGUI to get events using a proper period.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
static _getInstance($a_usr_id=0)
get singleton instance
initPeriod()
Initialises time Period for calendar list view.
getPluginAgendaItem($a_item, $appointment)
getActivePlugins($a_slot_id)
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
__construct(Container $dic, ilPlugin $plugin)
executeCommand()
Execute command.
initEndPeriod()
Initialises end date for calendar list view.