ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ($a_val)
 Set parent gui. More...
 
 getParentGUI ()
 Get parent gui. More...
 
 setForceMonthView ($a_val)
 Set force month view. More...
 
 getForceMonthView ()
 Get force month view. More...
 
 executeCommand ()
 execute command More...
 
 setEnableEdit ($a_enable_edit=0)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 fillDataSection ()
 Fill data section. More...
 
 getTargetGUIClassPath ()
 Get target gui class path (for presenting the calendar) More...
 
 addMiniMonth ($a_tpl)
 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 ()
 Get overview. More...
 
 addCloseCommand ($a_content_block)
 
 setSeed ()
 Set seed. More...
 
 returnToUpperContext ()
 Return to upper context. More...
 
 showCalendarSubscription ()
 
 fillFooter ()
 
 setFooterLinks ()
 
 setPdModeEvents ()
 
 setPdModeMonth ()
 
 getEvents ()
 Get events. More...
 
 getData ()
 
 getDatesForItem ($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...
 
- Public Member Functions inherited from ilBlockGUI
 getBlockType ()
 
 __construct ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ( $a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

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

Data Fields

 $ctrl = null
 

Static Public Attributes

static $block_type = "cal"
 
static $st_data
 

Protected Member Functions

 isRepositoryObject ()
 
 addSubscriptionBlockCommand ()
 Add subscription block command. More...
 
 initCategories ()
 init categories More...
 
 setSubTabs ()
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Protected Attributes

 $mode
 
 $display_mode
 
 $tabs
 
 $obj_data_cache
 
 $parent_gui = "ilcolumngui"
 
 $ui
 
 $force_month_view = false
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCalendarBlockGUI::__construct ( )

Constructor.

Parameters
booleanskip initialisation (is called by derived PDCalendarBlockGUI class)

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

References $_GET, $_SESSION, $ctrl, $DIC, $ilCtrl, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$main_tpl, $mode, $title, ilBlockGUI\$tpl, ilBlockGUI\$user, ilCalendarSettings\_getInstance(), ilCalendarUserSettings\_getInstanceByUserId(), ilBlockGUI\getBlockId(), getBlockType(), IL_CAL_DATE, IL_CAL_UNIX, ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setBlockId(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setLimit(), settings(), and ilBlockGUI\setTitle().

57  {
58  global $DIC;
59 
60  parent::__construct();
61 
62  $this->tabs = $DIC->tabs();
63  $this->obj_data_cache = $DIC["ilObjDataCache"];
64  $this->ui = $DIC->ui();
65 
66  $lng = $this->lng;
70  $ilHelp = $DIC["ilHelp"];
71 
72 
73  $lng->loadLanguageModule("dateplaner");
74  $ilHelp->addHelpSection("cal_block");
75 
76  include_once("./Services/News/classes/class.ilNewsItem.php");
77 
78  $ilCtrl->saveParameter($this, 'bkid');
79 
80  $this->setBlockId($ilCtrl->getContextObjId());
81 
82  $this->setLimit(5); // @todo: needed?
83 
84  // alex: original detail level 1 did not work anymore
85  $this->setAvailableDetailLevels(1);
86  $this->setEnableNumInfo(false);
87 
88  //if(!isset($_GET["bkid"]))
89  //{
90  $title = $lng->txt("calendar");
91  //}
92  //else
93  //{
94  // $title = $lng->txt("cal_consultation_hours_for")." ".ilObjUser::_lookupFullname($_GET["bkid"]);
95  //}
96 
97  $this->setTitle($title);
98  //$this->setData($data);
99  $this->allow_moving = false;
100  //$this->handleView();
101 
102  include_once('Services/Calendar/classes/class.ilDate.php');
103  include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
104 
105  $seed_str = "";
106  if ((!isset($_GET["seed"]) || $_GET["seed"] == "") &&
107  isset($_SESSION["il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed"])) {
108  $seed_str = $_SESSION["il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed"];
109  } elseif (isset($_GET["seed"])) {
110  $seed_str = $_GET["seed"];
111  }
112 
113  if (isset($_GET["seed"]) && $_GET["seed"] != "") {
114  $_SESSION["il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed"]
115  = $_GET["seed"];
116  }
117 
118  if ($seed_str == "") {
119  $now = new \ilDate(time(), IL_CAL_UNIX);
120  $this->seed = new \ilDate($now->get(IL_CAL_DATE), IL_CAL_DATE);
121  } else {
122  $this->seed = new ilDate($seed_str, IL_CAL_DATE); // @todo: check this
123  }
124 
126  $this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
127 
128  $mode = $ilUser->getPref("il_pd_cal_mode");
129  $this->display_mode = $mode ? $mode : "mmon";
130  }
static _getInstance()
get singleton instance
settings()
Definition: settings.php:2
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _getInstanceByUserId($a_user_id)
get singleton instance
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
Class for single dates.
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
$ilUser
Definition: imgupload.php:18
getBlockId()
Get Block Id.
setLimit($a_limit)
Set Limit.
const IL_CAL_DATE
+ Here is the call graph for this function:

Member Function Documentation

◆ addCloseCommand()

ilCalendarBlockGUI::addCloseCommand (   $a_content_block)

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

References $ctrl, $ilCtrl, and ilBlockGUI\$lng.

722  {
723  $lng = $this->lng;
725 
726  $a_content_block->addHeaderCommand(
727  $ilCtrl->getParentReturn($this),
728  $lng->txt("close"),
729  true
730  );
731  }
global $ilCtrl
Definition: ilias.php:18

◆ addMiniMonth()

ilCalendarBlockGUI::addMiniMonth (   $a_tpl)

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

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

References $_GET, $ctrl, $events, $i, $id, $ilCtrl, $ilUser, ilBlockGUI\$lng, $ui, ilBlockGUI\$user, ilDateTime\_before(), ilCalendarUtil\_buildMonthDayList(), ilDateTime\_equals(), ilCalendarUtil\_isToday(), ilCalendarUtil\_numericDayToString(), getShowWeeksColumn(), getTargetGUIClassPath(), IL_CAL_DATE, IL_CAL_FKT_DATE, IL_CAL_MONTH, ilDateTime\MONTH, ilCalendarSchedule\TYPE_MONTH, and ILIAS\UI\Implementation\Component\withOnLoadCode().

Referenced by fillDataSection().

355  {
356  $lng = $this->lng;
359  $ui = $this->ui;
360 
361 
362  // weekdays
363  include_once('Services/Calendar/classes/class.ilCalendarUtil.php');
364  if ($this->getShowWeeksColumn()) {
365  $a_tpl->setCurrentBlock('month_header_col');
366  $a_tpl->setVariable('TXT_WEEKDAY', $lng->txt("cal_week_abbrev"));
367  $a_tpl->parseCurrentBlock();
368  }
369  for ($i = (int) $this->user_settings->getWeekStart();$i < (7 + (int) $this->user_settings->getWeekStart());$i++) {
370  $a_tpl->setCurrentBlock('month_header_col');
371  $a_tpl->setVariable('TXT_WEEKDAY', ilCalendarUtil::_numericDayToString($i, false));
372  $a_tpl->parseCurrentBlock();
373  }
374 
375  if (isset($_GET["bkid"])) {
376  $user_id = $_GET["bkid"];
377  $disable_empty = true;
378  } else {
379  $user_id = $ilUser->getId();
380  $disable_empty = false;
381  }
382  include_once('Services/Calendar/classes/class.ilCalendarSchedule.php');
383  $this->scheduler = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_MONTH, $user_id);
384  $this->scheduler->addSubitemCalendars(true);
385  $this->scheduler->calculate();
386 
387  $counter = 0;
389  $this->seed->get(IL_CAL_FKT_DATE, 'm'),
390  $this->seed->get(IL_CAL_FKT_DATE, 'Y'),
391  $this->user_settings->getWeekStart()
392  )->get() as $date) {
393  $counter++;
394 
395  $events = $this->scheduler->getByDay($date, $ilUser->getTimeZone());
396  $has_events = (bool) count($events);
397  if ($has_events || !$disable_empty) {
398  $a_tpl->setCurrentBlock('month_col_link');
399  } else {
400  $a_tpl->setCurrentBlock('month_col_no_link');
401  }
402 
403  if ($disable_empty) {
404  if (!$has_events) {
405  $a_tpl->setVariable('DAY_CLASS', 'calminiinactive');
406  } else {
407  $week_has_events = true;
408  include_once 'Services/Booking/classes/class.ilBookingEntry.php';
409  foreach ($events as $event) {
410  $booking = new ilBookingEntry($event['event']->getContextId());
411  if ($booking->hasBooked($event['event']->getEntryId())) {
412  $a_tpl->setVariable('DAY_CLASS', 'calminiapp');
413  break;
414  }
415  }
416  }
417  } elseif ($has_events) {
418  $week_has_events = true;
419  $a_tpl->setVariable('DAY_CLASS', 'calminiapp');
420  }
421 
422 
423  $day = $date->get(IL_CAL_FKT_DATE, 'j');
424  $month = $date->get(IL_CAL_FKT_DATE, 'n');
425 
426  $month_day = $day;
427 
428  $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), 'seed', $date->get(IL_CAL_DATE));
429  if ($agenda_view_type = (int) $_GET['cal_agenda_per']) {
430  $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "cal_agenda_per", $agenda_view_type);
431  }
432  $a_tpl->setVariable('OPEN_DAY_VIEW', $ilCtrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ''));
433 
434  $a_tpl->setVariable('MONTH_DAY', $month_day);
435 
436  $a_tpl->parseCurrentBlock();
437 
438 
439  $a_tpl->setCurrentBlock('month_col');
440 
441  include_once('./Services/Calendar/classes/class.ilCalendarUtil.php');
442  if (ilCalendarUtil::_isToday($date)) {
443  $a_tpl->setVariable('TD_CLASS', 'calminitoday');
444  }
445  #elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
446  #{
447  # $a_tpl->setVariable('TD_CLASS','calmininow');
448  #}
449  elseif (ilDateTime::_equals($date, $this->seed, IL_CAL_MONTH)) {
450  $a_tpl->setVariable('TD_CLASS', 'calministd');
451  } elseif (ilDateTime::_before($date, $this->seed, IL_CAL_MONTH)) {
452  $a_tpl->setVariable('TD_CLASS', 'calminiprev');
453  } else {
454  $a_tpl->setVariable('TD_CLASS', 'calmininext');
455  }
456 
457  $a_tpl->parseCurrentBlock();
458 
459 
460  if ($counter and !($counter % 7)) {
461  if ($this->getShowWeeksColumn()) {
462  $a_tpl->setCurrentBlock('week');
463  $a_tpl->setVariable(
464  'WEEK',
465  $date->get(IL_CAL_FKT_DATE, 'W')
466  );
467  $a_tpl->parseCurrentBlock();
468  }
469 
470  $a_tpl->setCurrentBlock('month_row');
471  //$a_tpl->setVariable('TD_CLASS','calminiweek');
472  $a_tpl->parseCurrentBlock();
473 
474  $week_has_events = false;
475  }
476  }
477  $a_tpl->setCurrentBlock('mini_month');
478  //$a_tpl->setVariable('TXT_MONTH_OVERVIEW', $lng->txt("cal_month_overview"));
479 
480  $first_of_month = substr($this->seed->get(IL_CAL_DATE), 0, 7) . "-01";
481  $myseed = new ilDate($first_of_month, IL_CAL_DATE);
482 
483  $myseed->increment(ilDateTime::MONTH, -1);
484  $ilCtrl->setParameter($this, 'seed', $myseed->get(IL_CAL_DATE));
485 
486  $prev_link = $ilCtrl->getLinkTarget($this, "setSeed", "", true);
487 
488  $myseed->increment(ilDateTime::MONTH, 2);
489  $ilCtrl->setParameter($this, 'seed', $myseed->get(IL_CAL_DATE));
490  $next_link = $ilCtrl->getLinkTarget($this, "setSeed", "", true);
491 
492  $ilCtrl->setParameter($this, 'seed', "");
493 
494  $blockgui = $this;
495 
496  // view control
497  // ... previous button
498  $b1 = $ui->factory()->button()->standard($lng->txt("previous"), "#")->withOnLoadCode(function ($id) use ($prev_link, $blockgui) {
499  return
500  "$('#" . $id . "').click(function() { ilBlockJSHandler('block_" . $blockgui->getBlockType() .
501  "_" . $blockgui->getBlockId() . "','" . $prev_link . "'); return false;});";
502  });
503 
504  // ... month button
505  $ilCtrl->clearParameterByClass("ilcalendarblockgui", 'seed');
506  $month_link = $ilCtrl->getLinkTarget($this, "setSeed", "", true, false);
507  $seed_parts = explode("-", $this->seed->get(IL_CAL_DATE));
508  $b2 = $ui->factory()->button()->month($seed_parts[1] . "-" . $seed_parts[0])->withOnLoadCode(function ($id) use ($month_link, $blockgui) {
509  return "$('#" . $id . "').on('il.ui.button.month.changed', function(el, id, month) { var m = month.split('-'); ilBlockJSHandler('block_" . $blockgui->getBlockType() .
510  "_" . $blockgui->getBlockId() . "','" . $month_link . "' + '&seed=' + m[1] + '-' + m[0] + '-01'); return false;});";
511  });
512  // ... next button
513  $b3 = $ui->factory()->button()->standard($lng->txt("next"), "#")->withOnLoadCode(function ($id) use ($next_link, $blockgui) {
514  return
515  "$('#" . $id . "').click(function() { ilBlockJSHandler('block_" . $blockgui->getBlockType() .
516  "_" . $blockgui->getBlockId() . "','" . $next_link . "'); return false;});";
517  });
518 
519 
520  $vc = $ui->factory()->viewControl()->section($b1, $b2, $b3);
521  $a_tpl->setVariable("VIEW_CTRL_SECTION", $ui->renderer()->render($vc));
522 
523  $a_tpl->parseCurrentBlock();
524  }
static _buildMonthDayList($a_month, $a_year, $weekstart)
Build a month day list.
static _numericDayToString($a_day, $a_long=true)
get
getShowWeeksColumn()
Show weeks column.
$_GET["client_id"]
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
if(!array_key_exists('StateId', $_REQUEST)) $id
Booking definition.
if($argc< 2) $events
const IL_CAL_MONTH
global $ilCtrl
Definition: ilias.php:18
static _equals(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check if two date are equal.
Class for single dates.
const IL_CAL_FKT_DATE
$ilUser
Definition: imgupload.php:18
getTargetGUIClassPath()
Get target gui class path (for presenting the calendar)
const IL_CAL_DATE
$i
Definition: disco.tpl.php:19
static _isToday($date)
check if a date is today
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:

◆ addSubscriptionBlockCommand()

ilCalendarBlockGUI::addSubscriptionBlockCommand ( )
protected

Add subscription block command.

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

References $DIC, ilBlockGUI\$lng, $out, $url, ilBlockGUI\addBlockCommand(), and getTargetGUIClassPath().

Referenced by getHTML().

530  {
531  global $DIC;
532 
533  $lng = $DIC->language();
534 
535  $ui_factory = $DIC->ui()->factory();
536  $ui_renderer = $DIC->ui()->renderer();
537 
538  $gui_path = $this->getTargetGUIClassPath();
539  $gui_path[] = "ilcalendarsubscriptiongui";
540  $url = $this->ctrl->getLinkTargetByClass($gui_path, 'getModalForSubscription', "", true, false);
541 
542  $roundtrip = $ui_factory->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
543 
544  $standard_button = $ui_factory->button()->standard($lng->txt('btn_ical'), '')->withOnClick(
545  $roundtrip->getShowSignal()
546  );
547  $components = [
548  $roundtrip,
549  $standard_button
550  ];
551 
552  $out = $ui_renderer->render($components);
553  $this->addBlockCommand(
554  '',
555  '',
556  "",
557  "",
558  true,
559  false,
560  '<span class="ilIcalIcon">' . $out . '</span>'
561  );
562  }
global $DIC
Definition: saml.php:7
addBlockCommand( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
getTargetGUIClassPath()
Get target gui class path (for presenting the calendar)
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilCalendarBlockGUI::executeCommand ( )

execute command

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

References $ctrl, $ilCtrl, $tabs, ilCalendarAppointmentPresentationGUI\_getInstance(), initCategories(), and setSubTabs().

235  {
237  $ilTabs = $this->tabs;
238 
239 
240  $next_class = $ilCtrl->getNextClass();
241  $cmd = $ilCtrl->getCmd("getHTML");
242 
243  $this->setSubTabs();
244 
245  switch ($next_class) {
246  case "ilcalendarappointmentgui":
247  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
248  $app_gui = new ilCalendarAppointmentGUI($this->seed, $this->seed);
249  $ilCtrl->forwardCommand($app_gui);
250  break;
251 
252  case "ilconsultationhoursgui":
253  include_once('./Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursGUI.php');
254  $hours = new ilConsultationHoursGUI($this->seed);
255  $ilCtrl->forwardCommand($hours);
256  break;
257 
258  case "ilcalendarappointmentpresentationgui":
259  $this->initCategories();
260  $presentation = ilCalendarAppointmentPresentationGUI::_getInstance($this->seed, $this->appointment);
261  $ilCtrl->forwardCommand($presentation);
262  break;
263 
264  case "ilcalendarmonthgui":
265  $ilTabs->setSubTabActive('app_month');
266  include_once('./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
267  $month_gui = new ilCalendarMonthGUI($this->seed);
268  $ilCtrl->forwardCommand($month_gui);
269  break;
270 
271  default:
272  return $this->$cmd();
273  }
274  }
Consultation hours editor.
static _getInstance(ilDate $seed, $a_app)
get singleton instance
global $ilCtrl
Definition: ilias.php:18
initCategories()
init categories
Administrate calendar appointments.
+ Here is the call graph for this function:

◆ fillDataSection()

ilCalendarBlockGUI::fillDataSection ( )

Fill data section.

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

References ilBlockGUI\$tpl, addMiniMonth(), ilBlockGUI\fillDataSection(), ilBlockGUI\getCurrentDetailLevel(), getOverview(), ilBlockGUI\setColSpan(), ilBlockGUI\setDataSection(), and ilBlockGUI\setRowTemplate().

300  {
301  // alex: changed from > 1 to > 0 - original detail level 1 did not work anymore
302  if ($this->getCurrentDetailLevel() > 0 && $this->display_mode != "mmon") {
303  $this->setColSpan(1);
304  $this->setRowTemplate("tpl.pd_event_list.html", "Services/Calendar");
305 
307  } else {
308  // alex: changed from > 1 to > 0 - original detail level 1 did not work anymore
309  if ($this->getCurrentDetailLevel() > 0) {
310  $tpl = new ilTemplate(
311  "tpl.calendar_block.html",
312  true,
313  true,
314  "Services/Calendar"
315  );
316 
317  $this->addMiniMonth($tpl);
318  $this->setDataSection($tpl->get());
319  } else {
320  $this->setDataSection($this->getOverview());
321  }
322  }
323  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setColSpan($a_colspan)
Set Columns Span.
special template class to simplify handling of ITX/PEAR
addMiniMonth($a_tpl)
Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab...
fillDataSection()
Standard implementation for row based data.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ fillFooter()

ilCalendarBlockGUI::fillFooter ( )

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

References ilBlockGUI\fillFooterLinks(), ilBlockGUI\getColSpan(), and setFooterLinks().

854  {
855  // begin-patch ch
856  foreach ((array) $this->cal_footer as $link_info) {
857  $this->tpl->setCurrentBlock('data_section');
858  $this->tpl->setVariable(
859  'DATA',
860  sprintf('<a href="%s">%s</a>', $link_info['link'], $link_info['txt'])
861  );
862  $this->tpl->parseCurrentBlock();
863  }
864  // end-patch ch
865 
866  $this->setFooterLinks();
867  $this->fillFooterLinks();
868  $this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
869  if ($this->tpl->blockExists("block_footer")) {
870  $this->tpl->setCurrentBlock("block_footer");
871  $this->tpl->parseCurrentBlock();
872  }
873  }
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
getColSpan()
Get Columns Span.
+ Here is the call graph for this function:

◆ getBlockType()

ilCalendarBlockGUI::getBlockType ( )

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

Referenced by __construct(), setFooterLinks(), and setSeed().

147  : string
148  {
149  return self::$block_type;
150  }
+ Here is the caller graph for this function:

◆ getData()

ilCalendarBlockGUI::getData ( )

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

References $_GET, ilBlockGUI\$data, $events, $f, ilBlockGUI\$lng, $ui, $url, ilDatePresentation\formatPeriod(), getDatesForItem(), getEvents(), and ilBlockGUI\setEnableNumInfo().

984  {
985  $lng = $this->lng;
986  $ui = $this->ui;
987 
988  $f = $ui->factory();
989 
990  $events = $this->getEvents();
991 
992  $data = array();
993  if (sizeof($events)) {
994  foreach ($events as $item) {
995  $this->ctrl->setParameter($this, "app_id", $item["event"]->getEntryId());
996  $this->ctrl->setParameter($this, 'dt', $item['dstart']);
997  $url = $this->ctrl->getLinkTarget($this, "getModalForApp", "", true, false);
998  $this->ctrl->setParameter($this, "app_id", $_GET["app_id"]);
999  $this->ctrl->setParameter($this, "dt", $_GET["dt"]);
1000  $modal = $f->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
1001 
1002  $dates = $this->getDatesForItem($item);
1003 
1004  $comps = [$f->button()->shy($item["event"]->getPresentationTitle(), "")->withOnClick($modal->getShowSignal()), $modal];
1005  $renderer = $ui->renderer();
1006  $shy = $renderer->render($comps);
1007 
1008  $data[] = array(
1009  "date" => ilDatePresentation::formatPeriod($dates["start"], $dates["end"]),
1010  "title" => $item["event"]->getPresentationTitle(),
1011  "url" => "#",
1012  "shy_button" => $shy
1013  );
1014  }
1015  $this->setEnableNumInfo(true);
1016  } else {
1017  $data[] = array(
1018  "date" => $lng->txt("msg_no_search_result"),
1019  "title" => "",
1020  "url" => ""
1021  );
1022 
1023  $this->setEnableNumInfo(false);
1024  }
1025 
1026  return $data;
1027  }
getDatesForItem($item)
Get start/end date for item.
$_GET["client_id"]
if($argc< 2) $events
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
$url
+ Here is the call graph for this function:

◆ getDatesForItem()

ilCalendarBlockGUI::getDatesForItem (   $item)

Get start/end date for item.

Parameters
array$itemitem
Returns
array

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

References $end, $start, and IL_CAL_UNIX.

Referenced by getData(), and getModalForApp().

1036  {
1037  $start = $item["dstart"];
1038  $end = $item["dend"];
1039  if ($item["fullday"]) {
1040  $start = new ilDate($start, IL_CAL_UNIX);
1041  $end = new ilDate($end, IL_CAL_UNIX);
1042  } else {
1044  $end = new ilDateTime($end, IL_CAL_UNIX);
1045  }
1046  return array("start" => $start, "end" => $end);
1047  }
const IL_CAL_UNIX
$start
Definition: bench.php:8
Class for single dates.
Date and time handling
+ Here is the caller graph for this function:

◆ getEnableEdit()

ilCalendarBlockGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean Edit mode on/off

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

292  {
293  return $this->enable_edit;
294  }

◆ getEvents()

ilCalendarBlockGUI::getEvents ( )

Get events.

Parameters

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

References IL_CAL_DATE, and ilCalendarSchedule\TYPE_PD_UPCOMING.

Referenced by getData(), and getModalForApp().

971  {
972  $seed = new ilDate(date('Y-m-d', time()), IL_CAL_DATE);
973 
974  include_once('./Services/Calendar/classes/class.ilCalendarSchedule.php');
976  $schedule->addSubitemCalendars(true); // #12007
977  $schedule->setEventsLimit(20);
978  $schedule->calculate();
979  $ev = $schedule->getScheduledEvents(); // #13809
980  return ($ev);
981  }
Class for single dates.
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 ( )

Get force month view.

Returns
bool force month view

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

References $force_month_view.

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

199  {
201  }
+ Here is the caller graph for this function:

◆ getHTML()

ilCalendarBlockGUI::getHTML ( )

Get bloch HTML code.

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

References $_GET, ilBlockGUI\$access, $ctrl, $DIC, $f, $ilCtrl, ilBlockGUI\$lng, $obj_data_cache, $ret, ilBlockGUI\$user, $users, ilDateTime\_before(), ilCourseParticipants\_getInstanceByObjId(), ilObjUser\_lookupFullname(), ilBlockGUI\addBlockCommand(), addSubscriptionBlockCommand(), ilConsultationHourAppointments\getAppointments(), ilBlockGUI\getCurrentDetailLevel(), getForceMonthView(), getParentGUI(), ilBlockGUI\getProperty(), getTargetGUIClassPath(), IL_CAL_DAY, IL_CAL_UNIX, initCategories(), ilBookingEntry\lookupBookableUsersForObject(), and ilCalendarCategories\MODE_REPOSITORY.

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

569  {
570  $this->initCategories();
571  $lng = $this->lng;
573  $ilAccess = $this->access;
574  $ilObjDataCache = $this->obj_data_cache;
575  $user = $this->user;
576 
577  if ($this->getCurrentDetailLevel() == 0) {
578  return "";
579  }
580 
582 
583  if ($this->mode == ilCalendarCategories::MODE_REPOSITORY) {
584  if (!isset($_GET["bkid"])) {
585  /*
586  if($ilAccess->checkAccess('edit_event','',(int) $_GET['ref_id']))
587  {
588  $ilCtrl->setParameter($this, "add_mode", "block");
589  $this->addBlockCommand(
590  $ilCtrl->getLinkTargetByClass("ilCalendarAppointmentGUI",
591  "add"),
592  $lng->txt("add_appointment"));
593  $ilCtrl->setParameter($this, "add_mode", "");
594  }*/
595 
596  include_once "Modules/Course/classes/class.ilCourseParticipants.php";
597  $obj_id = $ilObjDataCache->lookupObjId((int) $_GET['ref_id']);
598  $participants = ilCourseParticipants::_getInstanceByObjId($obj_id);
599  $users = array_unique(array_merge($participants->getTutors(), $participants->getAdmins()));
600  //$users = $participants->getParticipants();
601  include_once 'Services/Booking/classes/class.ilBookingEntry.php';
603  foreach ($users as $user_id) {
604  if (!isset($_GET["bkid"])) {
605  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
606  $now = new ilDateTime(time(), IL_CAL_UNIX);
607 
608  // default to last booking entry
609  $appointments = ilConsultationHourAppointments::getAppointments($user_id);
610  $next_app = end($appointments);
611  reset($appointments);
612 
613  foreach ($appointments as $entry) {
614  // find next entry
615  if (ilDateTime::_before($entry->getStart(), $now, IL_CAL_DAY)) {
616  continue;
617  }
618  include_once 'Services/Booking/classes/class.ilBookingEntry.php';
619  $booking_entry = new ilBookingEntry($entry->getContextId());
620  if (!in_array($obj_id, $booking_entry->getTargetObjIds())) {
621  continue;
622  }
623 
624  if (!$booking_entry->isAppointmentBookableForUser($entry->getEntryId(), $user->getId())) {
625  continue;
626  }
627  $next_app = $entry;
628  break;
629  }
630 
631  /*
632  $ilCtrl->setParameter($this, "bkid", $user_id);
633  if($next_app)
634  {
635  $ilCtrl->setParameter(
636  $this,
637  'seed',
638  (string) $next_app->getStart()->get(IL_CAL_DATE)
639  );
640  }*/
641 
642  //$ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "bkid", $user_id);
643 
644  $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "ch_user_id", $user_id);
645 
646  if ($next_app) {
647  // this does not work correctly
648  /*$ilCtrl->setParameterByClass(
649  end($this->getTargetGUIClassPath()),
650  'seed',
651  (string) $next_app->getStart()->get(IL_CAL_DATE)
652  );*/
653  }
654 
655  if (!$this->getForceMonthView()) {
656  $this->cal_footer[] = array(
657  'link' => $ilCtrl->getLinkTargetByClass($this->getTargetGUIClassPath(), 'selectCHCalendarOfUser'),
658  'txt' => str_replace("%1", ilObjUser::_lookupFullname($user_id), $lng->txt("cal_consultation_hours_for_user"))
659  );
660  }
661  $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "ch_user_id", "");
662  $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "bkid", $_GET["bkid"]);
663  $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "seed", $_GET["seed"]);
664  }
665  }
666  $ilCtrl->setParameter($this, "bkid", "");
667  $ilCtrl->setParameter($this, 'seed', '');
668  } else {
669  $ilCtrl->setParameter($this, "bkid", "");
670  $this->addBlockCommand(
671  $ilCtrl->getLinkTarget($this),
672  $lng->txt("back")
673  );
674  $ilCtrl->setParameter($this, "bkid", (int) $_GET["bkid"]);
675  }
676  }
677 
678  if ($this->getProperty("settings") == true) {
679  $this->addBlockCommand(
680  $ilCtrl->getLinkTarget($this, "editSettings"),
681  $lng->txt("settings")
682  );
683  }
684 
685  $ilCtrl->setParameterByClass($this->getParentGUI(), "seed", isset($_GET["seed"]) ? $_GET["seed"] : "");
686  $ret = parent::getHTML();
687  $ilCtrl->setParameterByClass($this->getParentGUI(), "seed", "");
688 
689  // workaround to include asynch code from ui only one time, see #20853
690  if ($ilCtrl->isAsynch()) {
691  global $DIC;
692  $f = $DIC->ui()->factory()->legacy("");
693  $ret .= $DIC->ui()->renderer()->renderAsync($f);
694  }
695 
696  return $ret;
697  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _lookupFullname($a_user_id)
Lookup Full Name.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Booking definition.
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
initCategories()
init categories
const IL_CAL_DAY
static lookupBookableUsersForObject($a_obj_id, $a_user_ids)
Consultation hours are offered if 1) consultation hour owner is admin or tutor and no object assignme...
getForceMonthView()
Get force month view.
static getAppointments($a_user_id)
Get all appointments.
getParentGUI()
Get parent gui.
Date and time handling
$users
Definition: authpage.php:44
addSubscriptionBlockCommand()
Add subscription block command.
addBlockCommand( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
getTargetGUIClassPath()
Get target gui class path (for presenting the calendar)
$ret
Definition: parser.php:6
getProperty($a_property)
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:
+ Here is the caller 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 1054 of file class.ilCalendarBlockGUI.php.

References $_GET, $ctrl, $events, $f, $ilCtrl, $r, $ui, ilCalendarAppointmentPresentationGUI\_getInstance(), exit, ilDatePresentation\formatPeriod(), getDatesForItem(), getEvents(), and initCategories().

1055  {
1056  $this->initCategories();
1057  $ui = $this->ui;
1058  $ilCtrl = $this->ctrl;
1059 
1060  $f = $ui->factory();
1061  $r = $ui->renderer();
1062 
1063  // @todo: this needs optimization
1064  $events = $this->getEvents();
1065  foreach ($events as $item) {
1066  if ($item["event"]->getEntryId() == (int) $_GET["app_id"] && $item['dstart'] == (int) $_GET['dt']) {
1067  $dates = $this->getDatesForItem($item);
1068 
1069  // content of modal
1070  include_once("./Services/Calendar/classes/class.ilCalendarAppointmentPresentationGUI.php");
1071  $next_gui = ilCalendarAppointmentPresentationGUI::_getInstance($this->seed, $item);
1072  $content = $ilCtrl->getHTML($next_gui);
1073 
1074  $modal = $f->modal()->roundtrip(ilDatePresentation::formatPeriod($dates["start"], $dates["end"]), $f->legacy($content));
1075  echo $r->renderAsync($modal);
1076  }
1077  }
1078  exit();
1079  }
getDatesForItem($item)
Get start/end date for item.
$_GET["client_id"]
static _getInstance(ilDate $seed, $a_app)
get singleton instance
if($argc< 2) $events
global $ilCtrl
Definition: ilias.php:18
initCategories()
init categories
$r
Definition: example_031.php:79
exit
Definition: backend.php:16
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
+ Here is the call graph for this function:

◆ getOverview()

ilCalendarBlockGUI::getOverview ( )

Get overview.

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

References $ctrl, $events, $ilCtrl, ilBlockGUI\$lng, $text, and ilCalendarSchedule\TYPE_INBOX.

Referenced by fillDataSection().

703  {
704  $lng = $this->lng;
706 
707 
708  include_once('./Services/Calendar/classes/class.ilCalendarSchedule.php');
709  $schedule = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_INBOX);
710  $events = $schedule->getChangedEvents(true);
711 
712  $ilCtrl->setParameterByClass('ilcalendarinboxgui', 'changed', 1);
713  $link = '<a href=' . $ilCtrl->getLinkTargetByClass('ilcalendarinboxgui', '') . '>';
714  $ilCtrl->setParameterByClass('ilcalendarinboxgui', 'changed', '');
715  $text = '<div class="small">' . ((int) count($events)) . " " . $lng->txt("cal_changed_events_header") . "</div>";
716  $end_link = '</a>';
717 
718  return $link . $text . $end_link;
719  }
if($argc< 2) $events
global $ilCtrl
Definition: ilias.php:18
$text
Definition: errorreport.php:18
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
+ Here is the caller graph for this function:

◆ getParentGUI()

ilCalendarBlockGUI::getParentGUI ( )

Get parent gui.

Returns

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

References $parent_gui.

Referenced by getHTML().

176  {
177  return $this->parent_gui;
178  }
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilCalendarBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

References $_GET, $DIC, $ilCtrl, and IL_SCREEN_CENTER.

207  {
208  global $DIC;
209 
210  $ilCtrl = $DIC->ctrl();
211 
212  $cmd_class = $ilCtrl->getCmdClass();
213 
214  if ($cmd_class == "ilcalendarappointmentgui" ||
215  $cmd_class == "ilconsultationhoursgui" ||
216  $_GET['cmd'] == 'showCalendarSubscription') {
217  return IL_SCREEN_CENTER;
218  }
219 
220  switch ($ilCtrl->getCmd()) {
221  case "kkk":
222  // return IL_SCREEN_CENTER;
223  // return IL_SCREEN_FULL;
224 
225  default:
226  //return IL_SCREEN_SIDE;
227  break;
228  }
229  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_CENTER

◆ getShowWeeksColumn()

ilCalendarBlockGUI::getShowWeeksColumn ( )

Show weeks column.

Parameters

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

References settings().

Referenced by addMiniMonth().

139  {
140  return ($this->settings->getShowWeeks() && $this->user_settings->getShowWeeks());
141  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTargetGUIClassPath()

ilCalendarBlockGUI::getTargetGUIClassPath ( )

Get target gui class path (for presenting the calendar)

Parameters

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

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

Referenced by addMiniMonth(), addSubscriptionBlockCommand(), getHTML(), and setFooterLinks().

332  {
333  $target_class = array();
334  if (!$this->getRepositoryMode()) {
335  $target_class = array("ilpersonaldesktopgui", "ilcalendarpresentationgui");
336  } else {
337  switch (ilObject::_lookupType((int) $_GET["ref_id"], true)) {
338  case "crs":
339  $target_class = array("ilobjcoursegui", "ilcalendarpresentationgui");
340  break;
341 
342  case "grp":
343  $target_class = array("ilobjgroupgui", "ilcalendarpresentationgui");
344  break;
345  }
346  }
347  return $target_class;
348  }
$_GET["client_id"]
getRepositoryMode()
Get RepositoryMode.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCategories()

ilCalendarBlockGUI::initCategories ( )
protected

init categories

protected

Parameters

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

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

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

741  {
743 
745  if ($this->getForceMonthView()) {
746  // @todo: why not
747  }
748  elseif (!$cats->getMode()) {
749  $cats->initialize(
751  (int) $_GET['ref_id'],
752  true
753  );
754  }
755  }
$_GET["client_id"]
getForceMonthView()
Get force month view.
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:

◆ isRepositoryObject()

ilCalendarBlockGUI::isRepositoryObject ( )
protected

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

155  : bool
156  {
157  return false;
158  }

◆ returnToUpperContext()

ilCalendarBlockGUI::returnToUpperContext ( )

Return to upper context.

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

References $ctrl, and $ilCtrl.

Referenced by setSeed().

791  {
793 
794  $ilCtrl->returnToParent($this);
795  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ setEnableEdit()

ilCalendarBlockGUI::setEnableEdit (   $a_enable_edit = 0)

Set EnableEdit.

Parameters
boolean$a_enable_editEdit mode on/off

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

282  {
283  $this->enable_edit = $a_enable_edit;
284  }

◆ setFooterLinks()

ilCalendarBlockGUI::setFooterLinks ( )

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

References ilBlockGUI\$block_id, $ctrl, $ilCtrl, ilBlockGUI\$lng, ilBlockGUI\addFooterLink(), getBlockType(), ilBlockGUI\getCurrentDetailLevel(), getForceMonthView(), ilBlockGUI\getRepositoryMode(), and getTargetGUIClassPath().

Referenced by fillFooter().

876  {
878  $lng = $this->lng;
879 
880 
881  // alex: changed from < 2 to < 1 - original detail level 1 did not work anymore
882  if ($this->getCurrentDetailLevel() < 1) {
883  return;
884  }
885 
886  if (!$this->getForceMonthView()) {
887  $this->addFooterLink(
888  $lng->txt("cal_upcoming_events_header"),
889  $ilCtrl->getLinkTarget($this, "setPdModeEvents"),
890  $ilCtrl->getLinkTarget($this, "setPdModeEvents", "", true),
891  "block_" . $this->getBlockType() . "_" . $this->block_id,
892  false,
893  false,
894  ($this->display_mode != 'mmon')
895  );
896 
897  $this->addFooterLink(
898  $lng->txt("app_month"),
899  $ilCtrl->getLinkTarget($this, "setPdModeMonth"),
900  $ilCtrl->getLinkTarget($this, "setPdModeMonth", "", true),
901  "block_" . $this->getBlockType() . "_" . $this->block_id,
902  false,
903  false,
904  ($this->display_mode == 'mmon')
905  );
906 
907  if ($this->getRepositoryMode()) {
908  #23921
909  $ilCtrl->setParameterByClass('ilcalendarpresentationgui', 'seed', '');
910  $this->addFooterLink(
911  $lng->txt("cal_open_calendar"),
912  $ilCtrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ""),
913  "",
914  "block_" . $this->getBlockType() . "_" . $this->block_id,
915  false,
916  false
917  );
918 
919  $ilCtrl->setParameter($this, "add_mode", "");
920  $this->addFooterLink(
921  $lng->txt("add_appointment"),
922  $ilCtrl->getLinkTargetByClass("ilCalendarAppointmentGUI", "add"),
923  "",
924  "block_" . $this->getBlockType() . "_" . $this->block_id,
925  false,
926  false
927  );
928  $ilCtrl->setParameter($this, "add_mode", "");
929  }
930  }
931  }
getRepositoryMode()
Get RepositoryMode.
global $ilCtrl
Definition: ilias.php:18
addFooterLink( $a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
Add a footer text/link.
getForceMonthView()
Get force month view.
getTargetGUIClassPath()
Get target gui class path (for presenting the calendar)
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setForceMonthView()

ilCalendarBlockGUI::setForceMonthView (   $a_val)

Set force month view.

Parameters
bool$a_valforce month view

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

186  {
187  $this->force_month_view = $a_val;
188  if ($a_val) {
189  $this->display_mode = "mmon";
190  }
191  }

◆ setParentGUI()

ilCalendarBlockGUI::setParentGUI (   $a_val)

Set parent gui.

Parameters
$a_val

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

166  {
167  $this->parent_gui = $a_val;
168  }

◆ setPdModeEvents()

ilCalendarBlockGUI::setPdModeEvents ( )

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

References $ctrl, $ilCtrl, $ilUser, ilBlockGUI\$user, exit, and getHTML().

934  {
937 
938 
939  $ilUser->writePref("il_pd_cal_mode", "evt");
940  $this->display_mode = "evt";
941  if ($ilCtrl->isAsynch()) {
942  echo $this->getHTML();
943  exit;
944  } else {
945  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
946  }
947  }
getHTML()
Get bloch HTML code.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ setPdModeMonth()

ilCalendarBlockGUI::setPdModeMonth ( )

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

References $ctrl, $ilCtrl, $ilUser, ilBlockGUI\$user, exit, and getHTML().

950  {
953 
954  $ilUser->writePref("il_pd_cal_mode", "mmon");
955  $this->display_mode = "mmon";
956  if ($ilCtrl->isAsynch()) {
957  echo $this->getHTML();
958  exit;
959  } else {
960  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
961  }
962  }
getHTML()
Get bloch HTML code.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ setSeed()

ilCalendarBlockGUI::setSeed ( )

Set seed.

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

References $_GET, $_SESSION, $ctrl, $ilCtrl, exit, ilBlockGUI\getBlockId(), getBlockType(), getHTML(), and returnToUpperContext().

773  {
775 
776  //$ilUser->writePref("il_pd_bkm_mode", 'flat');
777  $_SESSION["il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed"] =
778  $_GET["seed"];
779  if ($ilCtrl->isAsynch()) {
780  echo $this->getHTML();
781  exit;
782  } else {
783  $this->returnToUpperContext();
784  }
785  }
$_SESSION["AccountId"]
$_GET["client_id"]
getHTML()
Get bloch HTML code.
global $ilCtrl
Definition: ilias.php:18
returnToUpperContext()
Return to upper context.
getBlockId()
Get Block Id.
exit
Definition: backend.php:16
+ Here is the call graph for this function:

◆ setSubTabs()

ilCalendarBlockGUI::setSubTabs ( )
protected
Parameters

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

References $tabs.

Referenced by executeCommand().

763  {
764  $ilTabs = $this->tabs;
765 
766  $ilTabs->clearSubTabs();
767  }
+ Here is the caller graph for this function:

◆ showCalendarSubscription()

ilCalendarBlockGUI::showCalendarSubscription ( )
Deprecated:
ilCalendarSubscriptionGUI should be used
Returns
string

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

References $_GET, $calendar, $ilUser, ilBlockGUI\$lng, PHPMailer\PHPMailer\$token, ilBlockGUI\$tpl, $url, ilBlockGUI\$user, ilObject\_lookupObjId(), ilCalendarAuthenticationToken\lookupAuthToken(), ilCalendarCategories\MODE_PERSONAL_DESKTOP_ITEMS, ilCalendarCategories\MODE_PERSONAL_DESKTOP_MEMBERSHIP, ilCalendarAuthenticationToken\SELECTION_CATEGORY, and ilCalendarAuthenticationToken\SELECTION_PD.

803  {
804  return;
805  $lng = $this->lng;
807 
808  $tpl = new ilTemplate('tpl.show_calendar_subscription.html', true, true, 'Services/Calendar');
809 
810  $tpl->setVariable('TXT_TITLE', $lng->txt('cal_subscription_header'));
811  $tpl->setVariable('TXT_INFO', $lng->txt('cal_subscription_info'));
812  $tpl->setVariable('TXT_CAL_URL', $lng->txt('cal_subscription_url'));
813 
814  include_once './Services/Calendar/classes/class.ilCalendarAuthenticationToken.php';
815 
816  switch ($this->mode) {
820  $calendar = 0;
821  break;
822 
823  default:
825  // TODO: calendar id
826  $calendar = ilObject::_lookupObjId((int) $_GET['ref_id']);
827  break;
828  }
829  if ($hash = ilCalendarAuthenticationToken::lookupAuthToken($ilUser->getId(), $selection, $calendar)) {
830  } else {
832  $token->setSelectionType($selection);
833  $token->setCalendar($calendar);
834  $hash = $token->add();
835  }
836  $url = ILIAS_HTTP_PATH . '/calendar.php?client_id=' . CLIENT_ID . '&token=' . $hash;
837 
838  $tpl->setVariable('VAL_CAL_URL', $url);
839  $tpl->setVariable('VAL_CAL_URL_TXT', $url);
840 
841  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
842  $content_block = new ilPDContentBlockGUI();
843  $content_block->setContent($tpl->get());
844  $content_block->setTitle($lng->txt("calendar"));
845  $content_block->addHeaderCommand(
846  $this->ctrl->getParentReturn($this),
847  $lng->txt("selected_items_back")
848  );
849 
850  return $content_block->getHTML();
851  }
$_GET["client_id"]
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
static lookupAuthToken($a_user_id, $a_selection, $a_calendar=0)
Handles calendar authentication tokens for external calendar subscriptions.
$url
BlockGUI class for (centered) Content on Personal Desktop.
+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilCalendarBlockGUI::$block_type = "cal"
static

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

◆ $ctrl

◆ $display_mode

ilCalendarBlockGUI::$display_mode
protected

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

◆ $force_month_view

ilCalendarBlockGUI::$force_month_view = false
protected

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

Referenced by getForceMonthView().

◆ $mode

ilCalendarBlockGUI::$mode
protected

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

Referenced by __construct().

◆ $obj_data_cache

ilCalendarBlockGUI::$obj_data_cache
protected

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

Referenced by getHTML().

◆ $parent_gui

ilCalendarBlockGUI::$parent_gui = "ilcolumngui"
protected

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

Referenced by getParentGUI().

◆ $st_data

ilCalendarBlockGUI::$st_data
static

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

◆ $tabs

ilCalendarBlockGUI::$tabs
protected

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

Referenced by executeCommand(), and setSubTabs().

◆ $ui

ilCalendarBlockGUI::$ui
protected

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

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


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