ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
 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
 __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 getBlockType ()
 Get block type. More...
 
static isRepositoryObject ()
 Is this a repository object. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
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

 initCategories ()
 init categories More...
 
 setSubTabs ()
 
- Protected Member Functions inherited from ilBlockGUI
 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(), ilBlockGUI\setTitle(), and time.

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  $this->seed = new ilDate(time(), IL_CAL_UNIX); // @todo: check this
120  } else {
121  $this->seed = new ilDate($seed_str, IL_CAL_DATE); // @todo: check this
122  }
123 
125  $this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
126 
127  $mode = $ilUser->getPref("il_pd_cal_mode");
128  $this->display_mode = $mode ? $mode : "mmon";
129  }
static _getInstance()
get singleton instance
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static _getInstanceByUserId($a_user_id)
get singleton instance
static getBlockType()
Get block type.
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
settings()
Definition: settings.php:2
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:

Member Function Documentation

◆ addCloseCommand()

ilCalendarBlockGUI::addCloseCommand (   $a_content_block)

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

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

711  {
712  $lng = $this->lng;
714 
715  $a_content_block->addHeaderCommand(
716  $ilCtrl->getParentReturn($this),
717  $lng->txt("close"),
718  true
719  );
720  }
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 357 of file class.ilCalendarBlockGUI.php.

References $_GET, $counter, $ctrl, $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().

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

◆ executeCommand()

ilCalendarBlockGUI::executeCommand ( )

execute command

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

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

238  {
240  $ilTabs = $this->tabs;
241 
242 
243  $next_class = $ilCtrl->getNextClass();
244  $cmd = $ilCtrl->getCmd("getHTML");
245 
246  $this->setSubTabs();
247 
248  switch ($next_class) {
249  case "ilcalendarappointmentgui":
250  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
251  $app_gui = new ilCalendarAppointmentGUI($this->seed, $this->seed);
252  $ilCtrl->forwardCommand($app_gui);
253  break;
254 
255  case "ilconsultationhoursgui":
256  include_once('./Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursGUI.php');
257  $hours = new ilConsultationHoursGUI($this->seed);
258  $ilCtrl->forwardCommand($hours);
259  break;
260 
261  case "ilcalendarappointmentpresentationgui":
262  $this->initCategories();
263  $presentation = ilCalendarAppointmentPresentationGUI::_getInstance($this->seed, $this->appointment);
264  $ilCtrl->forwardCommand($presentation);
265  break;
266 
267  case "ilcalendarmonthgui":
268  $ilTabs->setSubTabActive('app_month');
269  include_once('./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
270  $month_gui = new ilCalendarMonthGUI($this->seed);
271  $ilCtrl->forwardCommand($month_gui);
272  break;
273 
274  default:
275  return $this->$cmd();
276  }
277  }
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 302 of file class.ilCalendarBlockGUI.php.

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

303  {
304  // alex: changed from > 1 to > 0 - original detail level 1 did not work anymore
305  if ($this->getCurrentDetailLevel() > 0 && $this->display_mode != "mmon") {
306  $this->setColSpan(1);
307  $this->setRowTemplate("tpl.pd_event_list.html", "Services/Calendar");
308 
310  } else {
311  // alex: changed from > 1 to > 0 - original detail level 1 did not work anymore
312  if ($this->getCurrentDetailLevel() > 0) {
313  $tpl = new ilTemplate(
314  "tpl.calendar_block.html",
315  true,
316  true,
317  "Services/Calendar"
318  );
319 
320  $this->addMiniMonth($tpl);
321  $this->setDataSection($tpl->get());
322  } else {
323  $this->setDataSection($this->getOverview());
324  }
325  }
326  }
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 842 of file class.ilCalendarBlockGUI.php.

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

843  {
844  // begin-patch ch
845  foreach ((array) $this->cal_footer as $link_info) {
846  $this->tpl->setCurrentBlock('data_section');
847  $this->tpl->setVariable(
848  'DATA',
849  sprintf('<a href="%s">%s</a>', $link_info['link'], $link_info['txt'])
850  );
851  $this->tpl->parseCurrentBlock();
852  }
853  // end-patch ch
854 
855  $this->setFooterLinks();
856  $this->fillFooterLinks();
857  $this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
858  if ($this->tpl->blockExists("block_footer")) {
859  $this->tpl->setCurrentBlock("block_footer");
860  $this->tpl->parseCurrentBlock();
861  }
862  }
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
Create styles array
The data for the language used.
getColSpan()
Get Columns Span.
+ Here is the call graph for this function:

◆ getBlockType()

static ilCalendarBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

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

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

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

◆ getData()

ilCalendarBlockGUI::getData ( )

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

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

973  {
974  $lng = $this->lng;
975  $ui = $this->ui;
976 
977  $f = $ui->factory();
978 
979  $events = $this->getEvents();
980 
981  $data = array();
982  if (sizeof($events)) {
983  foreach ($events as $item) {
984  $this->ctrl->setParameter($this, "app_id", $item["event"]->getEntryId());
985  $this->ctrl->setParameter($this, 'dt', $item['dstart']);
986  $url = $this->ctrl->getLinkTarget($this, "getModalForApp", "", true, false);
987  $this->ctrl->setParameter($this, "app_id", $_GET["app_id"]);
988  $this->ctrl->setParameter($this, "dt", $_GET["dt"]);
989  $modal = $f->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
990 
991  $dates = $this->getDatesForItem($item);
992 
993  $comps = [$f->button()->shy($item["event"]->getPresentationTitle(), "")->withOnClick($modal->getShowSignal()), $modal];
994  $renderer = $ui->renderer();
995  $shy = $renderer->render($comps);
996 
997  $data[] = array(
998  "date" => ilDatePresentation::formatPeriod($dates["start"], $dates["end"]),
999  "title" => $item["event"]->getPresentationTitle(),
1000  "url" => "#",
1001  "shy_button" => $shy
1002  );
1003  }
1004  $this->setEnableNumInfo(true);
1005  } else {
1006  $data[] = array(
1007  "date" => $lng->txt("msg_no_search_result"),
1008  "title" => "",
1009  "url" => ""
1010  );
1011 
1012  $this->setEnableNumInfo(false);
1013  }
1014 
1015  return $data;
1016  }
getDatesForItem($item)
Get start/end date for item.
$_GET["client_id"]
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
Create styles array
The data for the language used.
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 1024 of file class.ilCalendarBlockGUI.php.

References $end, array, and IL_CAL_UNIX.

Referenced by getData(), and getModalForApp().

1025  {
1026  $start = $item["dstart"];
1027  $end = $item["dend"];
1028  if ($item["fullday"]) {
1029  $start = new ilDate($start, IL_CAL_UNIX);
1030  $end = new ilDate($end, IL_CAL_UNIX);
1031  } else {
1032  $start = new ilDateTime($start, IL_CAL_UNIX);
1033  $end = new ilDateTime($end, IL_CAL_UNIX);
1034  }
1035  return array("start" => $start, "end" => $end);
1036  }
$end
Definition: saml1-acs.php:18
const IL_CAL_UNIX
Class for single dates.
Date and time handling
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getEnableEdit()

ilCalendarBlockGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean Edit mode on/off

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

295  {
296  return $this->enable_edit;
297  }

◆ getEvents()

ilCalendarBlockGUI::getEvents ( )

Get events.

Parameters

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

References date, IL_CAL_DATE, time, and ilCalendarSchedule\TYPE_PD_UPCOMING.

Referenced by getData(), and getModalForApp().

960  {
961  $seed = new ilDate(date('Y-m-d', time()), IL_CAL_DATE);
962 
963  include_once('./Services/Calendar/classes/class.ilCalendarSchedule.php');
965  $schedule->addSubitemCalendars(true); // #12007
966  $schedule->setEventsLimit(20);
967  $schedule->calculate();
968  $ev = $schedule->getScheduledEvents(); // #13809
969  return ($ev);
970  }
Class for single dates.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
const IL_CAL_DATE
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
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 201 of file class.ilCalendarBlockGUI.php.

References $force_month_view.

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

202  {
204  }
+ Here is the caller graph for this function:

◆ getHTML()

ilCalendarBlockGUI::getHTML ( )

Get bloch HTML code.

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

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

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

532  {
533  $this->initCategories();
534  $lng = $this->lng;
536  $ilAccess = $this->access;
537  $ilObjDataCache = $this->obj_data_cache;
538  $user = $this->user;
539 
540  if ($this->getCurrentDetailLevel() == 0) {
541  return "";
542  }
543 
544  // add edit commands
545  #if ($this->getEnableEdit())
546 
547  //if($this->mode == ilCalendarCategories::MODE_PERSONAL_DESKTOP_ITEMS or
548  // $this->mode == ilCalendarCategories::MODE_PERSONAL_DESKTOP_MEMBERSHIP)
549  //{
550  /*include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
551  $this->addBlockCommand(
552  $this->ctrl->getLinkTarget($this,'showCalendarSubscription'),
553  $lng->txt('ical_export'),
554  "", "", true, false, ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_ICAL)
555  );*/
556 
557  include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
558  $gui_path = $this->getTargetGUIClassPath();
559  $gui_path[] = "ilcalendarsubscriptiongui";
560  $this->addBlockCommand(
561  $this->ctrl->getLinkTargetByClass($gui_path),
562  $lng->txt('ical_export'),
563  "",
564  "",
565  true,
566  false,
568  );
569  //}
570 
571 
572  if ($this->mode == ilCalendarCategories::MODE_REPOSITORY) {
573  if (!isset($_GET["bkid"])) {
574  /*
575  if($ilAccess->checkAccess('edit_event','',(int) $_GET['ref_id']))
576  {
577  $ilCtrl->setParameter($this, "add_mode", "block");
578  $this->addBlockCommand(
579  $ilCtrl->getLinkTargetByClass("ilCalendarAppointmentGUI",
580  "add"),
581  $lng->txt("add_appointment"));
582  $ilCtrl->setParameter($this, "add_mode", "");
583  }*/
584 
585  include_once "Modules/Course/classes/class.ilCourseParticipants.php";
586  $obj_id = $ilObjDataCache->lookupObjId((int) $_GET['ref_id']);
587  $participants = ilCourseParticipants::_getInstanceByObjId($obj_id);
588  $users = array_unique(array_merge($participants->getTutors(), $participants->getAdmins()));
589  //$users = $participants->getParticipants();
590  include_once 'Services/Booking/classes/class.ilBookingEntry.php';
592  foreach ($users as $user_id) {
593  if (!isset($_GET["bkid"])) {
594  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
595  $now = new ilDateTime(time(), IL_CAL_UNIX);
596 
597  // default to last booking entry
598  $appointments = ilConsultationHourAppointments::getAppointments($user_id);
599  $next_app = end($appointments);
600  reset($appointments);
601 
602  foreach ($appointments as $entry) {
603  // find next entry
604  if (ilDateTime::_before($entry->getStart(), $now, IL_CAL_DAY)) {
605  continue;
606  }
607  include_once 'Services/Booking/classes/class.ilBookingEntry.php';
608  $booking_entry = new ilBookingEntry($entry->getContextId());
609  if (!in_array($obj_id, $booking_entry->getTargetObjIds())) {
610  continue;
611  }
612 
613  if (!$booking_entry->isAppointmentBookableForUser($entry->getEntryId(), $user->getId())) {
614  continue;
615  }
616  $next_app = $entry;
617  break;
618  }
619 
620  /*
621  $ilCtrl->setParameter($this, "bkid", $user_id);
622  if($next_app)
623  {
624  $ilCtrl->setParameter(
625  $this,
626  'seed',
627  (string) $next_app->getStart()->get(IL_CAL_DATE)
628  );
629  }*/
630 
631  //$ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "bkid", $user_id);
632 
633  $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "ch_user_id", $user_id);
634 
635  if ($next_app) {
636  // this does not work correctly
637  /*$ilCtrl->setParameterByClass(
638  end($this->getTargetGUIClassPath()),
639  'seed',
640  (string) $next_app->getStart()->get(IL_CAL_DATE)
641  );*/
642  }
643 
644  if (!$this->getForceMonthView()) {
645  $this->cal_footer[] = array(
646  'link' => $ilCtrl->getLinkTargetByClass($this->getTargetGUIClassPath(), 'selectCHCalendarOfUser'),
647  'txt' => str_replace("%1", ilObjUser::_lookupFullname($user_id), $lng->txt("cal_consultation_hours_for_user"))
648  );
649  }
650  $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "ch_user_id", "");
651  $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "bkid", $_GET["bkid"]);
652  $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "seed", $_GET["seed"]);
653  }
654  }
655  $ilCtrl->setParameter($this, "bkid", "");
656  $ilCtrl->setParameter($this, 'seed', '');
657  } else {
658  $ilCtrl->setParameter($this, "bkid", "");
659  $this->addBlockCommand(
660  $ilCtrl->getLinkTarget($this),
661  $lng->txt("back")
662  );
663  $ilCtrl->setParameter($this, "bkid", (int) $_GET["bkid"]);
664  }
665  }
666 
667  if ($this->getProperty("settings") == true) {
668  $this->addBlockCommand(
669  $ilCtrl->getLinkTarget($this, "editSettings"),
670  $lng->txt("settings")
671  );
672  }
673 
674  $ilCtrl->setParameterByClass($this->getParentGUI(), "seed", isset($_GET["seed"]) ? $_GET["seed"] : "");
675  $ret = parent::getHTML();
676  $ilCtrl->setParameterByClass($this->getParentGUI(), "seed", "");
677 
678  // workaround to include asynch code from ui only one time, see #20853
679  if ($ilCtrl->isAsynch()) {
680  global $DIC;
681  $f = $DIC->ui()->factory()->legacy("");
682  $ret.= $DIC->ui()->renderer()->renderAsync($f);
683  }
684 
685  return $ret;
686  }
static get($a_type, $a_href="")
Get icon html.
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
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
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
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
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 1043 of file class.ilCalendarBlockGUI.php.

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

1044  {
1045  $this->initCategories();
1046  $ui = $this->ui;
1047  $ilCtrl = $this->ctrl;
1048 
1049  $f = $ui->factory();
1050  $r = $ui->renderer();
1051 
1052  // @todo: this needs optimization
1053  $events = $this->getEvents();
1054  foreach ($events as $item) {
1055  if ($item["event"]->getEntryId() == (int) $_GET["app_id"] && $item['dstart'] == (int) $_GET['dt']) {
1056  $dates = $this->getDatesForItem($item);
1057 
1058  // content of modal
1059  include_once("./Services/Calendar/classes/class.ilCalendarAppointmentPresentationGUI.php");
1060  $next_gui = ilCalendarAppointmentPresentationGUI::_getInstance($this->seed, $item);
1061  $content = $ilCtrl->getHTML($next_gui);
1062 
1063  $modal = $f->modal()->roundtrip(ilDatePresentation::formatPeriod($dates["start"], $dates["end"]), $f->legacy($content));
1064  echo $r->renderAsync($modal);
1065  }
1066  }
1067  exit();
1068  }
getDatesForItem($item)
Get start/end date for item.
$_GET["client_id"]
static _getInstance(ilDate $seed, $a_app)
get singleton instance
global $ilCtrl
Definition: ilias.php:18
initCategories()
init categories
$r
Definition: example_031.php:79
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 691 of file class.ilCalendarBlockGUI.php.

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

Referenced by fillDataSection().

692  {
693  $lng = $this->lng;
695 
696 
697  include_once('./Services/Calendar/classes/class.ilCalendarSchedule.php');
698  $schedule = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_INBOX);
699  $events = $schedule->getChangedEvents(true);
700 
701  $ilCtrl->setParameterByClass('ilcalendarinboxgui', 'changed', 1);
702  $link = '<a href=' . $ilCtrl->getLinkTargetByClass('ilcalendarinboxgui', '') . '>';
703  $ilCtrl->setParameterByClass('ilcalendarinboxgui', 'changed', '');
704  $text = '<div class="small">' . ((int) count($events)) . " " . $lng->txt("cal_changed_events_header") . "</div>";
705  $end_link = '</a>';
706 
707  return $link . $text . $end_link;
708  }
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 178 of file class.ilCalendarBlockGUI.php.

References $parent_gui.

Referenced by getHTML().

179  {
180  return $this->parent_gui;
181  }
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilCalendarBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

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

210  {
211  global $DIC;
212 
213  $ilCtrl = $DIC->ctrl();
214 
215  $cmd_class = $ilCtrl->getCmdClass();
216 
217  if ($cmd_class == "ilcalendarappointmentgui" ||
218  $cmd_class == "ilconsultationhoursgui" ||
219  $_GET['cmd'] == 'showCalendarSubscription') {
220  return IL_SCREEN_CENTER;
221  }
222 
223  switch ($ilCtrl->getCmd()) {
224  case "kkk":
225  // return IL_SCREEN_CENTER;
226  // return IL_SCREEN_FULL;
227 
228  default:
229  //return IL_SCREEN_SIDE;
230  break;
231  }
232  }
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 137 of file class.ilCalendarBlockGUI.php.

References settings().

Referenced by addMiniMonth().

138  {
139  return ($this->settings->getShowWeeks() && $this->user_settings->getShowWeeks());
140  }
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 334 of file class.ilCalendarBlockGUI.php.

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

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

335  {
336  $target_class = array();
337  if (!$this->getRepositoryMode()) {
338  $target_class = array("ilpersonaldesktopgui", "ilcalendarpresentationgui");
339  } else {
340  switch (ilObject::_lookupType((int) $_GET["ref_id"], true)) {
341  case "crs":
342  $target_class = array("ilobjcoursegui", "ilcalendarpresentationgui");
343  break;
344 
345  case "grp":
346  $target_class = array("ilobjgroupgui", "ilcalendarpresentationgui");
347  break;
348  }
349  }
350  return $target_class;
351  }
$_GET["client_id"]
getRepositoryMode()
Get RepositoryMode.
Create styles array
The data for the language used.
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 729 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().

730  {
732 
734  if ($this->getForceMonthView()) {
735  // @todo: why not
736  }
737  elseif (!$cats->getMode()) {
738  $cats->initialize(
740  (int) $_GET['ref_id'],
741  true
742  );
743  }
744  }
$_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()

static ilCalendarBlockGUI::isRepositoryObject ( )
static

Is this a repository object.

Returns
string Block type.

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

159  {
160  return false;
161  }

◆ returnToUpperContext()

ilCalendarBlockGUI::returnToUpperContext ( )

Return to upper context.

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

References $ctrl, and $ilCtrl.

Referenced by setSeed().

780  {
782 
783  $ilCtrl->returnToParent($this);
784  }
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 284 of file class.ilCalendarBlockGUI.php.

285  {
286  $this->enable_edit = $a_enable_edit;
287  }

◆ setFooterLinks()

ilCalendarBlockGUI::setFooterLinks ( )

Definition at line 864 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().

865  {
867  $lng = $this->lng;
868 
869 
870  // alex: changed from < 2 to < 1 - original detail level 1 did not work anymore
871  if ($this->getCurrentDetailLevel() < 1) {
872  return;
873  }
874 
875  if (!$this->getForceMonthView()) {
876  $this->addFooterLink(
877  $lng->txt("cal_upcoming_events_header"),
878  $ilCtrl->getLinkTarget($this, "setPdModeEvents"),
879  $ilCtrl->getLinkTarget($this, "setPdModeEvents", "", true),
880  "block_" . $this->getBlockType() . "_" . $this->block_id,
881  false,
882  false,
883  ($this->display_mode != 'mmon')
884  );
885 
886  $this->addFooterLink(
887  $lng->txt("app_month"),
888  $ilCtrl->getLinkTarget($this, "setPdModeMonth"),
889  $ilCtrl->getLinkTarget($this, "setPdModeMonth", "", true),
890  "block_" . $this->getBlockType() . "_" . $this->block_id,
891  false,
892  false,
893  ($this->display_mode == 'mmon')
894  );
895 
896  if ($this->getRepositoryMode()) {
897  #23921
898  $ilCtrl->setParameterByClass('ilcalendarpresentationgui', 'seed', '');
899  $this->addFooterLink(
900  $lng->txt("cal_open_calendar"),
901  $ilCtrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ""),
902  "",
903  "block_" . $this->getBlockType() . "_" . $this->block_id,
904  false,
905  false
906  );
907 
908  $ilCtrl->setParameter($this, "add_mode", "");
909  $this->addFooterLink(
910  $lng->txt("add_appointment"),
911  $ilCtrl->getLinkTargetByClass("ilCalendarAppointmentGUI", "add"),
912  "",
913  "block_" . $this->getBlockType() . "_" . $this->block_id,
914  false,
915  false
916  );
917  $ilCtrl->setParameter($this, "add_mode", "");
918  }
919  }
920  }
static getBlockType()
Get block type.
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 188 of file class.ilCalendarBlockGUI.php.

189  {
190  $this->force_month_view = $a_val;
191  if ($a_val) {
192  $this->display_mode = "mmon";
193  }
194  }

◆ setParentGUI()

ilCalendarBlockGUI::setParentGUI (   $a_val)

Set parent gui.

Parameters
$a_val

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

169  {
170  $this->parent_gui = $a_val;
171  }

◆ setPdModeEvents()

ilCalendarBlockGUI::setPdModeEvents ( )

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

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

923  {
926 
927 
928  $ilUser->writePref("il_pd_cal_mode", "evt");
929  $this->display_mode = "evt";
930  if ($ilCtrl->isAsynch()) {
931  echo $this->getHTML();
932  exit;
933  } else {
934  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
935  }
936  }
getHTML()
Get bloch HTML code.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ setPdModeMonth()

ilCalendarBlockGUI::setPdModeMonth ( )

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

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

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

◆ setSeed()

ilCalendarBlockGUI::setSeed ( )

Set seed.

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

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

762  {
764 
765  //$ilUser->writePref("il_pd_bkm_mode", 'flat');
766  $_SESSION["il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed"] =
767  $_GET["seed"];
768  if ($ilCtrl->isAsynch()) {
769  echo $this->getHTML();
770  exit;
771  } else {
772  $this->returnToUpperContext();
773  }
774  }
$_SESSION["AccountId"]
$_GET["client_id"]
static getBlockType()
Get block type.
getHTML()
Get bloch HTML code.
global $ilCtrl
Definition: ilias.php:18
returnToUpperContext()
Return to upper context.
getBlockId()
Get Block Id.
+ Here is the call graph for this function:

◆ setSubTabs()

ilCalendarBlockGUI::setSubTabs ( )
protected
Parameters

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

References $tabs.

Referenced by executeCommand().

752  {
753  $ilTabs = $this->tabs;
754 
755  $ilTabs->clearSubTabs();
756  }
+ Here is the caller graph for this function:

◆ showCalendarSubscription()

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

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

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

792  {
793  return;
794  $lng = $this->lng;
796 
797  $tpl = new ilTemplate('tpl.show_calendar_subscription.html', true, true, 'Services/Calendar');
798 
799  $tpl->setVariable('TXT_TITLE', $lng->txt('cal_subscription_header'));
800  $tpl->setVariable('TXT_INFO', $lng->txt('cal_subscription_info'));
801  $tpl->setVariable('TXT_CAL_URL', $lng->txt('cal_subscription_url'));
802 
803  include_once './Services/Calendar/classes/class.ilCalendarAuthenticationToken.php';
804 
805  switch ($this->mode) {
809  $calendar = 0;
810  break;
811 
812  default:
814  // TODO: calendar id
815  $calendar = ilObject::_lookupObjId((int) $_GET['ref_id']);
816  break;
817  }
818  if ($hash = ilCalendarAuthenticationToken::lookupAuthToken($ilUser->getId(), $selection, $calendar)) {
819  } else {
820  $token = new ilCalendarAuthenticationToken($ilUser->getId());
821  $token->setSelectionType($selection);
822  $token->setCalendar($calendar);
823  $hash = $token->add();
824  }
825  $url = ILIAS_HTTP_PATH . '/calendar.php?client_id=' . CLIENT_ID . '&token=' . $hash;
826 
827  $tpl->setVariable('VAL_CAL_URL', $url);
828  $tpl->setVariable('VAL_CAL_URL_TXT', $url);
829 
830  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
831  $content_block = new ilPDContentBlockGUI();
832  $content_block->setContent($tpl->get());
833  $content_block->setTitle($lng->txt("calendar"));
834  $content_block->addHeaderCommand(
835  $this->ctrl->getParentReturn($this),
836  $lng->txt("selected_items_back")
837  );
838 
839  return $content_block->getHTML();
840  }
$_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: