ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAppointmentPresentationEmployeeTalkGUI.php
Go to the documentation of this file.
1<?php
2
19declare(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}
Class ilAppointmentPresentationEmployeeTalkGUI @ilCtrl_IsCalledBy ilAppointmentPresentationEmployeeTa...
__construct(array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
ilAppointmentPresentationEmployeeTalkGUI constructor.
addInfoProperty(string $a_txt, string $a_val)
Add info property.
addEventLocation(array $a_app)
Add event location.
addEventDescription(array $a_app)
Add event description.
addObjectLinks(int $obj_id, ?array $a_appointment=null)
Add object link.
addAction(string $a_txt, string $a_link)
Add action.
getUserName(int $a_user_id, bool $a_force_name=false)
Get (linked if possible) user name.
addInfoSection(string $a_txt)
Add info section.
addListItemProperty(string $a_txt, string $a_val)
Add list item property.
Class ilInfoScreenGUI.
static _getAllReferences(int $id)
get all reference ids for object ID
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const CLIENT_ID
Definition: constants.php:41
Common interface to all items.
Definition: Item.php:32
$ref_id
Definition: ltiauth.php:66
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc