ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 getScreenMode ()
 

Static Public Attributes

static string $block_type = "cal"
 

Protected Member Functions

 initBookingUserFromQuery ()
 
 initSeedFromQuery ()
 
 initAppointmentIdFromQuery ()
 
 initInitialDateQuery ()
 
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 getViewControl ()
 
 initCategories ()
 
 setSubTabs ()
 
 initCommands ()
 
 getLegacyContent ()
 Get legacy content.
Returns
string
More...
 
 getListItemForData (array $data)
 Get list item for data array.
Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item
More...
 
 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 Container Block StandardGUIRequest $request
 
ILIAS Container 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

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

groups and courses

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e @ilCtrl_IsCalledBy ilCalendarBlockGUI: ilColumnGUI @ilCtrl_Calls ilCalendarBlockGUI: ilCalendarAppointmentGUI, ilCalendarMonthGUI, ilCalendarWeekGUI, ilCalendarDayGUI @ilCtrl_Calls ilCalendarBlockGUI: ilConsultationHoursGUI, ilCalendarAppointmentPresentationGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilCalendarBlockGUI::__construct ( )

Constructor.

Todo:
check if setLimit is required

Reimplemented from ilBlockGUI.

Reimplemented in ilPDCalendarBlockGUI.

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

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 }
const IL_CAL_DATE
setTitle(string $a_title)
setPresentation(int $type)
setBlockId(string $a_block_id="0")
setLimit(int $a_limit)
setEnableNumInfo(bool $a_enablenuminfo)
static _getInstanceByUserId(int $a_user_id)
Class for single dates.
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
static has($a_var)
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, $mode, $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().

+ 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.

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

References $counter, ilBlockGUI\$lng, $path, ilBlockGUI\$ui, ilBlockGUI\$user, $user_id, ilDateTime\_before(), ilCalendarUtil\_buildMonthDayList(), ilDateTime\_equals(), ilCalendarUtil\_isToday(), ilCalendarUtil\_numericDayToString(), ilCalendarUtil\_numericMonthToString(), ILIAS\Repository\ctrl(), getShowWeeksColumn(), getTargetGUIClassPath(), 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().

+ 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 893 of file class.ilCalendarBlockGUI.php.

893 : void
894 {
895 global $DIC;
896
897 $ui_factory = $DIC->ui()->factory();
898 $ui_renderer = $DIC->ui()->renderer();
899
900 $gui_path = $this->getTargetGUIClassPath();
901 $gui_path[] = strtolower(\ilCalendarSubscriptionGUI::class);
902 $url = $this->ctrl->getLinkTargetByClass($gui_path, 'getModalForSubscription', "", true, false);
903
904 $roundtrip_modal = $ui_factory->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
905
906 $standard_button = $ui_factory->button()->standard($this->lng->txt('btn_ical'), '')->withOnClick(
907 $roundtrip_modal->getShowSignal()
908 );
909 $components = [
910 $roundtrip_modal,
911 $standard_button
912 ];
913
914 $presentation = $ui_renderer->render($components);
915
916 $panel_template->setCurrentBlock('subscription_buttons');
917 $panel_template->setVariable('SUBSCRIPTION_BUTTON', $presentation);
918 $panel_template->parseCurrentBlock();
919 }
$components
$url
Definition: shib_logout.php:68

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().

+ 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.

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 }
Administrate calendar appointments.
static _getInstance(ilDate $seed, array $a_app)
get singleton instance
getEventByAppointmentId(int $a_appointment_id)
getHTML()
Get bloch HTML code.
Consultation hours editor.

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

+ Here is the call graph for this function:

◆ getBlockType()

ilCalendarBlockGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

Reimplemented in ilPDCalendarBlockGUI.

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

167 : string
168 {
169 return self::$block_type;
170 }

References $block_type.

Referenced by __construct(), and setSeed().

+ Here is the caller graph for this function:

◆ getData()

ilCalendarBlockGUI::getData ( )

Reimplemented from ilBlockGUI.

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

731 : array
732 {
734 $ui = $this->ui;
735
736 $f = $ui->factory();
737
738 $events = $this->getEvents();
739
740 $data = array();
741 if (sizeof($events)) {
742 foreach ($events as $item) {
743 $this->ctrl->setParameter($this, "app_id", $item["event"]->getEntryId());
744 $this->ctrl->setParameter($this, 'dt', $item['dstart']);
745 $url = $this->ctrl->getLinkTarget($this, "getModalForApp", "", true, false);
746 $this->ctrl->setParameter($this, "app_id", $this->initAppointmentIdFromQuery());
747 $this->ctrl->setParameter($this, "dt", $this->initInitialDateQuery());
748 $modal = $f->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
749
750 $dates = $this->getDatesForItem($item);
751
752 $shy = $f->button()->shy(
753 $item["event"]->getPresentationTitle(),
754 ""
755 )->withOnClick($modal->getShowSignal());
756
757 $data[] = array(
758 "date" => ilDatePresentation::formatPeriod($dates["start"], $dates["end"]),
759 "title" => $item["event"]->getPresentationTitle(),
760 "url" => "#",
761 "shy_button" => $shy,
762 "modal" => $modal
763 );
764 }
765 $this->setEnableNumInfo(true);
766 } else {
767 $data = [];
768 /*$data[] = array(
769 "date" => $lng->txt("msg_no_search_result"),
770 "title" => "",
771 "url" => ""
772 ); */
773
774 $this->setEnableNumInfo(false);
775 }
776
777 return $data;
778 }
getDatesForItem(array $item)
Get start/end date for item.
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.

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

+ 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 785 of file class.ilCalendarBlockGUI.php.

785 : array
786 {
787 $start = $item["dstart"];
788 $end = $item["dend"];
789 if ($item["fullday"]) {
790 $start = new ilDate($start, IL_CAL_UNIX);
791 $end = new ilDate($end, IL_CAL_UNIX);
792 } else {
793 $start = new ilDateTime($start, IL_CAL_UNIX);
794 $end = new ilDateTime($end, IL_CAL_UNIX);
795 }
796 return array("start" => $start, "end" => $end);
797 }
const IL_CAL_UNIX
@classDescription Date and time handling

References IL_CAL_UNIX.

Referenced by getData(), and getModalForApp().

+ Here is the caller graph for this function:

◆ getEventByAppointmentId()

ilCalendarBlockGUI::getEventByAppointmentId ( int  $a_appointment_id)

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

705 : ?array
706 {
707 foreach ($this->getEvents() as $event) {
708 if (
709 array_key_exists('event', $event) &&
710 $event['event'] instanceof ilCalendarEntry &&
711 $event['event']->getEntryId() === $a_appointment_id
712 ) {
713 return $event;
714 }
715 }
716 return null;
717 }
Model for a calendar entry.

References getEvents().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEvents()

ilCalendarBlockGUI::getEvents ( )

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

719 : array
720 {
721 $seed = new ilDate(date('Y-m-d', time()), IL_CAL_DATE);
722
724 $schedule->addSubitemCalendars(true); // #12007
725 $schedule->setEventsLimit(20);
726 $schedule->calculate();
727 // #13809
728 return $schedule->getScheduledEvents();
729 }

References $seed, IL_CAL_DATE, and ilCalendarSchedule\TYPE_PD_UPCOMING.

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

+ Here is the caller graph for this function:

◆ getForceMonthView()

ilCalendarBlockGUI::getForceMonthView ( )

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

199 : bool
200 {
202 }

References $force_month_view.

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

+ Here is the caller graph for this function:

◆ getHTML()

ilCalendarBlockGUI::getHTML ( )

Get bloch HTML code.

Reimplemented from ilBlockGUI.

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

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

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLegacyContent()

ilCalendarBlockGUI::getLegacyContent ( )
protected

Get legacy content.

Returns
string

Reimplemented from ilBlockGUI.

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

842 : string
843 {
844 $tpl = new ilTemplate(
845 "tpl.calendar_block.html",
846 true,
847 true,
848 "components/ILIAS/Calendar"
849 );
850
851 $this->addMiniMonth($tpl);
852
853 $panel_tpl = new \ilTemplate(
854 'tpl.cal_block_panel.html',
855 true,
856 true,
857 'components/ILIAS/Calendar'
858 );
859
860 $this->addSubscriptionButton($panel_tpl);
861
862 return $tpl->get() . $panel_tpl->get();
863 }
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.
special template class to simplify handling of ITX/PEAR
get(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
Returns a block with all replacements done.

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

+ Here is the call graph for this function:

◆ getListItemForData()

ilCalendarBlockGUI::getListItemForData ( array  $data)
protected

Get list item for data array.

Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item

Reimplemented from ilBlockGUI.

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

869 {
870 $factory = $this->ui->factory();
871 if (isset($data["modal"])) {
872 $this->modals[] = $data["modal"];
873 }
874 if (isset($data["shy_button"])) {
875 return $factory->item()->standard($data["shy_button"])->withDescription($data["date"]);
876 } else {
877 return $factory->item()->standard($data["date"]);
878 }
879 }
Factory $factory
Common interface to all items.
Definition: Item.php:32

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

+ 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 803 of file class.ilCalendarBlockGUI.php.

804 {
805 $this->initCategories();
806 $ui = $this->ui;
807
808 $f = $ui->factory();
809 $r = $ui->renderer();
810
811 // @todo: this needs optimization
812 $events = $this->getEvents();
813 foreach ($events as $item) {
814 if ($item["event"]->getEntryId() == $this->initAppointmentIdFromQuery() && $item['dstart'] == $this->initInitialDateQuery()) {
815 $dates = $this->getDatesForItem($item);
816
817 // content of modal
818 $next_gui = ilCalendarAppointmentPresentationGUI::_getInstance($this->seed, $item);
819 $content = $this->ctrl->getHTML($next_gui);
820
821 $modal = $f->modal()->roundtrip(
822 ilDatePresentation::formatPeriod($dates["start"], $dates["end"]),
823 $f->legacy()->content($content)
824 );
825 echo $r->renderAsync($modal);
826 }
827 }
828 exit();
829 }
exit

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

+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilCalendarBlockGUI::getNoItemFoundContent ( )

No item entry.

Returns
string

Reimplemented from ilBlockGUI.

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

885 : string
886 {
887 return $this->lng->txt("cal_no_events_block");
888 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getOverview()

ilCalendarBlockGUI::getOverview ( )

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

580 : string
581 {
583
584 $schedule = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_INBOX);
585 $events = $schedule->getChangedEvents(true);
586
587 $this->ctrl->setParameterByClass('ilcalendarinboxgui', 'changed', 1);
588 $link = '<a href=' . $this->ctrl->getLinkTargetByClass('ilcalendarinboxgui', '') . '>';
589 $this->ctrl->setParameterByClass('ilcalendarinboxgui', 'changed', '');
590 $text = '<div class="small">' . (count($events)) . " " . $this->lng->txt("cal_changed_events_header") . "</div>";
591 $end_link = '</a>';
592
593 return $link . $text . $end_link;
594 }

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

+ Here is the call graph for this function:

◆ getParentGUI()

ilCalendarBlockGUI::getParentGUI ( )

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

185 : string
186 {
187 return $this->parent_gui;
188 }

References $parent_gui.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getScreenMode()

static ilCalendarBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

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

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 }
const IL_SCREEN_CENTER

References $DIC, and IL_SCREEN_CENTER.

◆ getShowWeeksColumn()

ilCalendarBlockGUI::getShowWeeksColumn ( )

Show weeks column.

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

159 : bool
160 {
161 return ($this->settings->getShowWeeks() && $this->user_settings->getShowWeeks());
162 }

References ILIAS\Repository\settings().

Referenced by addMiniMonth().

+ 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.

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)

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewControl()

ilCalendarBlockGUI::getViewControl ( )
protected

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

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

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

Referenced by getViewControlsForPanel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getViewControlsForPanel()

ilCalendarBlockGUI::getViewControlsForPanel ( )
Returns
ViewControl\Sortation[]|ViewControl\Pagination[]

Reimplemented from ilBlockGUI.

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

831 : array
832 {
833 if ($this->getPresentation() == self::PRES_SEC_LEG) {
834 return [$this->getViewControl()];
835 }
836 return parent::getViewControlsForPanel();
837 }

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

+ Here is the call graph for this function:

◆ initAppointmentIdFromQuery()

ilCalendarBlockGUI::initAppointmentIdFromQuery ( )
protected

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

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 }

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

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

+ 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.

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 }

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

Referenced by addMiniMonth(), and getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCategories()

ilCalendarBlockGUI::initCategories ( )
protected

Reimplemented in ilPDCalendarBlockGUI.

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

596 : void
597 {
600 if ($this->getForceMonthView()) {
601 // old comment: in full container calendar presentation (allows selection of other calendars)
602 } elseif (!$cats->getMode()) {
603 $cats->initialize(
605 (int) $this->requested_ref_id,
606 true
607 );
608 }
609 }
static _getInstance($a_usr_id=0)
get singleton instance

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCommands()

ilCalendarBlockGUI::initCommands ( )
protected

Reimplemented from ilBlockGUI.

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

635 : void
636 {
638
639 if (!$this->getForceMonthView()) {
640 // @todo: set checked on ($this->display_mode != 'mmon')
641 $this->addBlockCommand(
642 $this->ctrl->getLinkTarget($this, "setPdModeEvents"),
643 $this->lng->txt("cal_upcoming_events_header"),
644 ""
645 // see #35777 $this->ctrl->getLinkTarget($this, "setPdModeEvents", "", true)
646 );
647
648 // @todo: set checked on ($this->display_mode == 'mmon')
649 $this->addBlockCommand(
650 $this->ctrl->getLinkTarget($this, "setPdModeMonth"),
651 $this->lng->txt("app_month"),
652 $this->ctrl->getLinkTarget($this, "setPdModeMonth", "", true)
653 );
654
655 if ($this->getRepositoryMode()) {
656 #23921
657 $this->ctrl->setParameterByClass('ilcalendarpresentationgui', 'seed', '');
658 $this->addBlockCommand(
659 $this->ctrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ""),
660 $this->lng->txt("cal_open_calendar")
661 );
662
663 if ($this->access->checkAccess('edit_event', '', (int) $this->requested_ref_id)) {
664 $this->ctrl->setParameter($this, "add_mode", "");
665 $this->addBlockCommand(
666 $this->ctrl->getLinkTargetByClass("ilCalendarAppointmentGUI", "add"),
667 $this->lng->txt("add_appointment")
668 );
669 $this->ctrl->setParameter($this, "add_mode", "");
670 }
671 }
672 }
673 }

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

+ Here is the call graph for this function:

◆ initInitialDateQuery()

ilCalendarBlockGUI::initInitialDateQuery ( )
protected

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

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 }

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

Referenced by getData(), and getModalForApp().

+ 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.

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 }

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

Referenced by __construct(), and setSeed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

ilCalendarBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Reimplemented from ilBlockGUI.

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

175 : bool
176 {
177 return false;
178 }

◆ returnToUpperContext()

ilCalendarBlockGUI::returnToUpperContext ( )

Reimplemented in ilPDCalendarBlockGUI.

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

630 : void
631 {
632 $this->ctrl->returnToParent($this);
633 }

References ILIAS\Repository\ctrl().

Referenced by setSeed().

+ 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.

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 }

References ilBlockGUI\setPresentation().

+ 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 675 of file class.ilCalendarBlockGUI.php.

675 : void
676 {
677 $ilUser = $this->user;
678
679 $this->user->writePref("il_pd_cal_mode", "evt");
680 $this->display_mode = "evt";
681 $this->setPresentation(self::PRES_SEC_LIST);
682 if ($this->ctrl->isAsynch()) {
683 echo $this->getHTML();
684 exit;
685 } else {
686 $this->ctrl->returnToParent($this);
687 }
688 }

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

+ Here is the call graph for this function:

◆ setPdModeMonth()

ilCalendarBlockGUI::setPdModeMonth ( )

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

690 : void
691 {
692 $ilUser = $this->user;
693
694 $this->user->writePref("il_pd_cal_mode", "mmon");
695 $this->display_mode = "mmon";
696 $this->setPresentation(self::PRES_SEC_LEG);
697 if ($this->ctrl->isAsynch()) {
698 echo $this->getHTML();
699 exit;
700 } else {
701 $this->ctrl->redirectByClass("ildashboardgui", "show");
702 }
703 }

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

+ Here is the call graph for this function:

◆ setSeed()

ilCalendarBlockGUI::setSeed ( )

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

616 : void
617 {
619 "il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed",
620 $this->initSeedFromQuery()
621 );
622 if ($this->ctrl->isAsynch()) {
623 echo $this->getHTML();
624 exit;
625 } else {
626 $this->returnToUpperContext();
627 }
628 }

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

+ Here is the call graph for this function:

◆ setSubTabs()

ilCalendarBlockGUI::setSubTabs ( )
protected

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

611 : void
612 {
613 $this->tabs->clearSubTabs();
614 }

References ILIAS\Repository\tabs().

Referenced by executeCommand().

+ 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.

Referenced by getBlockType().

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

Referenced by __construct().

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

Referenced by getEvents().

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