ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilAppointmentPresentationEmployeeTalkGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
29 {
33  public function __construct(
34  array $a_appointment,
35  ?ilInfoScreenGUI $a_info_screen,
36  ?ilToolbarGUI $a_toolbar,
37  ?Item $a_list_item
38  ) {
39  parent::__construct($a_appointment, $a_info_screen, $a_toolbar, $a_list_item);
40 
41  $this->lng->loadLanguageModule(ilObjEmployeeTalk::TYPE);
42  }
43 
44  public function collectPropertiesAndActions(): void
45  {
46  $talk = new ilObjEmployeeTalk($this->getObjIdForAppointment(), false);
47 
48  $superior = $this->getUserName($talk->getOwner(), true);
49  $employee = $this->getUserName($talk->getData()->getEmployee(), true);
50 
51  $this->addObjectLinks($talk->getId(), $this->appointment);
52 
53  // get talk ref id (this is possible, since talks only have one ref id)
54  $refs = ilObject::_getAllReferences($talk->getId());
55  $etalRef = current($refs);
56  $this->addAction($this->lng->txt("etal_open"), $this->getTalkGoto($etalRef));
57 
58  $this->addInfoSection($this->lng->txt('obj_etal'));
59  $this->addInfoProperty($this->lng->txt('title'), $talk->getTitle());
60  $this->addEventDescription($this->appointment);
61 
62  $this->addEventLocation($this->appointment);
63  $this->addLastUpdate($this->appointment);
64  $this->addListItemProperty($this->lng->txt("il_orgu_superior"), $superior);
65  $this->addListItemProperty($this->lng->txt("il_orgu_employee"), $employee);
66 
67  $this->addInfoProperty($this->lng->txt("il_orgu_superior"), $superior);
68  $this->addInfoProperty($this->lng->txt("il_orgu_employee"), $employee);
69 
70  parent::collectPropertiesAndActions();
71  }
72 
73  private function getTalkGoto(int $ref_id): string
74  {
75  return ILIAS_HTTP_PATH . '/goto.php?target=' . ilObjEmployeeTalk::TYPE . '_' .
76  $ref_id . '&client_id=' . CLIENT_ID;
77  }
78 }
__construct(array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
ilAppointmentPresentationEmployeeTalkGUI constructor.
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:65
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.