19 declare(strict_types=1);
36 strtolower(ilDashboardGUI::class),
37 strtolower(ilMyStaffGUI::class),
38 strtolower(ilEmployeeTalkMyStaffListGUI::class)
44 return $this->
access->hasCurrentUserAccessToTalks();
49 $this->
ui->mainTemplate()->setTitle($this->
language->txt(
'mm_org_etal'));
55 $this->
tabs->addTab(
"view_content",
"Content",
"#");
56 $this->
tabs->activateTab(
"view_content");
57 $this->
tabs->setForcePresentationOfSingleTab(
true);
66 if ($this->current_user->getId() === 6) {
69 $users = $this->getEmployeeIdsWithValidPermissionRights($this->current_user->getId());
70 $talks = $this->
repository->findByUserOrTheirEmployees($this->current_user->getId(), $users);
75 private function getEmployeeIdsWithValidPermissionRights(
int $userId): array
77 $myStaffAccess = ilMyStaffAccess::getInstance();
79 $managedUsers = [$userId];
84 $managedOrgUnitUsersOfUserByPosition = $myStaffAccess->getUsersForUserPerPosition($userId);
86 foreach ($managedOrgUnitUsersOfUserByPosition as $position => $managedOrgUnitUserByPosition) {
89 $isAbleToExecuteOperation = array_reduce($permissionSet->getOperations(),
function (
bool $prev,
ilOrgUnitOperation $it) {
90 return $prev || $it->getOperationString() === EmployeeTalkPositionAccessLevel::VIEW;
93 if (!$isAbleToExecuteOperation) {
97 foreach ($managedOrgUnitUserByPosition as $managedOrgUnitUser) {
98 $managedUsers[] = intval($managedOrgUnitUser);
102 $managedUsers = array_unique($managedUsers, SORT_NUMERIC);
104 return $managedUsers;
repository()
description: > Example for rendering a repository card
static getTemplateSetForContextName(string $context_name, string $position_id, bool $editable=false)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
language()
description: > Example for rendring a language glyph.