ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilAppointmentPresentationEmployeeTalkGUI.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
23 
30 {
34  public function __construct(
35  array $a_appointment,
36  ?ilInfoScreenGUI $a_info_screen,
37  ?ilToolbarGUI $a_toolbar,
38  ?Item $a_list_item
39  ) {
40  parent::__construct($a_appointment, $a_info_screen, $a_toolbar, $a_list_item);
41 
42  $this->lng->loadLanguageModule(ilObjEmployeeTalk::TYPE);
43  }
44 
45  public function collectPropertiesAndActions(): void
46  {
47  $talk = new ilObjEmployeeTalk($this->getObjIdForAppointment(), false);
48 
49  $superior = $this->getUserName($talk->getOwner(), true);
50  $employee = $this->getUserName($talk->getData()->getEmployee(), true);
51 
52  $this->addObjectLinks($talk->getId(), $this->appointment);
53 
54  // get talk ref id (this is possible, since talks only have one ref id)
55  $refs = ilObject::_getAllReferences($talk->getId());
56  $etalRef = current($refs);
57  $this->addAction($this->lng->txt("etal_open"), $this->getTalkGoto($etalRef));
58 
59  $this->addInfoSection($this->lng->txt('obj_etal'));
60  $this->addInfoProperty($this->lng->txt('title'), $talk->getTitle());
61  $this->addEventDescription($this->appointment);
62 
63  $this->addEventLocation($this->appointment);
64  $this->addLastUpdate($this->appointment);
65  $this->addListItemProperty($this->lng->txt("il_orgu_superior"), $superior);
66  $this->addListItemProperty($this->lng->txt("il_orgu_employee"), $employee);
67 
68  $this->addInfoProperty($this->lng->txt("il_orgu_superior"), $superior);
69  $this->addInfoProperty($this->lng->txt("il_orgu_employee"), $employee);
70 
71  parent::collectPropertiesAndActions();
72  }
73 
74  private function getTalkGoto(int $ref_id): string
75  {
76  return ILIAS_HTTP_PATH . '/goto.php?target=' . ilObjEmployeeTalk::TYPE . '_' .
77  $ref_id . '&client_id=' . CLIENT_ID;
78  }
79 }
__construct(array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
ilAppointmentPresentationEmployeeTalkGUI constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilInfoScreenGUI.
addObjectLinks(int $obj_id, ?array $a_appointment=null)
Add object link.
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
static _getAllReferences(int $id)
get all reference ids for object ID
Class ilAppointmentPresentationEmployeeTalkGUI ilAppointmentPresentationEmployeeTalkGUI: ilCalendarA...
addEventDescription(array $a_app)
Add event description.
addInfoSection(string $a_txt)
Add info section.
addInfoProperty(string $a_txt, string $a_val)
Add info property.
addLastUpdate(array $a_app)
Add last update.
$ref_id
Definition: ltiauth.php:67
Common interface to all items.
Definition: Item.php:31
addEventLocation(array $a_app)
Add event location.
const CLIENT_ID
Definition: constants.php:41
getUserName(int $a_user_id, bool $a_force_name=false)
Get (linked if possible) user name.
__construct(Container $dic, ilPlugin $plugin)
addAction(string $a_txt, string $a_link)
Add action.