ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 ()
 
 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...
 
 getViewControlsForPanel ()
 
 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 ()
 
 checkOffset (int $offset)
 
 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="", ?RoundTrip $modal=null)
 
 getBlockCommands ()
 
 getHTML ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getViewControlsForPanel ()
 
 sortObject ()
 
 addSortOption (string $option, string $label, bool $active)
 
 setSortTarget (string $target)
 
 addPresentation (string $label, string $target, bool $active)
 
 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 ()
 
 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 ()
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. 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...
 
 getActionsForPanel ()
 
 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 = []
 
- Protected Attributes inherited from ilBlockGUI
ILIAS UI Renderer $renderer
 
Factory $factory
 
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
 

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(), null, 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:31
setEnableNumInfo(bool $a_enablenuminfo)
static _getInstanceByUserId(int $a_user_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
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 294 of file class.ilCalendarBlockGUI.php.

References ilBlockGUI\$lng, $path, ilBlockGUI\$ui, ilBlockGUI\$user, $user_id, 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 getLegacyContent().

294  : void
295  {
296  $lng = $this->lng;
297  $ilUser = $this->user;
298  $ui = $this->ui;
299 
300  // weekdays
301  if ($this->getShowWeeksColumn()) {
302  $a_tpl->setCurrentBlock('month_header_col');
303  $a_tpl->setVariable('TXT_WEEKDAY', $this->lng->txt("cal_week_abbrev"));
304  $a_tpl->parseCurrentBlock();
305  }
306  for ($i = $this->user_settings->getWeekStart(); $i < (7 + $this->user_settings->getWeekStart()); $i++) {
307  $a_tpl->setCurrentBlock('month_header_col');
308  $a_tpl->setVariable('TXT_WEEKDAY', ilCalendarUtil::_numericDayToString($i, false));
309  $a_tpl->parseCurrentBlock();
310  }
311 
312  $bkid = $this->initBookingUserFromQuery();
313  if ($bkid) {
314  $user_id = $bkid;
315  $disable_empty = true;
316  } else {
317  $user_id = $this->user->getId();
318  $disable_empty = false;
319  }
320  $this->scheduler = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_MONTH, $user_id);
321  $this->scheduler->addSubitemCalendars(true);
322  $this->scheduler->calculate();
323 
324  $counter = 0;
326  (int) $this->seed->get(IL_CAL_FKT_DATE, 'm'),
327  (int) $this->seed->get(IL_CAL_FKT_DATE, 'Y'),
328  $this->user_settings->getWeekStart()
329  )->get() as $date) {
330  $counter++;
331 
332  $events = $this->scheduler->getByDay($date, $this->user->getTimeZone());
333  $has_events = (bool) count($events);
334  if ($has_events || !$disable_empty) {
335  $a_tpl->setCurrentBlock('month_col_link');
336  } else {
337  $a_tpl->setCurrentBlock('month_col_no_link');
338  }
339 
340  if ($disable_empty) {
341  if (!$has_events) {
342  $a_tpl->setVariable('DAY_CLASS', 'calminiinactive');
343  } else {
344  $week_has_events = true;
345  foreach ($events as $event) {
346  $booking = new ilBookingEntry($event['event']->getContextId());
347  if ($booking->hasBooked($event['event']->getEntryId())) {
348  $a_tpl->setVariable('DAY_CLASS', 'calminiapp');
349  break;
350  }
351  }
352  }
353  } elseif ($has_events) {
354  $week_has_events = true;
355  $a_tpl->setVariable('DAY_CLASS', 'calminiapp');
356  }
357 
358  $day = $date->get(IL_CAL_FKT_DATE, 'j');
359  $month = $date->get(IL_CAL_FKT_DATE, 'n');
360 
361  $month_day = $day;
362 
363  $path = $this->getTargetGUIClassPath();
364  $last_gui = end($path);
365  $this->ctrl->setParameterByClass($last_gui, 'seed', $date->get(IL_CAL_DATE));
366  if ($agenda_view_type = $this->requested_cal_agenda_per) {
367  $this->ctrl->setParameterByClass($last_gui, "cal_agenda_per", $agenda_view_type);
368  }
369  $a_tpl->setVariable('OPEN_DAY_VIEW', $this->ctrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ''));
370 
371  $a_tpl->setVariable('MONTH_DAY', $month_day);
372 
373  $a_tpl->parseCurrentBlock();
374 
375  $a_tpl->setCurrentBlock('month_col');
376 
377  if (ilCalendarUtil::_isToday($date)) {
378  $a_tpl->setVariable('TD_CLASS', 'calminitoday');
379  } elseif (ilDateTime::_equals($date, $this->seed, IL_CAL_MONTH)) {
380  $a_tpl->setVariable('TD_CLASS', 'calministd');
381  } elseif (ilDateTime::_before($date, $this->seed, IL_CAL_MONTH)) {
382  $a_tpl->setVariable('TD_CLASS', 'calminiprev');
383  } else {
384  $a_tpl->setVariable('TD_CLASS', 'calmininext');
385  }
386 
387  $a_tpl->parseCurrentBlock();
388 
389  if ($counter and !($counter % 7)) {
390  if ($this->getShowWeeksColumn()) {
391  $a_tpl->setCurrentBlock('week');
392  $a_tpl->setVariable(
393  'WEEK',
394  $date->get(IL_CAL_FKT_DATE, 'W')
395  );
396  $a_tpl->parseCurrentBlock();
397  }
398 
399  $a_tpl->setCurrentBlock('month_row');
400  $a_tpl->parseCurrentBlock();
401 
402  $week_has_events = false;
403  }
404  }
405  $a_tpl->setCurrentBlock('mini_month');
406  if ($a_include_view_ctrl) {
407  $a_tpl->setVariable("VIEW_CTRL_SECTION", $ui->renderer()->render($this->getViewControl()));
408  }
409 
410  $a_tpl->parseCurrentBlock();
411  }
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.
const IL_CAL_MONTH
$path
Definition: ltiservices.php:29
static _numericDayToString(int $a_day, bool $a_long=true, ?ilLanguage $lng=null)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
const IL_CAL_FKT_DATE
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
const IL_CAL_DATE
static _equals(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
Check if two date are equal.
static _isToday(ilDateTime $date)
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 885 of file class.ilCalendarBlockGUI.php.

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

Referenced by getLegacyContent().

885  : void
886  {
887  global $DIC;
888 
889  $ui_factory = $DIC->ui()->factory();
890  $ui_renderer = $DIC->ui()->renderer();
891 
892  $gui_path = $this->getTargetGUIClassPath();
893  $gui_path[] = strtolower(\ilCalendarSubscriptionGUI::class);
894  $url = $this->ctrl->getLinkTargetByClass($gui_path, 'getModalForSubscription', "", true, false);
895 
896  $roundtrip_modal = $ui_factory->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
897 
898  $standard_button = $ui_factory->button()->standard($this->lng->txt('btn_ical'), '')->withOnClick(
899  $roundtrip_modal->getShowSignal()
900  );
901  $components = [
902  $roundtrip_modal,
903  $standard_button
904  ];
905 
906  $presentation = $ui_renderer->render($components);
907 
908  $panel_template->setCurrentBlock('subscription_buttons');
909  $panel_template->setVariable('SUBSCRIPTION_BUTTON', $presentation);
910  $panel_template->parseCurrentBlock();
911  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$url
Definition: shib_logout.php:66
$components
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
global $DIC
Definition: shib_login.php:22
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ 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 ilBlockGUI\$presentation, ilCalendarAppointmentPresentationGUI\_getInstance(), ILIAS\Repository\ctrl(), getEventByAppointmentId(), getHTML(), initAppointmentIdFromQuery(), initCategories(), ILIAS\Repository\logger(), null, 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 
246  $app = $this->getEventByAppointmentId($this->initAppointmentIdFromQuery());
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
getEventByAppointmentId(int $a_appointment_id)
getHTML()
Get bloch HTML code.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Administrate calendar appointments.
+ 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 723 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().

723  : array
724  {
725  $lng = $this->lng;
726  $ui = $this->ui;
727 
728  $f = $ui->factory();
729 
730  $events = $this->getEvents();
731 
732  $data = array();
733  if (sizeof($events)) {
734  foreach ($events as $item) {
735  $this->ctrl->setParameter($this, "app_id", $item["event"]->getEntryId());
736  $this->ctrl->setParameter($this, 'dt', $item['dstart']);
737  $url = $this->ctrl->getLinkTarget($this, "getModalForApp", "", true, false);
738  $this->ctrl->setParameter($this, "app_id", $this->initAppointmentIdFromQuery());
739  $this->ctrl->setParameter($this, "dt", $this->initInitialDateQuery());
740  $modal = $f->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
741 
742  $dates = $this->getDatesForItem($item);
743 
744  $shy = $f->button()->shy(
745  $item["event"]->getPresentationTitle(),
746  ""
747  )->withOnClick($modal->getShowSignal());
748 
749  $data[] = array(
750  "date" => ilDatePresentation::formatPeriod($dates["start"], $dates["end"]),
751  "title" => $item["event"]->getPresentationTitle(),
752  "url" => "#",
753  "shy_button" => $shy,
754  "modal" => $modal
755  );
756  }
757  $this->setEnableNumInfo(true);
758  } else {
759  $data = [];
760  /*$data[] = array(
761  "date" => $lng->txt("msg_no_search_result"),
762  "title" => "",
763  "url" => ""
764  ); */
765 
766  $this->setEnableNumInfo(false);
767  }
768 
769  return $data;
770  }
ILIAS DI UIServices $ui
getDatesForItem(array $item)
Get start/end date for item.
ilLanguage $lng
setEnableNumInfo(bool $a_enablenuminfo)
$url
Definition: shib_logout.php:66
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
+ 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 777 of file class.ilCalendarBlockGUI.php.

References IL_CAL_UNIX.

Referenced by getData(), and getModalForApp().

777  : array
778  {
779  $start = $item["dstart"];
780  $end = $item["dend"];
781  if ($item["fullday"]) {
782  $start = new ilDate($start, IL_CAL_UNIX);
783  $end = new ilDate($end, IL_CAL_UNIX);
784  } else {
785  $start = new ilDateTime($start, IL_CAL_UNIX);
786  $end = new ilDateTime($end, IL_CAL_UNIX);
787  }
788  return array("start" => $start, "end" => $end);
789  }
const IL_CAL_UNIX
+ Here is the caller graph for this function:

◆ getEventByAppointmentId()

ilCalendarBlockGUI::getEventByAppointmentId ( int  $a_appointment_id)

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

References getEvents(), and null.

Referenced by executeCommand().

697  : ?array
698  {
699  foreach ($this->getEvents() as $event) {
700  if (
701  array_key_exists('event', $event) &&
702  $event['event'] instanceof ilCalendarEntry &&
703  $event['event']->getEntryId() === $a_appointment_id
704  ) {
705  return $event;
706  }
707  }
708  return null;
709  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEvents()

ilCalendarBlockGUI::getEvents ( )

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

References IL_CAL_DATE, and ilCalendarSchedule\TYPE_PD_UPCOMING.

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

711  : array
712  {
713  $seed = new ilDate(date('Y-m-d', time()), IL_CAL_DATE);
714 
716  $schedule->addSubitemCalendars(true); // #12007
717  $schedule->setEventsLimit(20);
718  $schedule->calculate();
719  // #13809
720  return $schedule->getScheduledEvents();
721  }
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 472 of file class.ilCalendarBlockGUI.php.

References Vendor\Package\$f, ilBlockGUI\$lng, $obj_data_cache, $path, ilBlockGUI\$user, $user_id, 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().

472  : string
473  {
474  $this->initCategories();
475  $lng = $this->lng;
476  $ilObjDataCache = $this->obj_data_cache;
477  $user = $this->user;
478 
479  if ($this->mode == ilCalendarCategories::MODE_REPOSITORY) {
480  $bkid = $this->initBookingUserFromQuery();
481  if (!$bkid) {
482  $obj_id = $ilObjDataCache->lookupObjId((int) $this->requested_ref_id);
483  $participants = ilCourseParticipants::_getInstanceByObjId($obj_id);
484  $users = array_unique(array_merge($participants->getTutors(), $participants->getAdmins()));
485  //$users = $participants->getParticipants();
486  $users = ilBookingEntry::lookupBookableUsersForObject([$obj_id], $users);
487  foreach ($users as $user_id) {
488  $now = new ilDateTime(time(), IL_CAL_UNIX);
489 
490  // default to last booking entry
491  $appointments = ilConsultationHourAppointments::getAppointments($user_id);
492  $next_app = end($appointments);
493  reset($appointments);
494 
495  foreach ($appointments as $entry) {
496  // find next entry
497  if (ilDateTime::_before($entry->getStart(), $now, IL_CAL_DAY)) {
498  continue;
499  }
500  $booking_entry = new ilBookingEntry($entry->getContextId());
501  if (!in_array($obj_id, $booking_entry->getTargetObjIds())) {
502  continue;
503  }
504 
505  if (!$booking_entry->isAppointmentBookableForUser($entry->getEntryId(), $user->getId())) {
506  continue;
507  }
508  $next_app = $entry;
509  break;
510  }
511 
512  $path = $this->getTargetGUIClassPath();
513  $this->ctrl->setParameterByClass(end($path), "ch_user_id", $user_id);
514 
515  if (!$this->getForceMonthView()) {
516  $this->cal_footer[] = array(
517  'link' => $this->ctrl->getLinkTargetByClass(
518  $this->getTargetGUIClassPath(),
519  'selectCHCalendarOfUser'
520  ),
521  'txt' => str_replace(
522  "%1",
523  ilObjUser::_lookupFullname($user_id),
524  $this->lng->txt("cal_consultation_hours_for_user")
525  )
526  );
527  }
528  $path = $this->getTargetGUIClassPath();
529  $last_gui = end($path);
530  $this->ctrl->setParameterByClass($last_gui, "ch_user_id", "");
531  $this->ctrl->setParameterByClass($last_gui, "bkid", $bkid);
532  $this->ctrl->setParameterByClass($last_gui, "seed", $this->seed->get(IL_CAL_DATE));
533  }
534  $this->ctrl->setParameter($this, "bkid", "");
535  $this->ctrl->setParameter($this, 'seed', '');
536  } else {
537  $this->ctrl->setParameter($this, "bkid", "");
538  $this->addBlockCommand(
539  $this->ctrl->getLinkTarget($this),
540  $this->lng->txt("back")
541  );
542  $this->ctrl->setParameter($this, "bkid", $this->initBookingUserFromQuery());
543  }
544  }
545 
546  if ($this->getProperty("settings")) {
547  $this->addBlockCommand(
548  $this->ctrl->getLinkTarget($this, "editSettings"),
549  $this->lng->txt("settings")
550  );
551  }
552 
553  $this->ctrl->setParameterByClass($this->getParentGUI(), "seed", $this->seed->get(IL_CAL_DATE));
554  $ret = parent::getHTML();
555  $this->ctrl->setParameterByClass($this->getParentGUI(), "seed", "");
556 
557  // workaround to include asynch code from ui only one time, see #20853
558  if ($this->ctrl->isAsynch()) {
559  $f = $this->ui->factory()->legacy()->content("");
560  $ret .= $this->ui->renderer()->renderAsync($f);
561  }
562  if (count($this->modals) > 0) {
563  if ($this->ctrl->isAsynch()) {
564  $ret .= $this->ui->renderer()->renderAsync($this->modals);
565  } else {
566  $ret .= $this->ui->renderer()->render($this->modals);
567  }
568  }
569  return $ret;
570  }
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)
const IL_CAL_UNIX
$path
Definition: ltiservices.php:29
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="", ?RoundTrip $modal=null)
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 834 of file class.ilCalendarBlockGUI.php.

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

834  : string
835  {
836  $tpl = new ilTemplate(
837  "tpl.calendar_block.html",
838  true,
839  true,
840  "components/ILIAS/Calendar"
841  );
842 
843  $this->addMiniMonth($tpl);
844 
845  $panel_tpl = new \ilTemplate(
846  'tpl.cal_block_panel.html',
847  true,
848  true,
849  'components/ILIAS/Calendar'
850  );
851 
852  $this->addSubscriptionButton($panel_tpl);
853 
854  return $tpl->get() . $panel_tpl->get();
855  }
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 860 of file class.ilCalendarBlockGUI.php.

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

860  : ?\ILIAS\UI\Component\Item\Item
861  {
862  $factory = $this->ui->factory();
863  if (isset($data["modal"])) {
864  $this->modals[] = $data["modal"];
865  }
866  if (isset($data["shy_button"])) {
867  return $factory->item()->standard($data["shy_button"])->withDescription($data["date"]);
868  } else {
869  return $factory->item()->standard($data["date"]);
870  }
871  }
Factory $factory
+ 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 795 of file class.ilCalendarBlockGUI.php.

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

796  {
797  $this->initCategories();
798  $ui = $this->ui;
799 
800  $f = $ui->factory();
801  $r = $ui->renderer();
802 
803  // @todo: this needs optimization
804  $events = $this->getEvents();
805  foreach ($events as $item) {
806  if ($item["event"]->getEntryId() == $this->initAppointmentIdFromQuery() && $item['dstart'] == $this->initInitialDateQuery()) {
807  $dates = $this->getDatesForItem($item);
808 
809  // content of modal
810  $next_gui = ilCalendarAppointmentPresentationGUI::_getInstance($this->seed, $item);
811  $content = $this->ctrl->getHTML($next_gui);
812 
813  $modal = $f->modal()->roundtrip(
814  ilDatePresentation::formatPeriod($dates["start"], $dates["end"]),
815  $f->legacy()->content($content)
816  );
817  echo $r->renderAsync($modal);
818  }
819  }
820  exit();
821  }
static _getInstance(ilDate $seed, array $a_app)
get singleton instance
ILIAS DI UIServices $ui
getDatesForItem(array $item)
Get start/end date for item.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
$r
+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilCalendarBlockGUI::getNoItemFoundContent ( )

No item entry.

Returns
string

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

References ILIAS\Repository\lng().

877  : string
878  {
879  return $this->lng->txt("cal_no_events_block");
880  }
+ Here is the call graph for this function:

◆ getOverview()

ilCalendarBlockGUI::getOverview ( )

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

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

572  : string
573  {
574  $lng = $this->lng;
575 
576  $schedule = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_INBOX);
577  $events = $schedule->getChangedEvents(true);
578 
579  $this->ctrl->setParameterByClass('ilcalendarinboxgui', 'changed', 1);
580  $link = '<a href=' . $this->ctrl->getLinkTargetByClass('ilcalendarinboxgui', '') . '>';
581  $this->ctrl->setParameterByClass('ilcalendarinboxgui', 'changed', '');
582  $text = '<div class="small">' . (count($events)) . " " . $this->lng->txt("cal_changed_events_header") . "</div>";
583  $end_link = '</a>';
584 
585  return $link . $text . $end_link;
586  }
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: shib_login.php:22
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 271 of file class.ilCalendarBlockGUI.php.

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

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

271  : array
272  {
273  $target_class = array();
274  if (!$this->getRepositoryMode()) {
275  $target_class = array("ildashboardgui", "ilcalendarpresentationgui");
276  } else {
277  switch (ilObject::_lookupType((int) $this->requested_ref_id, true)) {
278  case "crs":
279  $target_class = array("ilobjcoursegui", "ilcalendarpresentationgui");
280  break;
281 
282  case "grp":
283  $target_class = array("ilobjgroupgui", "ilcalendarpresentationgui");
284  break;
285  }
286  }
287  return $target_class;
288  }
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 413 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 getViewControlsForPanel().

413  : Section
414  {
415  $ui = $this->ui;
416  $lng = $this->lng;
417 
418  $first_of_month = substr($this->seed->get(IL_CAL_DATE), 0, 7) . "-01";
419  $myseed = new ilDate($first_of_month, IL_CAL_DATE);
420 
421  $myseed->increment(ilDateTime::MONTH, -1);
422  $this->ctrl->setParameter($this, 'seed', $myseed->get(IL_CAL_DATE));
423 
424  $prev_link = $this->ctrl->getLinkTarget($this, "setSeed", "", true);
425 
426  $myseed->increment(ilDateTime::MONTH, 2);
427  $this->ctrl->setParameter($this, 'seed', $myseed->get(IL_CAL_DATE));
428  $next_link = $this->ctrl->getLinkTarget($this, "setSeed", "", true);
429 
430  $this->ctrl->setParameter($this, 'seed', "");
431 
432  $blockgui = $this;
433 
434  // view control
435  // ... previous button
436  $b1 = $ui->factory()->button()->standard($this->lng->txt("previous"), "#")->withOnLoadCode(function ($id) use (
437  $prev_link,
438  $blockgui
439  ) {
440  return
441  "$('#" . $id . "').click(function() { ilBlockJSHandler('block_" . $blockgui->getBlockType() .
442  "_" . $blockgui->getBlockId() . "','" . $prev_link . "'); return false;});";
443  });
444 
445  // ... month button
446  $this->ctrl->clearParameterByClass("ilcalendarblockgui", 'seed');
447  $month_link = $this->ctrl->getLinkTarget($this, "setSeed", "", true, false);
448  $seed_parts = explode("-", $this->seed->get(IL_CAL_DATE));
449  $b2 = $ui->factory()->button()->month($seed_parts[1] . "-" . $seed_parts[0])->withOnLoadCode(function ($id) use (
450  $month_link,
451  $blockgui
452  ) {
453  return "$('#" . $id . "').on('il.ui.button.month.changed', function(el, id, month) { var m = month.split('-'); ilBlockJSHandler('block_" . $blockgui->getBlockType() .
454  "_" . $blockgui->getBlockId() . "','" . $month_link . "' + '&seed=' + m[1] + '-' + m[0] + '-01'); return false;});";
455  });
456  // ... next button
457  $b3 = $ui->factory()->button()->standard($this->lng->txt("next"), "#")->withOnLoadCode(function ($id) use (
458  $next_link,
459  $blockgui
460  ) {
461  return
462  "$('#" . $id . "').click(function() { ilBlockJSHandler('block_" . $blockgui->getBlockType() .
463  "_" . $blockgui->getBlockId() . "','" . $next_link . "'); return false;});";
464  });
465 
466  return $ui->factory()->viewControl()->section($b1, $b2, $b3);
467  }
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:

◆ getViewControlsForPanel()

ilCalendarBlockGUI::getViewControlsForPanel ( )

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

References ilBlockGUI\getPresentation(), and getViewControl().

823  : array
824  {
825  if ($this->getPresentation() == self::PRES_SEC_LEG) {
826  return [$this->getViewControl()];
827  }
828  return parent::getViewControlsForPanel();
829  }
+ 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 588 of file class.ilCalendarBlockGUI.php.

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

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

588  : void
589  {
592  if ($this->getForceMonthView()) {
593  // old comment: in full container calendar presentation (allows selection of other calendars)
594  } elseif (!$cats->getMode()) {
595  $cats->initialize(
597  (int) $this->requested_ref_id,
598  true
599  );
600  }
601  }
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 627 of file class.ilCalendarBlockGUI.php.

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

627  : void
628  {
629  $lng = $this->lng;
630 
631  if (!$this->getForceMonthView()) {
632  // @todo: set checked on ($this->display_mode != 'mmon')
633  $this->addBlockCommand(
634  $this->ctrl->getLinkTarget($this, "setPdModeEvents"),
635  $this->lng->txt("cal_upcoming_events_header"),
636  ""
637  // see #35777 $this->ctrl->getLinkTarget($this, "setPdModeEvents", "", true)
638  );
639 
640  // @todo: set checked on ($this->display_mode == 'mmon')
641  $this->addBlockCommand(
642  $this->ctrl->getLinkTarget($this, "setPdModeMonth"),
643  $this->lng->txt("app_month"),
644  $this->ctrl->getLinkTarget($this, "setPdModeMonth", "", true)
645  );
646 
647  if ($this->getRepositoryMode()) {
648  #23921
649  $this->ctrl->setParameterByClass('ilcalendarpresentationgui', 'seed', '');
650  $this->addBlockCommand(
651  $this->ctrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ""),
652  $this->lng->txt("cal_open_calendar")
653  );
654 
655  if ($this->access->checkAccess('edit_event', '', (int) $this->requested_ref_id)) {
656  $this->ctrl->setParameter($this, "add_mode", "");
657  $this->addBlockCommand(
658  $this->ctrl->getLinkTargetByClass("ilCalendarAppointmentGUI", "add"),
659  $this->lng->txt("add_appointment")
660  );
661  $this->ctrl->setParameter($this, "add_mode", "");
662  }
663  }
664  }
665  }
ilLanguage $lng
addBlockCommand(string $a_href, string $a_text, string $a_onclick="", ?RoundTrip $modal=null)
+ 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 622 of file class.ilCalendarBlockGUI.php.

References ILIAS\Repository\ctrl().

Referenced by setSeed().

622  : void
623  {
624  $this->ctrl->returnToParent($this);
625  }
+ 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 667 of file class.ilCalendarBlockGUI.php.

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

667  : void
668  {
669  $ilUser = $this->user;
670 
671  $this->user->writePref("il_pd_cal_mode", "evt");
672  $this->display_mode = "evt";
673  $this->setPresentation(self::PRES_SEC_LIST);
674  if ($this->ctrl->isAsynch()) {
675  echo $this->getHTML();
676  exit;
677  } else {
678  $this->ctrl->returnToParent($this);
679  }
680  }
ilObjUser $user
getHTML()
Get bloch HTML code.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setPresentation(int $type)
+ Here is the call graph for this function:

◆ setPdModeMonth()

ilCalendarBlockGUI::setPdModeMonth ( )

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

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

682  : void
683  {
684  $ilUser = $this->user;
685 
686  $this->user->writePref("il_pd_cal_mode", "mmon");
687  $this->display_mode = "mmon";
688  $this->setPresentation(self::PRES_SEC_LEG);
689  if ($this->ctrl->isAsynch()) {
690  echo $this->getHTML();
691  exit;
692  } else {
693  $this->ctrl->redirectByClass("ildashboardgui", "show");
694  }
695  }
ilObjUser $user
getHTML()
Get bloch HTML code.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setPresentation(int $type)
+ Here is the call graph for this function:

◆ setSeed()

ilCalendarBlockGUI::setSeed ( )

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

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

608  : void
609  {
611  "il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed",
612  $this->initSeedFromQuery()
613  );
614  if ($this->ctrl->isAsynch()) {
615  echo $this->getHTML();
616  exit;
617  } else {
618  $this->returnToUpperContext();
619  }
620  }
getHTML()
Get bloch HTML code.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 603 of file class.ilCalendarBlockGUI.php.

References ILIAS\Repository\tabs().

Referenced by executeCommand().

603  : void
604  {
605  $this->tabs->clearSubTabs();
606  }
+ 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.

◆ $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: