ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilAppointmentPresentationGUI Class Reference
+ Inheritance diagram for ilAppointmentPresentationGUI:
+ Collaboration diagram for ilAppointmentPresentationGUI:

Public Member Functions

 __construct (array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
 
 getObjIdForAppointment ()
 
 getToolbar ()
 
 getListItem ()
 Get list item. More...
 
 getInfoScreen ()
 
 getCatId (int $a_entry_id)
 
 getCatInfo ()
 
 executeCommand ()
 
 getHTML ()
 
 addContainerInfo (int $a_obj_id)
 Add course/group container info. More...
 
 addInfoSection (string $a_txt)
 Add info section. More...
 
 addInfoProperty (string $a_txt, string $a_val)
 Add info property. More...
 
 addListItemProperty (string $a_txt, string $a_val)
 Add list item property. More...
 
 addAction (string $a_txt, string $a_link)
 Add action. More...
 
 collectPropertiesAndActions ()
 Collect properties and actions. More...
 
 collectStandardPropertiesAndActions ()
 Collect standard properties and actions. More...
 
 addObjectLinks (int $obj_id, ?array $a_appointment=null)
 Add object link. More...
 
 getReadableRefIds (int $a_obj_id)
 
 addEventDescription (array $a_app)
 Add event description. More...
 
 addEventLocation (array $a_app)
 Add event location. More...
 
 addLastUpdate (array $a_app)
 Add last update. More...
 
 addCalendarInfo (array $cat_info)
 
 addCommonSection (array $a_app, int $a_obj_id=0, ?array $cat_info=null, bool $a_container_info=false)
 
 addMetaData (string $a_obj_type, int $a_obj_id, ?string $a_sub_obj_type=null, ?int $a_sub_obj_id=null)
 
 getUserName (int $a_user_id, bool $a_force_name=false)
 Get (linked if possible) user name. More...
 
 downloadFiles ()
 Download files from an appointment ( Modals ) More...
 

Static Public Member Functions

static getInstance (array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
 

Protected Member Functions

 readObjIdForAppointment ()
 read obj_id for appointment More...
 
 buildDirectLinkForAppointment (int $a_ref_id, ?array $a_appointment=null)
 Build direct link for appointment. More...
 

Protected Attributes

array $appointment
 
ilToolbarGUI $toolbar
 
ilInfoScreenGUI $infoscreen
 
ilLanguage $lng
 
ilTree $tree
 
UIServices $ui
 
ilCtrlInterface $ctrl
 
ilAccessHandler $access
 
ilRbacSystem $rbacsystem
 
ilObjUser $user
 
RefineryFactory $refinery
 
HttpServices $http
 
Item $list_item = null
 
array $info_items = []
 
array $list_properties = []
 
array $actions = []
 
array $readable_ref_ids
 
bool $has_files = false
 
int $obj_id = 0
 

Static Protected Attributes

static self $instance
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAppointmentPresentationGUI::__construct ( array  $a_appointment,
?ilInfoScreenGUI  $a_info_screen,
?ilToolbarGUI  $a_toolbar,
?Item  $a_list_item 
)

Definition at line 66 of file class.ilAppointmentPresentationGUI.php.

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), readObjIdForAppointment(), ILIAS\Repository\refinery(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

71  {
72  global $DIC;
73  $this->main_tpl = $DIC->ui()->mainTemplate();
74 
75  $this->http = $DIC->http();
76  $this->refinery = $DIC->refinery();
77  $this->appointment = $a_appointment;
78  $this->infoscreen = $a_info_screen;
79  $this->info_items = [];
80  $this->toolbar = $a_toolbar;
81  $this->lng = $DIC->language();
82  $this->lng->loadLanguageModule("dateplaner");
83  $this->tree = $DIC->repositoryTree();
84  $this->ui = $DIC->ui();
85  $this->list_item = $a_list_item;
86  $this->ctrl = $DIC->ctrl();
87  $this->access = $DIC->access();
88  $this->rbacsystem = $DIC->rbac()->system();
89  $this->user = $DIC->user();
90  $this->readObjIdForAppointment();
91  }
readObjIdForAppointment()
read obj_id for appointment
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ addAction()

◆ addCalendarInfo()

ilAppointmentPresentationGUI::addCalendarInfo ( array  $cat_info)

Definition at line 444 of file class.ilAppointmentPresentationGUI.php.

References addInfoProperty(), addListItemProperty(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

Referenced by addCommonSection(), ilAppointmentPresentationUserGUI\collectPropertiesAndActions(), ilAppointmentPresentationBookingPoolGUI\collectPropertiesAndActions(), and ilAppointmentPresentationPublicGUI\collectPropertiesAndActions().

444  : void
445  {
446  $this->ctrl->setParameterByClass("ilCalendarPresentationGUI", "category_id", $cat_info["cat_id"]);
447 
448  $link = $this->ui->renderer()->render(
449  $this->ui->factory()->button()->shy(
450  $cat_info["title"],
451  $this->ctrl->getLinkTargetByClass(array("ilDashboardGUI", "ilCalendarPresentationGUI"), "")
452  )
453  );
454 
455  $this->ctrl->setParameterByClass("ilCalendarPresentationGUI", "category_id", '');
456  $this->addInfoProperty($this->lng->txt("calendar"), $link);
457  $this->addListItemProperty($this->lng->txt("calendar"), $link);
458  }
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
addInfoProperty(string $a_txt, string $a_val)
Add info property.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addCommonSection()

ilAppointmentPresentationGUI::addCommonSection ( array  $a_app,
int  $a_obj_id = 0,
?array  $cat_info = null,
bool  $a_container_info = false 
)

Definition at line 460 of file class.ilAppointmentPresentationGUI.php.

References addCalendarInfo(), addContainerInfo(), addEventDescription(), addEventLocation(), addInfoSection(), addObjectLinks(), and null.

Referenced by ilAppointmentPresentationConsultationHoursGUI\collectPropertiesAndActions(), ilAppointmentPresentationCourseGUI\collectPropertiesAndActions(), ilAppointmentPresentationExerciseGUI\collectPropertiesAndActions(), and ilAppointmentPresentationGroupGUI\collectPropertiesAndActions().

465  : void {
466  // event title
467  $this->addInfoSection($a_app["event"]->getPresentationTitle(false));
468 
469  // event description
470  $this->addEventDescription($a_app);
471 
472  // course title (linked of accessible)
473  if ($a_obj_id > 0) {
474  $this->addObjectLinks($a_obj_id, $a_app);
475  }
476 
477  // container info (course groups)
478  if ($a_container_info) {
479  $this->addContainerInfo($a_obj_id);
480  }
481 
482  // event location
483  $this->addEventLocation($a_app);
484 
485  // calendar info
486  if ($cat_info != null) {
487  $this->addCalendarInfo($cat_info);
488  }
489  }
addObjectLinks(int $obj_id, ?array $a_appointment=null)
Add object link.
addEventDescription(array $a_app)
Add event description.
addInfoSection(string $a_txt)
Add info section.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
addEventLocation(array $a_app)
Add event location.
addContainerInfo(int $a_obj_id)
Add course/group container info.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addContainerInfo()

ilAppointmentPresentationGUI::addContainerInfo ( int  $a_obj_id)

Add course/group container info.

Definition at line 238 of file class.ilAppointmentPresentationGUI.php.

References Vendor\Package\$f, $r, $ref_id, $tree, ilLink\_getStaticLink(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilObject\_lookupType(), addInfoProperty(), addListItemProperty(), ilTree\checkForParentType(), getReadableRefIds(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

Referenced by addCommonSection(), and ilAppointmentPresentationSessionGUI\collectPropertiesAndActions().

238  : void
239  {
240  $refs = $this->getReadableRefIds($a_obj_id);
241  $ref_id = current($refs);
242  if (count($refs) == 1 && $ref_id > 0) {
243  $tree = $this->tree;
244  $f = $this->ui->factory();
245  $r = $this->ui->renderer();
246 
247  //parent course or group title
248  $cont_ref_id = $tree->checkForParentType($ref_id, 'grp');
249  if ($cont_ref_id == 0) {
250  $cont_ref_id = $tree->checkForParentType($ref_id, 'crs');
251  }
252 
253  if ($cont_ref_id > 0) {
254  $type = ilObject::_lookupType($cont_ref_id, true);
255  $href = ilLink::_getStaticLink($cont_ref_id);
256  $parent_title = ilObject::_lookupTitle(ilObject::_lookupObjectId($cont_ref_id));
257  $this->addInfoProperty(
258  $this->lng->txt("obj_" . $type),
259  $r->render($f->button()->shy($parent_title, $href))
260  );
261  $this->addListItemProperty(
262  $this->lng->txt("obj_" . $type),
263  $r->render($f->button()->shy($parent_title, $href))
264  );
265  }
266  }
267  }
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
addInfoProperty(string $a_txt, string $a_val)
Add info property.
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
$ref_id
Definition: ltiauth.php:65
static _lookupTitle(int $obj_id)
static _lookupObjectId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addEventDescription()

ilAppointmentPresentationGUI::addEventDescription ( array  $a_app)

Add event description.

Definition at line 410 of file class.ilAppointmentPresentationGUI.php.

References addInfoProperty(), ILIAS\Repository\lng(), and ilUtil\makeClickable().

Referenced by addCommonSection(), ilAppointmentPresentationUserGUI\collectPropertiesAndActions(), ilAppointmentPresentationSessionGUI\collectPropertiesAndActions(), ilAppointmentPresentationPublicGUI\collectPropertiesAndActions(), and ilAppointmentPresentationEmployeeTalkGUI\collectPropertiesAndActions().

410  : void
411  {
412  if ($a_app['event']->getDescription()) {
413  $this->addInfoProperty(
414  $this->lng->txt("description"),
415  ilUtil::makeClickable(nl2br($a_app['event']->getDescription()))
416  );
417  }
418  }
addInfoProperty(string $a_txt, string $a_val)
Add info property.
static makeClickable(string $a_text, bool $detectGotoLinks=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addEventLocation()

ilAppointmentPresentationGUI::addEventLocation ( array  $a_app)

Add event location.

Definition at line 423 of file class.ilAppointmentPresentationGUI.php.

References addInfoProperty(), addListItemProperty(), and ILIAS\Repository\lng().

Referenced by addCommonSection(), ilAppointmentPresentationUserGUI\collectPropertiesAndActions(), ilAppointmentPresentationPublicGUI\collectPropertiesAndActions(), and ilAppointmentPresentationEmployeeTalkGUI\collectPropertiesAndActions().

423  : void
424  {
425  if ($a_app['event']->getLocation()) {
426  $this->addInfoProperty($this->lng->txt("cal_where"), $a_app['event']->getLocation());
427  $this->addListItemProperty($this->lng->txt("location"), $a_app['event']->getLocation());
428  }
429  }
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
addInfoProperty(string $a_txt, string $a_val)
Add info property.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addInfoProperty()

◆ addInfoSection()

◆ addLastUpdate()

ilAppointmentPresentationGUI::addLastUpdate ( array  $a_app)

Add last update.

Definition at line 434 of file class.ilAppointmentPresentationGUI.php.

References addListItemProperty(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by ilAppointmentPresentationCourseGUI\collectPropertiesAndActions(), ilAppointmentPresentationGroupGUI\collectPropertiesAndActions(), ilAppointmentPresentationExerciseGUI\collectPropertiesAndActions(), and ilAppointmentPresentationEmployeeTalkGUI\collectPropertiesAndActions().

434  : void
435  {
436  $update = new ilDateTime(
437  $a_app["event"]->getLastUpdate()->get(IL_CAL_UNIX),
438  IL_CAL_UNIX,
439  $this->user->getTimeZone()
440  );
441  $this->addListItemProperty($this->lng->txt('last_update'), ilDatePresentation::formatDate($update));
442  }
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addListItemProperty()

◆ addMetaData()

ilAppointmentPresentationGUI::addMetaData ( string  $a_obj_type,
int  $a_obj_id,
?string  $a_sub_obj_type = null,
?int  $a_sub_obj_id = null 
)

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

References addInfoProperty(), addListItemProperty(), and ilAdvancedMDRecordGUI\MODE_APP_PRESENTATION.

Referenced by ilAppointmentPresentationBookingPoolGUI\collectPropertiesAndActions(), ilAppointmentPresentationCourseGUI\collectPropertiesAndActions(), and ilAppointmentPresentationSessionGUI\collectPropertiesAndActions().

496  : void {
497  //TODO: Remove the hack in ilADTActiveRecordByType.php.
498  $record_gui = new ilAdvancedMDRecordGUI(
500  $a_obj_type,
501  $a_obj_id,
502  (string) $a_sub_obj_type,
503  (int) $a_sub_obj_id
504  );
505  $md_items = $record_gui->parse();
506  if (count($md_items)) {
507  foreach ($md_items as $md_item) {
508  $this->addInfoProperty($md_item['title'], $md_item['value']);
509  $this->addListItemProperty($md_item['title'], $md_item['value']);
510  }
511  }
512  }
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
addInfoProperty(string $a_txt, string $a_val)
Add info property.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addObjectLinks()

ilAppointmentPresentationGUI::addObjectLinks ( int  $obj_id,
?array  $a_appointment = null 
)

Add object link.

Definition at line 351 of file class.ilAppointmentPresentationGUI.php.

References $ref_id, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), addInfoProperty(), addListItemProperty(), buildDirectLinkForAppointment(), getReadableRefIds(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

Referenced by addCommonSection(), ilAppointmentPresentationBookingPoolGUI\collectPropertiesAndActions(), and ilAppointmentPresentationEmployeeTalkGUI\collectPropertiesAndActions().

351  : void
352  {
353  $refs = $this->getReadableRefIds($obj_id);
354  reset($refs);
356  $buttons = array();
357  foreach ($refs as $ref_id) {
358  $link_title = $title;
359  if (count($refs) > 1) {
360  $par_ref = $this->tree->getParentId($ref_id);
361  $link_title .= " (" . ilObject::_lookupTitle(ilObject::_lookupObjId($par_ref)) . ")";
362  }
363 
364  $link = $this->buildDirectLinkForAppointment($ref_id, $a_appointment);
365 
366  $buttons[] = $this->ui->renderer()->render(
367  $this->ui->factory()->button()->shy($link_title, $link)
368  );
369  }
370  if ($refs == 0) {
371  $prop_value = $title;
372  } else {
373  $prop_value = implode("<br>", $buttons);
374  }
375  if ($prop_value != '') {
376  $this->addInfoProperty($this->lng->txt("obj_" . ilObject::_lookupType($obj_id)), $prop_value);
377  $this->addListItemProperty($this->lng->txt("obj_" . ilObject::_lookupType($obj_id)), $prop_value);
378  }
379  }
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
addInfoProperty(string $a_txt, string $a_val)
Add info property.
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:65
static _lookupTitle(int $obj_id)
buildDirectLinkForAppointment(int $a_ref_id, ?array $a_appointment=null)
Build direct link for appointment.
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildDirectLinkForAppointment()

ilAppointmentPresentationGUI::buildDirectLinkForAppointment ( int  $a_ref_id,
?array  $a_appointment = null 
)
protected

Build direct link for appointment.

Definition at line 384 of file class.ilAppointmentPresentationGUI.php.

References ilLink\_getStaticLink().

Referenced by addObjectLinks().

384  : string
385  {
386  return ilLink::_getStaticLink($a_ref_id);
387  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ collectPropertiesAndActions()

ilAppointmentPresentationGUI::collectPropertiesAndActions ( )

Collect properties and actions.

Definition at line 305 of file class.ilAppointmentPresentationGUI.php.

Referenced by getHTML().

305  : void
306  {
307  }
+ Here is the caller graph for this function:

◆ collectStandardPropertiesAndActions()

ilAppointmentPresentationGUI::collectStandardPropertiesAndActions ( )

Collect standard properties and actions.

Definition at line 312 of file class.ilAppointmentPresentationGUI.php.

References addAction(), ILIAS\Repository\ctrl(), getCatInfo(), and ILIAS\Repository\lng().

Referenced by getHTML().

312  : void
313  {
314  $cat_info = $this->getCatInfo();
315 
316  //we can move this to the factory.
317  if ($cat_info['editable'] && !$this->appointment['event']->isAutoGenerated()) {
318  $this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
319  // $this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed', $this->getSeed()->get(IL_CAL_DATE));
320  $this->ctrl->setParameterByClass(
321  'ilcalendarappointmentgui',
322  'app_id',
323  $this->appointment['event']->getEntryId()
324  );
325  $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dt', $this->appointment['dstart']);
326 
327  $this->addAction(
328  $this->lng->txt("edit"),
329  $this->ctrl->getLinkTargetByClass(array('ilcalendarappointmentgui'), 'askEdit')
330  );
331 
332  $this->ctrl->clearParametersByClass('ilcalendarappointmentgui');
333  // $this->ctrl->setParameterByClass('ilcalendarappointmentgui','seed',$this->getSeed()->get(IL_CAL_DATE));
334  $this->ctrl->setParameterByClass(
335  'ilcalendarappointmentgui',
336  'app_id',
337  $this->appointment['event']->getEntryId()
338  );
339  $this->ctrl->setParameterByClass('ilcalendarappointmentgui', 'dt', $this->appointment['dstart']);
340 
341  $this->addAction(
342  $this->lng->txt("delete"),
343  $this->ctrl->getLinkTargetByClass(array('ilcalendarappointmentgui'), 'askDelete')
344  );
345  }
346  }
addAction(string $a_txt, string $a_link)
Add action.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ downloadFiles()

ilAppointmentPresentationGUI::downloadFiles ( )

Download files from an appointment ( Modals )

Definition at line 563 of file class.ilAppointmentPresentationGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilDownloadFilesBackgroundTask\setBucketTitle(), and ILIAS\Repository\user().

563  : void
564  {
565  //calendar in the sidebar (marginal calendar)
566  if (empty($this->appointment)) {
567  $entry_id = 0;
568  if ($this->http->wrapper()->query()->has('app_id')) {
569  $entry_id = $this->http->wrapper()->query()->retrieve(
570  'app_id',
571  $this->refinery->kindlyTo()->int()
572  );
573  }
574  $entry = new ilCalendarEntry($entry_id);
575  //if the entry exists
576  if ($entry->getStart()) {
577  $this->appointment = array(
578  "event" => $entry,
579  "dstart" => $entry->getStart(),
580  "dend" => $entry->getEnd(),
581  "fullday" => $entry->isFullday()
582  );
583  } else {
584  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("obj_not_found"), true);
585  $this->ctrl->returnToParent($this);
586  }
587  }
588  $download_job = new ilDownloadFilesBackgroundTask($this->user->getId());
589 
590  $download_job->setBucketTitle($this->lng->txt("cal_calendar_download") . " " . $this->appointment['event']->getTitle());
591  $download_job->setEvents(array($this->appointment));
592  if ($download_job->run()) {
593  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('cal_download_files_started'), true);
594  }
595  $this->ctrl->returnToParent($this);
596  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ executeCommand()

ilAppointmentPresentationGUI::executeCommand ( )

Definition at line 150 of file class.ilAppointmentPresentationGUI.php.

References ILIAS\Repository\ctrl().

150  : void
151  {
152  $next_class = $this->ctrl->getNextClass();
153  $cmd = $this->ctrl->getCmd("getHTML");
154  switch ($next_class) {
155  default:
156  $this->$cmd();
157  }
158  }
+ Here is the call graph for this function:

◆ getCatId()

ilAppointmentPresentationGUI::getCatId ( int  $a_entry_id)

Definition at line 139 of file class.ilAppointmentPresentationGUI.php.

References ilCalendarCategoryAssignments\_lookupCategory().

Referenced by ilAppointmentPresentationConsultationHoursGUI\collectPropertiesAndActions(), getCatInfo(), and readObjIdForAppointment().

139  : int
140  {
142  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCatInfo()

◆ getHTML()

ilAppointmentPresentationGUI::getHTML ( )

Definition at line 160 of file class.ilAppointmentPresentationGUI.php.

References Vendor\Package\$a, $has_files, $ui, ilCalendarSettings\_getInstance(), ilToolbarGUI\addComponent(), ilInfoScreenGUI\addProperty(), ilInfoScreenGUI\addSection(), ilToolbarGUI\addSeparator(), ilToolbarGUI\addStickyItem(), collectPropertiesAndActions(), collectStandardPropertiesAndActions(), ILIAS\Repository\ctrl(), ILIAS\DI\UIServices\factory(), getInfoScreen(), getListItem(), ILIAS\UI\Component\Item\Item\getProperties(), getToolbar(), ILIAS\Repository\lng(), null, ILIAS\Repository\ui(), and ILIAS\UI\Component\Item\Item\withProperties().

160  : string
161  {
164  $ui = $this->ui;
165 
166  $infoscreen = $this->getInfoScreen();
167  if ($infoscreen instanceof ilInfoScreenGUI) {
168  foreach ($this->info_items as $i) {
169  switch ($i["type"]) {
170  case "section":
171  $infoscreen->addSection($i["txt"]);
172  break;
173  case "property":
174  $infoscreen->addProperty($i["txt"], $i["val"]);
175  break;
176  }
177  }
178  }
179 
180  $toolbar = $this->getToolbar();
181  if ($toolbar instanceof ilToolbarGUI) {
182  //todo: duplicated from ilcalendarviewgui.
183  $settings = ilCalendarSettings::_getInstance();
184  if ($settings->isBatchFileDownloadsEnabled() && $this->has_files) {
185  // file download
186  $this->ctrl->setParameter($this, "app_id", $this->appointment['event']->getEntryId());
187  $download_btn = $ui->factory()->button()->standard(
188  $this->lng->txt("cal_download_files"),
189  $this->ctrl->getLinkTarget($this, 'downloadFiles')
190  );
191  $this->ctrl->setParameter($this, "app_id", '');
192  $toolbar->addComponent($download_btn);
194  }
195 
196  foreach ($this->actions as $a) {
197  $btn = $this->ui->factory()->button()->standard(
198  $a["txt"],
199  $a["link"]
200  );
201  // all buttons are sticky
202  $toolbar->addStickyItem($btn);
203  }
204  }
205 
206  $list_item = $this->getListItem();
207  if ($list_item instanceof \ILIAS\UI\Component\Item\Standard) {
208  $dd = $list_item->getActions();
209  if ($dd === null) {
210  $actions = array();
211  $label = "";
212  } else {
213  $actions = $dd->getItems();
214  $label = $dd->getLabel();
215  }
216  $properties = $list_item->getProperties();
217 
218  foreach ($this->actions as $a) {
219  $actions[] = $ui->factory()->button()->shy($a["txt"], $a["link"]);
220  }
221  foreach ($this->list_properties as $lp) {
222  $properties[$lp["txt"]] = $lp["val"];
223  }
224 
225  $new_dd = $ui->factory()->dropdown()
226  ->standard($actions)
227  ->withLabel($label);
228  $this->list_item = $list_item
229  ->withActions($new_dd)
230  ->withProperties($properties);
231  }
232  return '';
233  }
collectPropertiesAndActions()
Collect properties and actions.
Interface Observer Contains several chained tasks and infos about them.
addComponent(\ILIAS\UI\Component\Component $a_comp)
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Common interface to all items.
Definition: Item.php:31
addSection(string $a_title)
getProperties()
Get the properties of the appointment.
withProperties(array $properties)
Get a new item with the given properties as key-value pairs.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
factory()
Get the factory that crafts UI components.
Definition: UIServices.php:36
addStickyItem( $a_item, bool $a_output_label=false)
Add a sticky item.
collectStandardPropertiesAndActions()
Collect standard properties and actions.
+ Here is the call graph for this function:

◆ getInfoScreen()

ilAppointmentPresentationGUI::getInfoScreen ( )
Returns
ilInfoScreenGUI

Implements ilCalendarAppointmentPresentation.

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

References $infoscreen.

Referenced by ilAppointmentPresentationCourseGUI\collectPropertiesAndActions(), and getHTML().

+ Here is the caller graph for this function:

◆ getInstance()

static ilAppointmentPresentationGUI::getInstance ( array  $a_appointment,
?ilInfoScreenGUI  $a_info_screen,
?ilToolbarGUI  $a_toolbar,
?Item  $a_list_item 
)
static

Definition at line 108 of file class.ilAppointmentPresentationGUI.php.

114  return new static($a_appointment, $a_info_screen, $a_toolbar, $a_list_item);
115  }

◆ getListItem()

ilAppointmentPresentationGUI::getListItem ( )

Get list item.

Returns

Definition at line 126 of file class.ilAppointmentPresentationGUI.php.

References $list_item.

Referenced by getHTML().

126  : ?Item
127  {
128  return $this->list_item;
129  }
Common interface to all items.
Definition: Item.php:31
+ Here is the caller graph for this function:

◆ getObjIdForAppointment()

◆ getReadableRefIds()

ilAppointmentPresentationGUI::getReadableRefIds ( int  $a_obj_id)
Parameters
int$a_obj_id
Returns
int[]

Definition at line 393 of file class.ilAppointmentPresentationGUI.php.

References $ref_id, ilObject\_getAllReferences(), and ILIAS\Repository\access().

Referenced by addContainerInfo(), addObjectLinks(), ilAppointmentPresentationBookingPoolGUI\collectPropertiesAndActions(), ilAppointmentPresentationConsultationHoursGUI\collectPropertiesAndActions(), ilAppointmentPresentationExerciseGUI\collectPropertiesAndActions(), and ilAppointmentPresentationSessionGUI\collectPropertiesAndActions().

393  : array
394  {
395  if (!isset($this->readable_ref_ids[$a_obj_id])) {
396  $ref_ids = array();
397  foreach (ilObject::_getAllReferences($a_obj_id) as $ref_id) {
398  if ($this->access->checkAccess("read", "", $ref_id)) {
399  $ref_ids[] = $ref_id;
400  }
401  }
402  $this->readable_ref_ids[$a_obj_id] = $ref_ids;
403  }
404  return $this->readable_ref_ids[$a_obj_id];
405  }
static _getAllReferences(int $id)
get all reference ids for object ID
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getToolbar()

ilAppointmentPresentationGUI::getToolbar ( )

Implements ilCalendarAppointmentPresentation.

Definition at line 117 of file class.ilAppointmentPresentationGUI.php.

References $toolbar.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getUserName()

ilAppointmentPresentationGUI::getUserName ( int  $a_user_id,
bool  $a_force_name = false 
)

Get (linked if possible) user name.

Definition at line 517 of file class.ilAppointmentPresentationGUI.php.

References $ref_id, ilObject\_lookupType(), ILIAS\Repository\ctrl(), ilUserUtil\getNamePresentation(), ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by ilAppointmentPresentationConsultationHoursGUI\collectPropertiesAndActions(), ilAppointmentPresentationCourseGUI\collectPropertiesAndActions(), ilAppointmentPresentationUserGUI\collectPropertiesAndActions(), ilAppointmentPresentationGroupGUI\collectPropertiesAndActions(), ilAppointmentPresentationPublicGUI\collectPropertiesAndActions(), and ilAppointmentPresentationEmployeeTalkGUI\collectPropertiesAndActions().

517  : string
518  {
519  $ref_id = 0;
520  if ($this->http->wrapper()->query()->has('ref_id')) {
521  $ref_id = $this->http->wrapper()->query()->retrieve(
522  'ref_id',
523  $this->refinery->kindlyTo()->int()
524  );
525  }
526  $type = ilObject::_lookupType($ref_id, true);
527  $ctrl_path = array();
528  if ($type == "crs") {
529  $ctrl_path[] = "ilobjcoursegui";
530  }
531  if ($type == "grp") {
532  $ctrl_path[] = "ilobjgroupgui";
533  }
534  $baseClass = '';
535  if ($this->http->wrapper()->query()->has('baseClass')) {
536  $baseClass = $this->http->wrapper()->query()->retrieve(
537  'baseClass',
538  $this->refinery->kindlyTo()->string()
539  );
540  }
541  if (strtolower($baseClass) == "ildashboardgui") {
542  $ctrl_path[] = "ildashboardgui";
543  }
544  $ctrl_path[] = "ilCalendarPresentationGUI";
545  $ctrl_path[] = "ilpublicuserprofilegui";
546 
548  $a_user_id,
549  false,
550  true,
551  $this->ctrl->getParentReturn($this),
552  $a_force_name,
553  false,
554  true,
555  false,
556  $ctrl_path
557  );
558  }
static http()
Fetches the global http state from ILIAS.
$ref_id
Definition: ltiauth.php:65
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readObjIdForAppointment()

ilAppointmentPresentationGUI::readObjIdForAppointment ( )
protected

read obj_id for appointment

Definition at line 101 of file class.ilAppointmentPresentationGUI.php.

References getCatId(), and ilCalendarCategory\getInstanceByCategoryId().

Referenced by __construct().

101  : void
102  {
103  $cat_id = $this->getCatId($this->appointment['event']->getEntryId());
104  $category = ilCalendarCategory::getInstanceByCategoryId($cat_id);
105  $this->obj_id = $category->getObjId();
106  }
static getInstanceByCategoryId(int $a_cat_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilAppointmentPresentationGUI::$access
protected

Definition at line 44 of file class.ilAppointmentPresentationGUI.php.

◆ $actions

array ilAppointmentPresentationGUI::$actions = []
protected

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

◆ $appointment

◆ $ctrl

ilCtrlInterface ilAppointmentPresentationGUI::$ctrl
protected

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

◆ $has_files

bool ilAppointmentPresentationGUI::$has_files = false
protected

Definition at line 62 of file class.ilAppointmentPresentationGUI.php.

Referenced by getHTML().

◆ $http

HttpServices ilAppointmentPresentationGUI::$http
protected

Definition at line 48 of file class.ilAppointmentPresentationGUI.php.

◆ $info_items

array ilAppointmentPresentationGUI::$info_items = []
protected

Definition at line 53 of file class.ilAppointmentPresentationGUI.php.

◆ $infoscreen

ilInfoScreenGUI ilAppointmentPresentationGUI::$infoscreen
protected

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

Referenced by getInfoScreen().

◆ $instance

self ilAppointmentPresentationGUI::$instance
staticprotected

Definition at line 34 of file class.ilAppointmentPresentationGUI.php.

◆ $list_item

Item ilAppointmentPresentationGUI::$list_item = null
protected

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

Referenced by getListItem().

◆ $list_properties

array ilAppointmentPresentationGUI::$list_properties = []
protected

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

◆ $lng

ilLanguage ilAppointmentPresentationGUI::$lng
protected

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

◆ $main_tpl

ilGlobalTemplateInterface ilAppointmentPresentationGUI::$main_tpl
private

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

◆ $obj_id

◆ $rbacsystem

ilRbacSystem ilAppointmentPresentationGUI::$rbacsystem
protected

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

◆ $readable_ref_ids

array ilAppointmentPresentationGUI::$readable_ref_ids
protected

Definition at line 60 of file class.ilAppointmentPresentationGUI.php.

◆ $refinery

RefineryFactory ilAppointmentPresentationGUI::$refinery
protected

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

◆ $toolbar

ilToolbarGUI ilAppointmentPresentationGUI::$toolbar
protected

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

Referenced by getToolbar().

◆ $tree

ilTree ilAppointmentPresentationGUI::$tree
protected

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

Referenced by addContainerInfo().

◆ $ui

UIServices ilAppointmentPresentationGUI::$ui
protected

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

Referenced by getHTML().

◆ $user


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