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');
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();
237 $end = $item[
"dend"];
238 if ($item[
"fullday"]) {
245 return array(
"start" =>
$start,
"end" =>
$end);
258 $this->ctrl->setReturn($this,
'');
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);
327 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
331 foreach ($ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Calendar", $a_slot_id) as $plugin_name) {
332 $res[] = $ilPluginAdmin->getPluginObject(
345 $modal_title = $a_current_title;
349 $modal_title = ($new_title = $plugin->editModalTitle($a_current_title))? $new_title : $a_current_title;
367 $plugin->setAppointment($a_cal_entry,
new ilDateTime($a_start_date));
369 if ($new_title = $plugin->editShyButtonTitle()) {
373 if ($glyph = $plugin->addGlyph()) {
374 $a_tpl->setVariable(
'EXTRA_GLYPH_BY_PLUGIN', $glyph);
377 if ($more_content = $plugin->addExtraContent()) {
378 $a_tpl->setVariable(
'EXTRA_CONTENT_BY_PLUGIN', $more_content);
381 $a_tpl->parseCurrentBlock();
382 $html_content = $a_tpl->get();
384 if ($new_content = $plugin->replaceContent($html_content)) {
385 $content = $new_content;
406 if ($settings->isBatchFileDownloadsEnabled()) {
407 if ($this->presentation_type == self::CAL_PRESENTATION_AGENDA_LIST) {
410 if ($this->view_with_appointments || $num_events) {
417 $add_button =
$f->button()->standard(
418 $lng->txt(
"cal_download_files"),
419 $ctrl->getLinkTarget($this,
"downloadFiles")
422 $toolbar->addComponent($add_button);
432 include_once
'./Services/Calendar/classes/BackgroundTasks/class.ilDownloadFilesBackgroundTask.php';
436 $download_job->setEvents($this->
getEvents());
437 if ($download_job->run()) {
438 ilUtil::sendSuccess($this->lng->txt(
'cal_download_files_started'),
true);
440 $GLOBALS[
'DIC']->ctrl()->redirect($this);
451 $bucket_title = $this->lng->txt(
"cal_calendar_download");
453 switch ($this->presentation_type) {
454 case self::CAL_PRESENTATION_DAY:
455 $bucket_title .=
" " . $this->seed->get(
IL_CAL_DATE);
457 case self::CAL_PRESENTATION_WEEK:
459 $start = current($weekday_list);
460 $char = strtolower(mb_substr($this->lng->txt(
"week"), 0, 1));
463 case self::CAL_PRESENTATION_MONTH:
465 $char = strtolower(mb_substr($this->lng->txt(
"month"), 0, 1));
466 $bucket_title .=
" " . $year_month .
" 1" . $char;
468 case self::CAL_PRESENTATION_AGENDA_LIST:
469 $bucket_title .=
" " . $this->seed->get(
IL_CAL_DATE);
471 switch ($get_list_option) {
475 $char = strtolower(mb_substr($this->lng->txt(
"month"), 0, 1));
476 $bucket_title .=
" 1$char";
479 $char = strtolower(mb_substr($this->lng->txt(
"month"), 0, 1));
480 $bucket_title .=
" 6$char";
484 $char = strtolower(mb_substr($this->lng->txt(
"week"), 0, 1));
485 $bucket_title .=
" 1$char";
490 return $bucket_title;
502 switch ($get_list_option) {
520 $event_start = $event[
'event']->getStart()->get(
IL_CAL_DATE);
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
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
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)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Represents a list of calendar appointments (including recurring events) for a specific user in a give...