93 $this->ch_user_id = $a_user_id;
115 $this->ui_factory = $DIC->ui()->factory();
116 $this->ui_renderer = $DIC->ui()->renderer();
117 $this->ui = $DIC->ui();
118 $this->ctrl = $DIC->ctrl();
119 $this->lng = $DIC->language();
120 $this->
user = $DIC->user();
121 $this->tabs_gui = $DIC->tabs();
122 $this->tpl = $DIC[
"tpl"];
123 $this->toolbar = $DIC->toolbar();
124 $this->presentation_type = $a_calendar_presentation_type;
125 $this->logger =
$GLOBALS[
'DIC']->logger()->cal();
127 $this->view_with_appointments =
false;
129 if ($this->presentation_type == self::CAL_PRESENTATION_DAY ||
130 $this->presentation_type == self::CAL_PRESENTATION_WEEK) {
132 $this->tpl->addJavaScript(
'./Services/Calendar/js/calendar_appointment.js');
146 foreach ($events as $item) {
147 if ($item[
"event"]->getEntryId() == (
int)
$_GET[
"app_id"]) {
164 switch ($this->presentation_type) {
165 case self::CAL_PRESENTATION_AGENDA_LIST:
172 switch ($this->period) {
198 $this->period_end_day = $end_date->get(
IL_CAL_DATE);
199 $schedule->setPeriod($this->seed, $end_date);
208 case self::CAL_PRESENTATION_DAY:
211 case self::CAL_PRESENTATION_WEEK:
214 case self::CAL_PRESENTATION_MONTH:
221 $schedule->addSubitemCalendars(
true);
222 $schedule->calculate();
223 $ev = $schedule->getScheduledEvents();
236 $start = $item[
"dstart"];
237 $end = $item[
"dend"];
238 if ($item[
"fullday"]) {
245 return array(
"start" => $start,
"end" =>
$end);
258 $this->ctrl->setReturn($this,
'');
264 foreach ($events as $item) {
265 if ($item[
"event"]->getEntryId() == (
int)
$_GET[
"app_id"] && $item[
'dstart'] == (
int)
$_GET[
'dt']) {
268 include_once(
"./Services/Calendar/classes/class.ilCalendarAppointmentPresentationGUI.php");
270 $content =
$ctrl->getHTML($next_gui);
276 $modal = $f->modal()->roundtrip($modal_title, $f->legacy($content))->withCancelButtonLabel(
"close");
278 echo
$r->renderAsync($modal);
295 $this->ctrl->setParameter($this,
"app_id", $a_calendar_entry->getEntryId());
300 $this->ctrl->setParameter($this,
'dt', $a_dstart);
301 $this->ctrl->setParameter($this,
'seed', $this->seed->get(
IL_CAL_DATE));
302 $url = $this->ctrl->getLinkTarget($this,
"getModalForApp",
"",
true,
false);
303 $this->ctrl->setParameter($this,
"app_id",
$_GET[
"app_id"]);
304 $this->ctrl->setParameter($this,
"dt",
$_GET[
"dt"]);
305 $this->ctrl->setParameter($this,
'seed',
$_GET[
"seed"]);
307 $modal = $f->modal()->roundtrip(
'', [])->withAsyncRenderUrl(
$url);
310 if ($this->presentation_type == self::CAL_PRESENTATION_DAY) {
311 $title = ($a_title_forced ==
"")? $a_calendar_entry->getPresentationTitle(
false) : $a_title_forced;
313 $title = ($a_title_forced ==
"")? $a_calendar_entry->getPresentationTitle() : $a_title_forced;
317 $comps = [$f->button()->shy(
$title,
"#")->withOnClick($modal->getShowSignal()), $modal];
319 return $r->render($comps);
325 global $ilPluginAdmin;
329 foreach ($ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Calendar", $a_slot_id) as $plugin_name) {
330 $res[] = $ilPluginAdmin->getPluginObject(
343 $modal_title = $a_current_title;
347 $modal_title = ($new_title = $plugin->editModalTitle($a_current_title))? $new_title : $a_current_title;
365 $plugin->setAppointment($a_cal_entry,
new ilDateTime($a_start_date));
367 if ($new_title = $plugin->editShyButtonTitle()) {
371 if ($glyph = $plugin->addGlyph()) {
372 $a_tpl->setVariable(
'EXTRA_GLYPH_BY_PLUGIN', $glyph);
375 if ($more_content = $plugin->addExtraContent()) {
376 $a_tpl->setVariable(
'EXTRA_CONTENT_BY_PLUGIN', $more_content);
379 $a_tpl->parseCurrentBlock();
380 $html_content = $a_tpl->get();
382 if ($new_content = $plugin->replaceContent($html_content)) {
383 $content = $new_content;
404 if ($settings->isBatchFileDownloadsEnabled()) {
405 if ($this->presentation_type == self::CAL_PRESENTATION_AGENDA_LIST) {
408 if ($this->view_with_appointments || $num_events) {
415 $add_button = $f->button()->standard(
416 $lng->txt(
"cal_download_files"),
417 $ctrl->getLinkTarget($this,
"downloadFiles")
420 $toolbar->addComponent($add_button);
430 include_once
'./Services/Calendar/classes/BackgroundTasks/class.ilDownloadFilesBackgroundTask.php';
434 $download_job->setEvents($this->
getEvents());
435 if ($download_job->run()) {
438 $GLOBALS[
'DIC']->ctrl()->redirect($this);
449 $bucket_title = $this->lng->txt(
"cal_calendar_download");
451 switch ($this->presentation_type) {
452 case self::CAL_PRESENTATION_DAY:
453 $bucket_title .=
" " . $this->seed->get(
IL_CAL_DATE);
455 case self::CAL_PRESENTATION_WEEK:
457 $start = current($weekday_list);
458 if (function_exists(
'mb_substr')) {
459 $char = strtolower(mb_substr($this->lng->txt(
"week"), 0, 1));
461 $char = strtolower(substr($this->lng->txt(
"week"), 0, 1));
464 $bucket_title .=
" " . $start->get(
IL_CAL_DATE) .
" 1$char";
466 case self::CAL_PRESENTATION_MONTH:
468 if (function_exists(
'mb_substr')) {
469 $char = strtolower(mb_substr($this->lng->txt(
"month"), 0, 1));
471 $char = strtolower(substr($this->lng->txt(
"month"), 0, 1));
474 $bucket_title .=
" " . $year_month .
" 1" . $char;
476 case self::CAL_PRESENTATION_AGENDA_LIST:
477 $bucket_title .=
" " . $this->seed->get(
IL_CAL_DATE);
479 switch ($get_list_option) {
483 if (function_exists(
'mb_substr')) {
484 $char = strtolower(mb_substr($this->lng->txt(
"month"), 0, 1));
486 $char = strtolower(substr($this->lng->txt(
"month"), 0, 1));
488 $bucket_title .=
" 1$char";
491 if (function_exists(
'mb_substr')) {
492 $char = strtolower(mb_substr($this->lng->txt(
"month"), 0, 1));
494 $char = strtolower(substr($this->lng->txt(
"month"), 0, 1));
496 $bucket_title .=
" 6$char";
500 if (function_exists(
'mb_substr')) {
501 $char = strtolower(mb_substr($this->lng->txt(
"week"), 0, 1));
503 $char = strtolower(substr($this->lng->txt(
"week"), 0, 1));
505 $bucket_title .=
" 1$char";
510 return $bucket_title;
522 switch ($get_list_option) {
539 foreach ($events as $event) {
540 $event_start = $event[
'event']->getStart()->get(
IL_CAL_DATE);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getModalTitleByPlugins($a_current_title)
static _getInstance()
get singleton instance
getModalForApp()
Get modal for appointment (see similar code in ilCalendarBlockGUI)
__construct(ilDate $seed, $presentation_type)
getAppointmentShyButton($a_calendar_entry, $a_dstart, $a_title_forced="")
getBucketTitle()
get proper label to add in the background task popover
static _getInstanceByUserId($a_user_id)
get singleton instance
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static get($a_var)
Get a value.
static _getInstance(ilDate $seed, $a_app)
get singleton instance
const CAL_PRESENTATION_MONTH
getCurrentApp()
Get app for id.
static _buildWeekDayList($a_day, $a_weekstart)
build week day list
Description of class class.
countEventsInView()
get the events starting between 2 dates based in seed + view options.
initialize($a_calendar_presentation_type)
View initialization.
const CAL_PRESENTATION_AGENDA_LIST
static getPeriod()
needed in CalendarInboxGUI to get events using a proper period.
downloadFiles()
Download files related to the appointments showed in the current calendar view (day,week,month,list).
foreach($_POST as $key=> $value) $res
const CAL_PRESENTATION_DAY
Create styles array
The data for the language used.
getActivePlugins($a_slot_id)
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
static initjQuery($a_tpl=null)
inits and adds the jQuery JS-File to the global or a passed template
const CAL_PRESENTATION_WEEK
getDatesForItem($item)
Get start/end date for item.
addToolbarActions()
Add download link to toolbar.
getConsultationHoursUserId()
getContentByPlugins($a_cal_entry, $a_start_date, $a_content, $a_tpl)
setConsulationHoursUserId($a_user_id)
Represents a list of calendar appointments (including recurring events) for a specific user in a give...