ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCalendarBlockGUI Class Reference

Calendar blocks, displayed in different contexts, e.g. More...

+ Inheritance diagram for ilCalendarBlockGUI:
+ Collaboration diagram for ilCalendarBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getShowWeeksColumn ()
 Show weeks column. More...
 
 getBlockType ()
 
 setParentGUI (string $a_val)
 
 getParentGUI ()
 
 setForceMonthView (bool $a_val)
 
 getForceMonthView ()
 
 executeCommand ()
 
 fillDataSection ()
 
 getTargetGUIClassPath ()
 
 addMiniMonth (ilTemplate $a_tpl, bool $a_include_view_ctrl=false)
 Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab. More...
 
 getHTML ()
 Get bloch HTML code. More...
 
 getOverview ()
 
 setSeed ()
 
 returnToUpperContext ()
 
 setPdModeEvents ()
 
 setPdModeMonth ()
 
 getEventByAppointmentId (int $a_appointment_id)
 
 getEvents ()
 
 getData ()
 
 getDatesForItem (array $item)
 Get start/end date for item. More...
 
 getModalForApp ()
 Get modal for appointment (see similar code in ilCalendarAgendaListGUI) todo use all this methods from ilcalendarviewgui.php. More...
 
 getNoItemFoundContent ()
 No item entry. More...
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 correctOffset ()
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 
 getBlockCommands ()
 
 getHTML ()
 
 fillHeaderCommands ()
 
 fillHeaderTitleBlock ()
 
 setDataSection (string $a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow (array $a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 
 setPreviousNextLinks ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 
 getNoItemFoundContent ()
 

Static Public Member Functions

static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 

Static Public Attributes

static string $block_type = "cal"
 

Protected Member Functions

 initBookingUserFromQuery ()
 
 initSeedFromQuery ()
 
 initAppointmentIdFromQuery ()
 
 initInitialDateQuery ()
 
 isRepositoryObject ()
 
 getViewControl ()
 
 initCategories ()
 
 setSubTabs ()
 
 initCommands ()
 
 getViewControls ()
 
 getLegacyContent ()
 
 getListItemForData (array $data)
 
 addSubscriptionButton (ilTemplate $panel_template)
 Add subscription button. More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 fillRowColor (string $a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getViewControls ()
 Get view controls. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 send (string $output)
 Send. More...
 

Protected Attributes

array $cal_footer = []
 
ilCalendarSchedule $scheduler = null
 
RefineryFactory $refinery
 
HttpServices $http
 
int $mode = ilCalendarCategories::MODE_UNDEFINED
 
string $display_mode = ''
 
ilLogger $logger
 
ilTabsGUI $tabs
 
ilObjectDataCache $obj_data_cache
 
ilHelpGUI $help
 
ilDate $seed
 
ilCalendarSettings $settings
 
ilCalendarUserSettings $user_settings
 
string $parent_gui = ilColumnGUI::class
 
bool $force_month_view = false
 
int $requested_cal_agenda_per
 
array $modals = []
 
bool $new_rendering = true
 
- Protected Attributes inherited from ilBlockGUI
object $gui_object
 
ILIAS Block StandardGUIRequest $request
 
ILIAS Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 
bool $new_rendering = false
 

Additional Inherited Members

- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 
const PRES_MAIN_TILE = 4
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCalendarBlockGUI::__construct ( )

Constructor.

Todo:
check if setLimit is required

Definition at line 64 of file class.ilCalendarBlockGUI.php.

References $DIC, $params, ilBlockGUI\$title, ILIAS\GlobalScreen\Provider\__construct(), ilCalendarSettings\_getInstance(), ilCalendarUserSettings\_getInstanceByUserId(), ILIAS\Repository\ctrl(), ilSession\get(), ilBlockGUI\getBlockId(), getBlockType(), ilSession\has(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), IL_CAL_DATE, initSeedFromQuery(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\refinery(), ilSession\set(), ilBlockGUI\setBlockId(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), ILIAS\Repository\settings(), ilBlockGUI\setTitle(), ILIAS\Repository\tabs(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

65  {
66  global $DIC;
67 
69 
70  $this->logger = $DIC->logger()->cal();
71  $this->tabs = $DIC->tabs();
72  $this->obj_data_cache = $DIC["ilObjDataCache"];
73  $this->ui = $DIC->ui();
74  $this->help = $DIC->help();
75  $this->http = $DIC->http();
76  $this->refinery = $DIC->refinery();
77 
78  $this->lng->loadLanguageModule("dateplaner");
79  $this->help->addHelpSection("cal_block");
80 
81  $this->ctrl->saveParameter($this, 'bkid');
82  $this->setBlockId((string) $this->ctrl->getContextObjId());
83  $this->setLimit(5); // @todo: needed?
84  $this->setEnableNumInfo(false);
85  $title = $this->lng->txt("calendar");
86  $this->setTitle($title);
87  $this->allow_moving = false;
88 
89  $params = $DIC->http()->request()->getQueryParams();
90  $this->requested_cal_agenda_per = (int) ($params['cal_agenda_per'] ?? null);
91 
92  $seed_str = $this->initSeedFromQuery();
93  if (!strlen($seed_str) && ilSession::has("il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed")) {
94  $seed_str = ilSession::get("il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed");
95  } elseif (strlen($seed_str)) {
96  ilSession::set("il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed", $seed_str);
97  } else {
98  $seed_str = date('Y-m-d', time());
99  }
100  $this->seed = new ilDate($seed_str, IL_CAL_DATE);
102  $this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($DIC->user()->getId());
103 
104  $mode = $this->user->getPref("il_pd_cal_mode");
105  $this->display_mode = $mode ?: "mmon";
106 
107  if ($this->display_mode !== "mmon") {
108  $this->setPresentation(self::PRES_SEC_LIST);
109  }
110  }
static get(string $a_var)
setLimit(int $a_limit)
setBlockId(string $a_block_id="0")
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
setEnableNumInfo(bool $a_enablenuminfo)
static _getInstanceByUserId(int $a_user_id)
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
static has($a_var)
const IL_CAL_DATE
__construct(Container $dic, ilPlugin $plugin)
setTitle(string $a_title)
setPresentation(int $type)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

Member Function Documentation

◆ addMiniMonth()

ilCalendarBlockGUI::addMiniMonth ( ilTemplate  $a_tpl,
bool  $a_include_view_ctrl = false 
)

Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab.

Definition at line 313 of file class.ilCalendarBlockGUI.php.

References $i, $ilUser, ilBlockGUI\$lng, $path, ilBlockGUI\$ui, ilBlockGUI\$user, ilDateTime\_before(), ilCalendarUtil\_buildMonthDayList(), ilDateTime\_equals(), ilCalendarUtil\_isToday(), ilCalendarUtil\_numericDayToString(), ILIAS\Repository\ctrl(), getShowWeeksColumn(), getTargetGUIClassPath(), getViewControl(), IL_CAL_DATE, IL_CAL_FKT_DATE, IL_CAL_MONTH, initBookingUserFromQuery(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), ilCalendarSchedule\TYPE_MONTH, and ILIAS\Repository\user().

Referenced by fillDataSection(), and getLegacyContent().

313  : void
314  {
315  $lng = $this->lng;
317  $ui = $this->ui;
318 
319  // weekdays
320  if ($this->getShowWeeksColumn()) {
321  $a_tpl->setCurrentBlock('month_header_col');
322  $a_tpl->setVariable('TXT_WEEKDAY', $this->lng->txt("cal_week_abbrev"));
323  $a_tpl->parseCurrentBlock();
324  }
325  for ($i = $this->user_settings->getWeekStart(); $i < (7 + $this->user_settings->getWeekStart()); $i++) {
326  $a_tpl->setCurrentBlock('month_header_col');
327  $a_tpl->setVariable('TXT_WEEKDAY', ilCalendarUtil::_numericDayToString($i, false));
328  $a_tpl->parseCurrentBlock();
329  }
330 
331  $bkid = $this->initBookingUserFromQuery();
332  if ($bkid) {
333  $user_id = $bkid;
334  $disable_empty = true;
335  } else {
336  $user_id = $this->user->getId();
337  $disable_empty = false;
338  }
339  $this->scheduler = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_MONTH, $user_id);
340  $this->scheduler->addSubitemCalendars(true);
341  $this->scheduler->calculate();
342 
343  $counter = 0;
345  (int) $this->seed->get(IL_CAL_FKT_DATE, 'm'),
346  (int) $this->seed->get(IL_CAL_FKT_DATE, 'Y'),
347  $this->user_settings->getWeekStart()
348  )->get() as $date) {
349  $counter++;
350 
351  $events = $this->scheduler->getByDay($date, $this->user->getTimeZone());
352  $has_events = (bool) count($events);
353  if ($has_events || !$disable_empty) {
354  $a_tpl->setCurrentBlock('month_col_link');
355  } else {
356  $a_tpl->setCurrentBlock('month_col_no_link');
357  }
358 
359  if ($disable_empty) {
360  if (!$has_events) {
361  $a_tpl->setVariable('DAY_CLASS', 'calminiinactive');
362  } else {
363  $week_has_events = true;
364  foreach ($events as $event) {
365  $booking = new ilBookingEntry($event['event']->getContextId());
366  if ($booking->hasBooked($event['event']->getEntryId())) {
367  $a_tpl->setVariable('DAY_CLASS', 'calminiapp');
368  break;
369  }
370  }
371  }
372  } elseif ($has_events) {
373  $week_has_events = true;
374  $a_tpl->setVariable('DAY_CLASS', 'calminiapp');
375  }
376 
377  $day = $date->get(IL_CAL_FKT_DATE, 'j');
378  $month = $date->get(IL_CAL_FKT_DATE, 'n');
379 
380  $month_day = $day;
381 
382  $path = $this->getTargetGUIClassPath();
383  $last_gui = end($path);
384  $this->ctrl->setParameterByClass($last_gui, 'seed', $date->get(IL_CAL_DATE));
385  if ($agenda_view_type = $this->requested_cal_agenda_per) {
386  $this->ctrl->setParameterByClass($last_gui, "cal_agenda_per", $agenda_view_type);
387  }
388  $a_tpl->setVariable('OPEN_DAY_VIEW', $this->ctrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ''));
389 
390  $a_tpl->setVariable('MONTH_DAY', $month_day);
391 
392  $a_tpl->parseCurrentBlock();
393 
394  $a_tpl->setCurrentBlock('month_col');
395 
396  if (ilCalendarUtil::_isToday($date)) {
397  $a_tpl->setVariable('TD_CLASS', 'calminitoday');
398  } elseif (ilDateTime::_equals($date, $this->seed, IL_CAL_MONTH)) {
399  $a_tpl->setVariable('TD_CLASS', 'calministd');
400  } elseif (ilDateTime::_before($date, $this->seed, IL_CAL_MONTH)) {
401  $a_tpl->setVariable('TD_CLASS', 'calminiprev');
402  } else {
403  $a_tpl->setVariable('TD_CLASS', 'calmininext');
404  }
405 
406  $a_tpl->parseCurrentBlock();
407 
408  if ($counter and !($counter % 7)) {
409  if ($this->getShowWeeksColumn()) {
410  $a_tpl->setCurrentBlock('week');
411  $a_tpl->setVariable(
412  'WEEK',
413  $date->get(IL_CAL_FKT_DATE, 'W')
414  );
415  $a_tpl->parseCurrentBlock();
416  }
417 
418  $a_tpl->setCurrentBlock('month_row');
419  $a_tpl->parseCurrentBlock();
420 
421  $week_has_events = false;
422  }
423  }
424  $a_tpl->setCurrentBlock('mini_month');
425  if ($a_include_view_ctrl) {
426  $a_tpl->setVariable("VIEW_CTRL_SECTION", $ui->renderer()->render($this->getViewControl()));
427  }
428 
429  $a_tpl->parseCurrentBlock();
430  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
ilObjUser $user
ILIAS DI UIServices $ui
static _buildMonthDayList(int $a_month, int $a_year, int $weekstart)
Build a month day list.
ilLanguage $lng
getShowWeeksColumn()
Show weeks column.
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_CAL_MONTH
$path
Definition: ltiservices.php:32
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
const IL_CAL_FKT_DATE
static _numericDayToString(int $a_day, bool $a_long=true)
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
const IL_CAL_DATE
$ilUser
Definition: imgupload.php:34
static _equals(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
Check if two date are equal.
static _isToday(ilDateTime $date)
$i
Definition: metadata.php:41
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSubscriptionButton()

ilCalendarBlockGUI::addSubscriptionButton ( ilTemplate  $panel_template)
protected

Add subscription button.

Definition at line 913 of file class.ilCalendarBlockGUI.php.

References $DIC, ilBlockGUI\$presentation, $url, ILIAS\Repository\ctrl(), getTargetGUIClassPath(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by getLegacyContent().

913  : void
914  {
915  global $DIC;
916 
917  $ui_factory = $DIC->ui()->factory();
918  $ui_renderer = $DIC->ui()->renderer();
919 
920  $gui_path = $this->getTargetGUIClassPath();
921  $gui_path[] = strtolower(\ilCalendarSubscriptionGUI::class);
922  $url = $this->ctrl->getLinkTargetByClass($gui_path, 'getModalForSubscription', "", true, false);
923 
924  $roundtrip_modal = $ui_factory->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
925 
926  $standard_button = $ui_factory->button()->standard($this->lng->txt('btn_ical'), '')->withOnClick(
927  $roundtrip_modal->getShowSignal()
928  );
929  $components = [
930  $roundtrip_modal,
931  $standard_button
932  ];
933 
934  $presentation = $ui_renderer->render($components);
935 
936  $panel_template->setCurrentBlock('subscription_buttons');
937  $panel_template->setVariable('SUBSCRIPTION_BUTTON', $presentation);
938  $panel_template->parseCurrentBlock();
939  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
global $DIC
Definition: feed.php:28
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilCalendarBlockGUI::executeCommand ( )

Definition at line 224 of file class.ilCalendarBlockGUI.php.

References $app, ilBlockGUI\$presentation, ilCalendarAppointmentPresentationGUI\_getInstance(), ILIAS\Repository\ctrl(), getEventByAppointmentId(), getHTML(), initAppointmentIdFromQuery(), initCategories(), ILIAS\Repository\logger(), setSubTabs(), and ILIAS\Repository\tabs().

224  : string
225  {
226  $next_class = $this->ctrl->getNextClass();
227  $cmd = $this->ctrl->getCmd("getHTML");
228 
229  $this->setSubTabs();
230 
231  switch ($next_class) {
232  case "ilcalendarappointmentgui":
233  $this->initCategories();
234  $app_gui = new ilCalendarAppointmentGUI($this->seed, $this->seed);
235  $this->ctrl->forwardCommand($app_gui);
236  break;
237 
238  case "ilconsultationhoursgui":
239  $hours = new ilConsultationHoursGUI();
240  $this->ctrl->forwardCommand($hours);
241  break;
242 
243  case "ilcalendarappointmentpresentationgui":
244  $this->initCategories();
245 
247  if ($app === null) {
248  $this->logger->error(
249  'Invalid appointment ID for ref_id: ' .
250  (string) $this->initAppointmentIdFromQuery() . ' ' .
251  (string) $this->requested_ref_id
252  );
253  return $this->getHTML();
254  }
256  $this->ctrl->forwardCommand($presentation);
257  break;
258 
259  case "ilcalendarmonthgui":
260  $this->tabs->setSubTabActive('app_month');
261  $month_gui = new ilCalendarMonthGUI($this->seed);
262  $this->ctrl->forwardCommand($month_gui);
263  break;
264 
265  default:
266  return $this->$cmd();
267  }
268  return '';
269  }
static _getInstance(ilDate $seed, array $a_app)
get singleton instance
$app
Definition: cli.php:39
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getEventByAppointmentId(int $a_appointment_id)
getHTML()
Get bloch HTML code.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Administrate calendar appointments.
+ Here is the call graph for this function:

◆ fillDataSection()

ilCalendarBlockGUI::fillDataSection ( )

Definition at line 271 of file class.ilCalendarBlockGUI.php.

References ilBlockGUI\$tpl, addMiniMonth(), ilBlockGUI\fillDataSection(), ilTemplate\get(), ilBlockGUI\setDataSection(), and ilBlockGUI\setRowTemplate().

271  : void
272  {
273  if ($this->display_mode != "mmon") {
274  $this->setRowTemplate("tpl.pd_event_list.html", "Services/Calendar");
275 
277  } else {
278  $tpl = new ilTemplate(
279  "tpl.calendar_block.html",
280  true,
281  true,
282  "Services/Calendar"
283  );
284 
285  $this->addMiniMonth($tpl, true);
286  $this->setDataSection($tpl->get());
287  }
288  }
get(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setDataSection(string $a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setRowTemplate(string $a_rowtemplatename, string $a_rowtemplatedir="")
Set Row Template Name.
ilTemplate $tpl
addMiniMonth(ilTemplate $a_tpl, bool $a_include_view_ctrl=false)
Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab...
fillDataSection()
Standard implementation for row based data.
+ Here is the call graph for this function:

◆ getBlockType()

ilCalendarBlockGUI::getBlockType ( )

Definition at line 167 of file class.ilCalendarBlockGUI.php.

Referenced by __construct(), and setSeed().

167  : string
168  {
169  return self::$block_type;
170  }
+ Here is the caller graph for this function:

◆ getData()

ilCalendarBlockGUI::getData ( )

Definition at line 742 of file class.ilCalendarBlockGUI.php.

References ilBlockGUI\$data, Vendor\Package\$f, ilBlockGUI\$lng, ilBlockGUI\$ui, $url, ILIAS\Repository\ctrl(), ilDatePresentation\formatPeriod(), getDatesForItem(), getEvents(), initAppointmentIdFromQuery(), initInitialDateQuery(), and ilBlockGUI\setEnableNumInfo().

742  : array
743  {
744  $lng = $this->lng;
745  $ui = $this->ui;
746 
747  $f = $ui->factory();
748 
749  $events = $this->getEvents();
750 
751  $data = array();
752  if (sizeof($events)) {
753  foreach ($events as $item) {
754  $this->ctrl->setParameter($this, "app_id", $item["event"]->getEntryId());
755  $this->ctrl->setParameter($this, 'dt', $item['dstart']);
756  $url = $this->ctrl->getLinkTarget($this, "getModalForApp", "", true, false);
757  $this->ctrl->setParameter($this, "app_id", $this->initAppointmentIdFromQuery());
758  $this->ctrl->setParameter($this, "dt", $this->initInitialDateQuery());
759  $modal = $f->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
760 
761  $dates = $this->getDatesForItem($item);
762 
763  $shy = $f->button()->shy(
764  $item["event"]->getPresentationTitle(),
765  ""
766  )->withOnClick($modal->getShowSignal());
767 
768  $data[] = array(
769  "date" => ilDatePresentation::formatPeriod($dates["start"], $dates["end"]),
770  "title" => $item["event"]->getPresentationTitle(),
771  "url" => "#",
772  "shy_button" => $shy,
773  "modal" => $modal
774  );
775  }
776  $this->setEnableNumInfo(true);
777  } else {
778  $data = [];
779  /*$data[] = array(
780  "date" => $lng->txt("msg_no_search_result"),
781  "title" => "",
782  "url" => ""
783  ); */
784 
785  $this->setEnableNumInfo(false);
786  }
787 
788  return $data;
789  }
ILIAS DI UIServices $ui
getDatesForItem(array $item)
Get start/end date for item.
ilLanguage $lng
setEnableNumInfo(bool $a_enablenuminfo)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
$url
+ Here is the call graph for this function:

◆ getDatesForItem()

ilCalendarBlockGUI::getDatesForItem ( array  $item)

Get start/end date for item.

Parameters
array$itemitem
Returns
array

Definition at line 796 of file class.ilCalendarBlockGUI.php.

References IL_CAL_UNIX.

Referenced by getData(), and getModalForApp().

796  : array
797  {
798  $start = $item["dstart"];
799  $end = $item["dend"];
800  if ($item["fullday"]) {
801  $start = new ilDate($start, IL_CAL_UNIX);
802  $end = new ilDate($end, IL_CAL_UNIX);
803  } else {
804  $start = new ilDateTime($start, IL_CAL_UNIX);
805  $end = new ilDateTime($end, IL_CAL_UNIX);
806  }
807  return array("start" => $start, "end" => $end);
808  }
const IL_CAL_UNIX
+ Here is the caller graph for this function:

◆ getEventByAppointmentId()

ilCalendarBlockGUI::getEventByAppointmentId ( int  $a_appointment_id)

Definition at line 716 of file class.ilCalendarBlockGUI.php.

References getEvents().

Referenced by executeCommand().

716  : ?array
717  {
718  foreach ($this->getEvents() as $event) {
719  if (
720  array_key_exists('event', $event) &&
721  $event['event'] instanceof ilCalendarEntry &&
722  $event['event']->getEntryId() === $a_appointment_id
723  ) {
724  return $event;
725  }
726  }
727  return null;
728  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEvents()

ilCalendarBlockGUI::getEvents ( )

Definition at line 730 of file class.ilCalendarBlockGUI.php.

References IL_CAL_DATE, and ilCalendarSchedule\TYPE_PD_UPCOMING.

Referenced by getData(), getEventByAppointmentId(), and getModalForApp().

730  : array
731  {
732  $seed = new ilDate(date('Y-m-d', time()), IL_CAL_DATE);
733 
735  $schedule->addSubitemCalendars(true); // #12007
736  $schedule->setEventsLimit(20);
737  $schedule->calculate();
738  // #13809
739  return $schedule->getScheduledEvents();
740  }
const IL_CAL_DATE
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
+ Here is the caller graph for this function:

◆ getForceMonthView()

ilCalendarBlockGUI::getForceMonthView ( )

Definition at line 199 of file class.ilCalendarBlockGUI.php.

References $force_month_view.

Referenced by getHTML(), ilPDCalendarBlockGUI\initCategories(), initCategories(), and initCommands().

199  : bool
200  {
202  }
+ Here is the caller graph for this function:

◆ getHTML()

ilCalendarBlockGUI::getHTML ( )

Get bloch HTML code.

Definition at line 491 of file class.ilCalendarBlockGUI.php.

References Vendor\Package\$f, ilBlockGUI\$lng, $obj_data_cache, $path, ilBlockGUI\$user, ilDateTime\_before(), ilCourseParticipants\_getInstanceByObjId(), ilObjUser\_lookupFullname(), ilBlockGUI\addBlockCommand(), ILIAS\Repository\ctrl(), ilConsultationHourAppointments\getAppointments(), getForceMonthView(), ilObject\getId(), getParentGUI(), ilBlockGUI\getProperty(), getTargetGUIClassPath(), IL_CAL_DATE, IL_CAL_DAY, IL_CAL_UNIX, initBookingUserFromQuery(), initCategories(), ILIAS\Repository\lng(), ilBookingEntry\lookupBookableUsersForObject(), ilCalendarCategories\MODE_REPOSITORY, and ILIAS\Repository\ui().

Referenced by executeCommand(), setPdModeEvents(), setPdModeMonth(), and setSeed().

491  : string
492  {
493  $this->initCategories();
494  $lng = $this->lng;
495  $ilObjDataCache = $this->obj_data_cache;
496  $user = $this->user;
497 
498  if ($this->mode == ilCalendarCategories::MODE_REPOSITORY) {
499  $bkid = $this->initBookingUserFromQuery();
500  if (!$bkid) {
501  $obj_id = $ilObjDataCache->lookupObjId((int) $this->requested_ref_id);
502  $participants = ilCourseParticipants::_getInstanceByObjId($obj_id);
503  $users = array_unique(array_merge($participants->getTutors(), $participants->getAdmins()));
504  //$users = $participants->getParticipants();
505  $users = ilBookingEntry::lookupBookableUsersForObject([$obj_id], $users);
506  foreach ($users as $user_id) {
507  $now = new ilDateTime(time(), IL_CAL_UNIX);
508 
509  // default to last booking entry
510  $appointments = ilConsultationHourAppointments::getAppointments($user_id);
511  $next_app = end($appointments);
512  reset($appointments);
513 
514  foreach ($appointments as $entry) {
515  // find next entry
516  if (ilDateTime::_before($entry->getStart(), $now, IL_CAL_DAY)) {
517  continue;
518  }
519  $booking_entry = new ilBookingEntry($entry->getContextId());
520  if (!in_array($obj_id, $booking_entry->getTargetObjIds())) {
521  continue;
522  }
523 
524  if (!$booking_entry->isAppointmentBookableForUser($entry->getEntryId(), $user->getId())) {
525  continue;
526  }
527  $next_app = $entry;
528  break;
529  }
530 
531  $path = $this->getTargetGUIClassPath();
532  $this->ctrl->setParameterByClass(end($path), "ch_user_id", $user_id);
533 
534  if (!$this->getForceMonthView()) {
535  $this->cal_footer[] = array(
536  'link' => $this->ctrl->getLinkTargetByClass(
537  $this->getTargetGUIClassPath(),
538  'selectCHCalendarOfUser'
539  ),
540  'txt' => str_replace(
541  "%1",
542  ilObjUser::_lookupFullname($user_id),
543  $this->lng->txt("cal_consultation_hours_for_user")
544  )
545  );
546  }
547  $path = $this->getTargetGUIClassPath();
548  $last_gui = end($path);
549  $this->ctrl->setParameterByClass($last_gui, "ch_user_id", "");
550  $this->ctrl->setParameterByClass($last_gui, "bkid", $bkid);
551  $this->ctrl->setParameterByClass($last_gui, "seed", $this->seed->get(IL_CAL_DATE));
552  }
553  $this->ctrl->setParameter($this, "bkid", "");
554  $this->ctrl->setParameter($this, 'seed', '');
555  } else {
556  $this->ctrl->setParameter($this, "bkid", "");
557  $this->addBlockCommand(
558  $this->ctrl->getLinkTarget($this),
559  $this->lng->txt("back")
560  );
561  $this->ctrl->setParameter($this, "bkid", $this->initBookingUserFromQuery());
562  }
563  }
564 
565  if ($this->getProperty("settings")) {
566  $this->addBlockCommand(
567  $this->ctrl->getLinkTarget($this, "editSettings"),
568  $this->lng->txt("settings")
569  );
570  }
571 
572  $this->ctrl->setParameterByClass($this->getParentGUI(), "seed", $this->seed->get(IL_CAL_DATE));
573  $ret = parent::getHTML();
574  $this->ctrl->setParameterByClass($this->getParentGUI(), "seed", "");
575 
576  // workaround to include asynch code from ui only one time, see #20853
577  if ($this->ctrl->isAsynch()) {
578  $f = $this->ui->factory()->legacy("");
579  $ret .= $this->ui->renderer()->renderAsync($f);
580  }
581  if (count($this->modals) > 0) {
582  if ($this->ctrl->isAsynch()) {
583  $ret .= $this->ui->renderer()->renderAsync($this->modals);
584  } else {
585  $ret .= $this->ui->renderer()->render($this->modals);
586  }
587  }
588  return $ret;
589  }
ilObjUser $user
ilLanguage $lng
static _before(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static _lookupFullname(int $a_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_CAL_UNIX
$path
Definition: ltiservices.php:32
const IL_CAL_DAY
ilObjectDataCache $obj_data_cache
static _getInstanceByObjId(int $a_obj_id)
static getAppointments(int $a_user_id)
Get all appointments.
const IL_CAL_DATE
static lookupBookableUsersForObject(array $a_obj_id, array $a_user_ids)
Consultation hours are offered if 1) consultation hour owner is admin or tutor and no object assignme...
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
getProperty(string $a_property)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLegacyContent()

ilCalendarBlockGUI::getLegacyContent ( )
protected

Definition at line 862 of file class.ilCalendarBlockGUI.php.

References ilBlockGUI\$tpl, addMiniMonth(), addSubscriptionButton(), and ilTemplate\get().

862  : string
863  {
864  $tpl = new ilTemplate(
865  "tpl.calendar_block.html",
866  true,
867  true,
868  "Services/Calendar"
869  );
870 
871  $this->addMiniMonth($tpl);
872 
873  $panel_tpl = new \ilTemplate(
874  'tpl.cal_block_panel.html',
875  true,
876  true,
877  'Services/Calendar'
878  );
879 
880  $this->addSubscriptionButton($panel_tpl);
881 
882  return $tpl->get() . $panel_tpl->get();
883  }
get(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
ilTemplate $tpl
addMiniMonth(ilTemplate $a_tpl, bool $a_include_view_ctrl=false)
Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab...
addSubscriptionButton(ilTemplate $panel_template)
Add subscription button.
+ Here is the call graph for this function:

◆ getListItemForData()

ilCalendarBlockGUI::getListItemForData ( array  $data)
protected

Definition at line 888 of file class.ilCalendarBlockGUI.php.

References $factory, and ILIAS\Repository\ui().

889  {
890  $factory = $this->ui->factory();
891  if (isset($data["modal"])) {
892  $this->modals[] = $data["modal"];
893  }
894  if (isset($data["shy_button"])) {
895  return $factory->item()->standard($data["shy_button"])->withDescription($data["date"]);
896  } else {
897  return $factory->item()->standard($data["date"]);
898  }
899  }
Common interface to all items.
Definition: Item.php:31
$factory
Definition: metadata.php:75
+ Here is the call graph for this function:

◆ getModalForApp()

ilCalendarBlockGUI::getModalForApp ( )

Get modal for appointment (see similar code in ilCalendarAgendaListGUI) todo use all this methods from ilcalendarviewgui.php.

Definition at line 814 of file class.ilCalendarBlockGUI.php.

References Vendor\Package\$f, ilBlockGUI\$ui, ilCalendarAppointmentPresentationGUI\_getInstance(), ILIAS\Repository\ctrl(), exit, ilDatePresentation\formatPeriod(), getDatesForItem(), getEvents(), initAppointmentIdFromQuery(), initCategories(), and initInitialDateQuery().

815  {
816  $this->initCategories();
817  $ui = $this->ui;
818 
819  $f = $ui->factory();
820  $r = $ui->renderer();
821 
822  // @todo: this needs optimization
823  $events = $this->getEvents();
824  foreach ($events as $item) {
825  if ($item["event"]->getEntryId() == $this->initAppointmentIdFromQuery() && $item['dstart'] == $this->initInitialDateQuery()) {
826  $dates = $this->getDatesForItem($item);
827 
828  // content of modal
829  $next_gui = ilCalendarAppointmentPresentationGUI::_getInstance($this->seed, $item);
830  $content = $this->ctrl->getHTML($next_gui);
831 
832  $modal = $f->modal()->roundtrip(
833  ilDatePresentation::formatPeriod($dates["start"], $dates["end"]),
834  $f->legacy($content)
835  );
836  echo $r->renderAsync($modal);
837  }
838  }
839  exit();
840  }
static _getInstance(ilDate $seed, array $a_app)
get singleton instance
exit
Definition: login.php:28
ILIAS DI UIServices $ui
getDatesForItem(array $item)
Get start/end date for item.
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilCalendarBlockGUI::getNoItemFoundContent ( )

No item entry.

Returns
string

Definition at line 905 of file class.ilCalendarBlockGUI.php.

References ILIAS\Repository\lng().

905  : string
906  {
907  return $this->lng->txt("cal_no_events_block");
908  }
+ Here is the call graph for this function:

◆ getOverview()

ilCalendarBlockGUI::getOverview ( )

Definition at line 591 of file class.ilCalendarBlockGUI.php.

References ilBlockGUI\$lng, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilCalendarSchedule\TYPE_INBOX.

591  : string
592  {
593  $lng = $this->lng;
594 
595  $schedule = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_INBOX);
596  $events = $schedule->getChangedEvents(true);
597 
598  $this->ctrl->setParameterByClass('ilcalendarinboxgui', 'changed', 1);
599  $link = '<a href=' . $this->ctrl->getLinkTargetByClass('ilcalendarinboxgui', '') . '>';
600  $this->ctrl->setParameterByClass('ilcalendarinboxgui', 'changed', '');
601  $text = '<div class="small">' . (count($events)) . " " . $this->lng->txt("cal_changed_events_header") . "</div>";
602  $end_link = '</a>';
603 
604  return $link . $text . $end_link;
605  }
ilLanguage $lng
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
+ Here is the call graph for this function:

◆ getParentGUI()

ilCalendarBlockGUI::getParentGUI ( )

Definition at line 185 of file class.ilCalendarBlockGUI.php.

References $parent_gui.

Referenced by getHTML().

185  : string
186  {
187  return $this->parent_gui;
188  }
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilCalendarBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Definition at line 207 of file class.ilCalendarBlockGUI.php.

References $DIC, and IL_SCREEN_CENTER.

207  : string
208  {
209  global $DIC;
210 
211  $ilCtrl = $DIC->ctrl();
212  $cmd_class = $ilCtrl->getCmdClass();
213 
214  $cmd = $ilCtrl->getCmd();
215 
216  if ($cmd_class == "ilcalendarappointmentgui" ||
217  $cmd_class == "ilconsultationhoursgui" ||
218  $cmd == 'showCalendarSubscription') {
219  return IL_SCREEN_CENTER;
220  }
221  return '';
222  }
global $DIC
Definition: feed.php:28
const IL_SCREEN_CENTER

◆ getShowWeeksColumn()

ilCalendarBlockGUI::getShowWeeksColumn ( )

Show weeks column.

Definition at line 159 of file class.ilCalendarBlockGUI.php.

References ILIAS\Repository\settings().

Referenced by addMiniMonth().

159  : bool
160  {
161  return ($this->settings->getShowWeeks() && $this->user_settings->getShowWeeks());
162  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTargetGUIClassPath()

ilCalendarBlockGUI::getTargetGUIClassPath ( )

Definition at line 290 of file class.ilCalendarBlockGUI.php.

References ilObject\_lookupType(), and ilBlockGUI\getRepositoryMode().

Referenced by addMiniMonth(), addSubscriptionButton(), and getHTML().

290  : array
291  {
292  $target_class = array();
293  if (!$this->getRepositoryMode()) {
294  $target_class = array("ildashboardgui", "ilcalendarpresentationgui");
295  } else {
296  switch (ilObject::_lookupType((int) $this->requested_ref_id, true)) {
297  case "crs":
298  $target_class = array("ilobjcoursegui", "ilcalendarpresentationgui");
299  break;
300 
301  case "grp":
302  $target_class = array("ilobjgroupgui", "ilcalendarpresentationgui");
303  break;
304  }
305  }
306  return $target_class;
307  }
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewControl()

ilCalendarBlockGUI::getViewControl ( )
protected

Definition at line 432 of file class.ilCalendarBlockGUI.php.

References $id, ilBlockGUI\$lng, ilBlockGUI\$ui, ILIAS\Repository\ctrl(), IL_CAL_DATE, ILIAS\Repository\lng(), ilDateTime\MONTH, and ILIAS\UI\Implementation\Component\withOnLoadCode().

Referenced by addMiniMonth(), and getViewControls().

432  : Section
433  {
434  $ui = $this->ui;
435  $lng = $this->lng;
436 
437  $first_of_month = substr($this->seed->get(IL_CAL_DATE), 0, 7) . "-01";
438  $myseed = new ilDate($first_of_month, IL_CAL_DATE);
439 
440  $myseed->increment(ilDateTime::MONTH, -1);
441  $this->ctrl->setParameter($this, 'seed', $myseed->get(IL_CAL_DATE));
442 
443  $prev_link = $this->ctrl->getLinkTarget($this, "setSeed", "", true);
444 
445  $myseed->increment(ilDateTime::MONTH, 2);
446  $this->ctrl->setParameter($this, 'seed', $myseed->get(IL_CAL_DATE));
447  $next_link = $this->ctrl->getLinkTarget($this, "setSeed", "", true);
448 
449  $this->ctrl->setParameter($this, 'seed', "");
450 
451  $blockgui = $this;
452 
453  // view control
454  // ... previous button
455  $b1 = $ui->factory()->button()->standard($this->lng->txt("previous"), "#")->withOnLoadCode(function ($id) use (
456  $prev_link,
457  $blockgui
458  ) {
459  return
460  "$('#" . $id . "').click(function() { ilBlockJSHandler('block_" . $blockgui->getBlockType() .
461  "_" . $blockgui->getBlockId() . "','" . $prev_link . "'); return false;});";
462  });
463 
464  // ... month button
465  $this->ctrl->clearParameterByClass("ilcalendarblockgui", 'seed');
466  $month_link = $this->ctrl->getLinkTarget($this, "setSeed", "", true, false);
467  $seed_parts = explode("-", $this->seed->get(IL_CAL_DATE));
468  $b2 = $ui->factory()->button()->month($seed_parts[1] . "-" . $seed_parts[0])->withOnLoadCode(function ($id) use (
469  $month_link,
470  $blockgui
471  ) {
472  return "$('#" . $id . "').on('il.ui.button.month.changed', function(el, id, month) { var m = month.split('-'); ilBlockJSHandler('block_" . $blockgui->getBlockType() .
473  "_" . $blockgui->getBlockId() . "','" . $month_link . "' + '&seed=' + m[1] + '-' + m[0] + '-01'); return false;});";
474  });
475  // ... next button
476  $b3 = $ui->factory()->button()->standard($this->lng->txt("next"), "#")->withOnLoadCode(function ($id) use (
477  $next_link,
478  $blockgui
479  ) {
480  return
481  "$('#" . $id . "').click(function() { ilBlockJSHandler('block_" . $blockgui->getBlockType() .
482  "_" . $blockgui->getBlockId() . "','" . $next_link . "'); return false;});";
483  });
484 
485  return $ui->factory()->viewControl()->section($b1, $b2, $b3);
486  }
ILIAS DI UIServices $ui
ilLanguage $lng
const IL_CAL_DATE
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewControls()

ilCalendarBlockGUI::getViewControls ( )
protected

Definition at line 851 of file class.ilCalendarBlockGUI.php.

References ilBlockGUI\getPresentation(), getViewControl(), and ILIAS\UI\Implementation\Component\ViewControl\getViewControls().

851  : array
852  {
853  if ($this->getPresentation() == self::PRES_SEC_LEG) {
854  return [$this->getViewControl()];
855  }
856  return parent::getViewControls();
857  }
+ Here is the call graph for this function:

◆ initAppointmentIdFromQuery()

ilCalendarBlockGUI::initAppointmentIdFromQuery ( )
protected

Definition at line 134 of file class.ilCalendarBlockGUI.php.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by executeCommand(), getData(), and getModalForApp().

134  : int
135  {
136  if ($this->http->wrapper()->query()->has('app_id')) {
137  return $this->http->wrapper()->query()->retrieve(
138  'app_id',
139  $this->refinery->kindlyTo()->int()
140  );
141  }
142  return 0;
143  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initBookingUserFromQuery()

ilCalendarBlockGUI::initBookingUserFromQuery ( )
protected

Definition at line 112 of file class.ilCalendarBlockGUI.php.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by addMiniMonth(), and getHTML().

112  : int
113  {
114  if ($this->http->wrapper()->query()->has('bkid')) {
115  return $this->http->wrapper()->query()->retrieve(
116  'bkid',
117  $this->refinery->kindlyTo()->int()
118  );
119  }
120  return 0;
121  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCategories()

ilCalendarBlockGUI::initCategories ( )
protected

Definition at line 607 of file class.ilCalendarBlockGUI.php.

References ilCalendarCategories\_getInstance(), getForceMonthView(), ilCalendarCategories\MODE_REPOSITORY, and ilCalendarCategories\MODE_REPOSITORY_CONTAINER_ONLY.

Referenced by executeCommand(), getHTML(), and getModalForApp().

607  : void
608  {
611  if ($this->getForceMonthView()) {
612  // old comment: in full container calendar presentation (allows selection of other calendars)
613  } elseif (!$cats->getMode()) {
614  $cats->initialize(
616  (int) $this->requested_ref_id,
617  true
618  );
619  }
620  }
static _getInstance($a_usr_id=0)
get singleton instance
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCommands()

ilCalendarBlockGUI::initCommands ( )
protected

Definition at line 646 of file class.ilCalendarBlockGUI.php.

References ilBlockGUI\$lng, ILIAS\Repository\access(), ilBlockGUI\addBlockCommand(), ILIAS\Repository\ctrl(), getForceMonthView(), ilBlockGUI\getRepositoryMode(), and ILIAS\Repository\lng().

646  : void
647  {
648  $lng = $this->lng;
649 
650  if (!$this->getForceMonthView()) {
651  // @todo: set checked on ($this->display_mode != 'mmon')
652  $this->addBlockCommand(
653  $this->ctrl->getLinkTarget($this, "setPdModeEvents"),
654  $this->lng->txt("cal_upcoming_events_header"),
655  ""
656  // see #35777 $this->ctrl->getLinkTarget($this, "setPdModeEvents", "", true)
657  );
658 
659  // @todo: set checked on ($this->display_mode == 'mmon')
660  $this->addBlockCommand(
661  $this->ctrl->getLinkTarget($this, "setPdModeMonth"),
662  $this->lng->txt("app_month"),
663  $this->ctrl->getLinkTarget($this, "setPdModeMonth", "", true)
664  );
665 
666  if ($this->getRepositoryMode()) {
667  #23921
668  $this->ctrl->setParameterByClass('ilcalendarpresentationgui', 'seed', '');
669  $this->addBlockCommand(
670  $this->ctrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ""),
671  $this->lng->txt("cal_open_calendar")
672  );
673 
674  if ($this->access->checkAccess('edit_event', '', (int) $this->requested_ref_id)) {
675  $this->ctrl->setParameter($this, "add_mode", "");
676  $this->addBlockCommand(
677  $this->ctrl->getLinkTargetByClass("ilCalendarAppointmentGUI", "add"),
678  $this->lng->txt("add_appointment")
679  );
680  $this->ctrl->setParameter($this, "add_mode", "");
681  }
682  }
683  }
684  }
ilLanguage $lng
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
+ Here is the call graph for this function:

◆ initInitialDateQuery()

ilCalendarBlockGUI::initInitialDateQuery ( )
protected

Definition at line 145 of file class.ilCalendarBlockGUI.php.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by getData(), and getModalForApp().

145  : int
146  {
147  if ($this->http->wrapper()->query()->has('dt')) {
148  return $this->http->wrapper()->query()->retrieve(
149  'dt',
150  $this->refinery->kindlyTo()->int()
151  );
152  }
153  return 0;
154  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSeedFromQuery()

ilCalendarBlockGUI::initSeedFromQuery ( )
protected

Definition at line 123 of file class.ilCalendarBlockGUI.php.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by __construct(), and setSeed().

123  : string
124  {
125  if ($this->http->wrapper()->query()->has('seed')) {
126  return $this->http->wrapper()->query()->retrieve(
127  'seed',
128  $this->refinery->kindlyTo()->string()
129  );
130  }
131  return '';
132  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

ilCalendarBlockGUI::isRepositoryObject ( )
protected

Definition at line 175 of file class.ilCalendarBlockGUI.php.

175  : bool
176  {
177  return false;
178  }

◆ returnToUpperContext()

ilCalendarBlockGUI::returnToUpperContext ( )

Definition at line 641 of file class.ilCalendarBlockGUI.php.

References ILIAS\Repository\ctrl().

Referenced by setSeed().

641  : void
642  {
643  $this->ctrl->returnToParent($this);
644  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setForceMonthView()

ilCalendarBlockGUI::setForceMonthView ( bool  $a_val)

Definition at line 190 of file class.ilCalendarBlockGUI.php.

References ilBlockGUI\setPresentation().

190  : void
191  {
192  $this->force_month_view = $a_val;
193  if ($a_val) {
194  $this->display_mode = "mmon";
195  $this->setPresentation(self::PRES_SEC_LEG);
196  }
197  }
setPresentation(int $type)
+ Here is the call graph for this function:

◆ setParentGUI()

ilCalendarBlockGUI::setParentGUI ( string  $a_val)

Definition at line 180 of file class.ilCalendarBlockGUI.php.

180  : void
181  {
182  $this->parent_gui = $a_val;
183  }

◆ setPdModeEvents()

ilCalendarBlockGUI::setPdModeEvents ( )

Definition at line 686 of file class.ilCalendarBlockGUI.php.

References $ilUser, ilBlockGUI\$user, ILIAS\Repository\ctrl(), exit, getHTML(), ilBlockGUI\setPresentation(), and ILIAS\Repository\user().

686  : void
687  {
689 
690  $this->user->writePref("il_pd_cal_mode", "evt");
691  $this->display_mode = "evt";
692  $this->setPresentation(self::PRES_SEC_LIST);
693  if ($this->ctrl->isAsynch()) {
694  echo $this->getHTML();
695  exit;
696  } else {
697  $this->ctrl->returnToParent($this);
698  }
699  }
ilObjUser $user
exit
Definition: login.php:28
getHTML()
Get bloch HTML code.
$ilUser
Definition: imgupload.php:34
setPresentation(int $type)
+ Here is the call graph for this function:

◆ setPdModeMonth()

ilCalendarBlockGUI::setPdModeMonth ( )

Definition at line 701 of file class.ilCalendarBlockGUI.php.

References $ilUser, ilBlockGUI\$user, ILIAS\Repository\ctrl(), exit, getHTML(), ilBlockGUI\setPresentation(), and ILIAS\Repository\user().

701  : void
702  {
704 
705  $this->user->writePref("il_pd_cal_mode", "mmon");
706  $this->display_mode = "mmon";
707  $this->setPresentation(self::PRES_SEC_LEG);
708  if ($this->ctrl->isAsynch()) {
709  echo $this->getHTML();
710  exit;
711  } else {
712  $this->ctrl->redirectByClass("ildashboardgui", "show");
713  }
714  }
ilObjUser $user
exit
Definition: login.php:28
getHTML()
Get bloch HTML code.
$ilUser
Definition: imgupload.php:34
setPresentation(int $type)
+ Here is the call graph for this function:

◆ setSeed()

ilCalendarBlockGUI::setSeed ( )

Definition at line 627 of file class.ilCalendarBlockGUI.php.

References ILIAS\Repository\ctrl(), exit, ilBlockGUI\getBlockId(), getBlockType(), getHTML(), initSeedFromQuery(), returnToUpperContext(), and ilSession\set().

627  : void
628  {
630  "il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed",
631  $this->initSeedFromQuery()
632  );
633  if ($this->ctrl->isAsynch()) {
634  echo $this->getHTML();
635  exit;
636  } else {
637  $this->returnToUpperContext();
638  }
639  }
exit
Definition: login.php:28
getHTML()
Get bloch HTML code.
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ setSubTabs()

ilCalendarBlockGUI::setSubTabs ( )
protected

Definition at line 622 of file class.ilCalendarBlockGUI.php.

References ILIAS\Repository\tabs().

Referenced by executeCommand().

622  : void
623  {
624  $this->tabs->clearSubTabs();
625  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $block_type

string ilCalendarBlockGUI::$block_type = "cal"
static

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

◆ $cal_footer

array ilCalendarBlockGUI::$cal_footer = []
protected

Definition at line 35 of file class.ilCalendarBlockGUI.php.

◆ $display_mode

string ilCalendarBlockGUI::$display_mode = ''
protected

Definition at line 40 of file class.ilCalendarBlockGUI.php.

◆ $force_month_view

bool ilCalendarBlockGUI::$force_month_view = false
protected

Definition at line 55 of file class.ilCalendarBlockGUI.php.

Referenced by getForceMonthView().

◆ $help

ilHelpGUI ilCalendarBlockGUI::$help
protected

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

◆ $http

HttpServices ilCalendarBlockGUI::$http
protected

Definition at line 38 of file class.ilCalendarBlockGUI.php.

◆ $logger

ilLogger ilCalendarBlockGUI::$logger
protected

Definition at line 41 of file class.ilCalendarBlockGUI.php.

◆ $modals

array ilCalendarBlockGUI::$modals = []
protected

Definition at line 58 of file class.ilCalendarBlockGUI.php.

◆ $mode

int ilCalendarBlockGUI::$mode = ilCalendarCategories::MODE_UNDEFINED
protected

Definition at line 39 of file class.ilCalendarBlockGUI.php.

◆ $new_rendering

bool ilCalendarBlockGUI::$new_rendering = true
protected

Definition at line 846 of file class.ilCalendarBlockGUI.php.

◆ $obj_data_cache

ilObjectDataCache ilCalendarBlockGUI::$obj_data_cache
protected

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

Referenced by getHTML().

◆ $parent_gui

string ilCalendarBlockGUI::$parent_gui = ilColumnGUI::class
protected

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

Referenced by getParentGUI().

◆ $refinery

RefineryFactory ilCalendarBlockGUI::$refinery
protected

Definition at line 37 of file class.ilCalendarBlockGUI.php.

◆ $requested_cal_agenda_per

int ilCalendarBlockGUI::$requested_cal_agenda_per
protected

Definition at line 57 of file class.ilCalendarBlockGUI.php.

◆ $scheduler

ilCalendarSchedule ilCalendarBlockGUI::$scheduler = null
protected

Definition at line 36 of file class.ilCalendarBlockGUI.php.

◆ $seed

ilDate ilCalendarBlockGUI::$seed
protected

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

◆ $settings

ilCalendarSettings ilCalendarBlockGUI::$settings
protected

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

◆ $tabs

ilTabsGUI ilCalendarBlockGUI::$tabs
protected

Definition at line 45 of file class.ilCalendarBlockGUI.php.

◆ $user_settings

ilCalendarUserSettings ilCalendarBlockGUI::$user_settings
protected

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


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