diff --git a/components/ILIAS/Badge/classes/class.ilBadgeImageTemplateTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeImageTemplateTableGUI.php index 66a7d5d55cab..732f4da9803c 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeImageTemplateTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeImageTemplateTableGUI.php @@ -217,7 +217,7 @@ public function renderTable(): void $data_retrieval = $this->buildDataRetrievalObject($f, $r); $table = $f->table() - ->data('', $columns, $data_retrieval) + ->data($this->lng->txt('badge_image_templates'), $columns, $data_retrieval) ->withActions($actions) ->withRequest($request); diff --git a/components/ILIAS/Badge/classes/class.ilBadgeManagementGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeManagementGUI.php index ff97d8f41f3b..085ef1c452c6 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeManagementGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeManagementGUI.php @@ -864,22 +864,6 @@ protected function awardBadgeUserSelection(): void $tbl->renderTable(); } - protected function applyAwardBadgeUserSelection(): void - { - $tbl = new ilBadgeUserTableGUI($this, 'awardBadgeUserSelection', $this->parent_ref_id); - $tbl->resetOffset(); - $tbl->writeFilterToSession(); - $this->awardBadgeUserSelection(); - } - - protected function resetAwardBadgeUserSelection(): void - { - $tbl = new ilBadgeUserTableGUI($this, 'awardBadgeUserSelection', $this->parent_ref_id); - $tbl->resetOffset(); - $tbl->resetFilter(); - $this->awardBadgeUserSelection(); - } - protected function assignBadge(): void { $ilCtrl = $this->ctrl; diff --git a/components/ILIAS/Badge/classes/class.ilBadgePersonalTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgePersonalTableGUI.php index 7e89e3f57e41..b1634c32facd 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgePersonalTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgePersonalTableGUI.php @@ -250,7 +250,7 @@ public function renderTable(): void $actions = $this->getActions($url_builder, $action_parameter_token, $row_id_token); $table = $f->table() - ->data('', $columns, $data_retrieval) + ->data($this->lng->txt('badge_personal_badges'), $columns, $data_retrieval) ->withActions($actions) ->withRequest($request); diff --git a/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php index 5a9321358aa2..b4a6167e08cc 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php @@ -313,7 +313,7 @@ public function renderTable(): void $data_retrieval = $this->buildDataRetrievalObject($f, $r, $this->parent_id, $this->parent_type); $actions = $this->getActions($url_builder, $action_parameter_token, $row_id_token); - $table = $f->table()->data('', $columns, $data_retrieval) + $table = $f->table()->data($this->lng->txt('obj_bdga'), $columns, $data_retrieval) ->withActions($actions) ->withRequest($request); $out = [$table]; diff --git a/components/ILIAS/Badge/classes/class.ilBadgeTypesTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeTypesTableGUI.php index 8f1ed4a6cba9..2c149e06c3b5 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeTypesTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeTypesTableGUI.php @@ -229,7 +229,7 @@ public function renderTable(): void $data_retrieval = $this->buildDataRetrievalObject($f, $r); $table = $f->table() - ->data('', $columns, $data_retrieval) + ->data($this->lng->txt('badge_types'), $columns, $data_retrieval) ->withActions($actions) ->withRequest($request); diff --git a/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php index 19f20e80f0e5..0d3b924e8803 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php @@ -40,6 +40,7 @@ use ilUserQuery; use DateTimeImmutable; use ILIAS\UI\URLBuilderToken; +use ilObjectDataDeletionLog; class ilBadgeUserTableGUI { @@ -47,12 +48,14 @@ class ilBadgeUserTableGUI private readonly Renderer $renderer; private readonly ServerRequestInterface|RequestInterface $request; private readonly int $parent_ref_id; - private readonly ?ilBadge $award_badge; private readonly ilLanguage $lng; private readonly ilGlobalTemplateInterface $tpl; - public function __construct(int $parent_ref_id, ?ilBadge $award_badge = null) - { + public function __construct( + int $parent_ref_id, + private readonly ?ilBadge $award_badge = null, + private readonly int $restrict_badge_id = 0 + ) { global $DIC; $this->lng = $DIC->language(); @@ -61,7 +64,6 @@ public function __construct(int $parent_ref_id, ?ilBadge $award_badge = null) $this->renderer = $DIC->ui()->renderer(); $this->request = $DIC->http()->request(); $this->parent_ref_id = $parent_ref_id; - $this->award_badge = $award_badge; } private function buildDataRetrievalObject( @@ -196,7 +198,7 @@ public function getRows( ?array $additional_parameters ): Generator { $records = $this->getRecords($range, $order); - foreach ($records as $idx => $record) { + foreach ($records as $record) { $row_id = (string) $record['id']; if ($this->award_badge !== null) { @@ -313,9 +315,28 @@ public function renderTable(): void $data_retrieval = $this->buildDataRetrievalObject($f, $r, $this->parent_ref_id, $this->award_badge); $actions = $this->getActions($url_builder, $action_parameter_token, $row_id_token); - $title = ''; if ($this->award_badge) { - $title = $this->lng->txt("badge_award_badge") . ": " . $this->award_badge->getTitle(); + $title = $this->lng->txt('badge_award_badge') . ': ' . $this->award_badge->getTitle(); + } else { + $parent = ''; + $parent_obj_id = ilObject::_lookupObjId($this->parent_ref_id); + if ($parent_obj_id) { + $title = ilObject::_lookupTitle($parent_obj_id); + if (!$title) { + $title = ilObjectDataDeletionLog::get($parent_obj_id); + if ($title) { + $title = $title['title']; + } + } + + if ($this->restrict_badge_id) { + $badge = new ilBadge($this->restrict_badge_id); + $title .= ' - ' . $badge->getTitle(); + } + + $parent = $title . ': '; + } + $title = $parent . $this->lng->txt('users'); } $table = $f->table() ->data($title, $columns, $data_retrieval) diff --git a/components/ILIAS/Badge/classes/class.ilObjBadgeAdministrationGUI.php b/components/ILIAS/Badge/classes/class.ilObjBadgeAdministrationGUI.php index 2b91df26fb90..6cabedd0ba42 100755 --- a/components/ILIAS/Badge/classes/class.ilObjBadgeAdministrationGUI.php +++ b/components/ILIAS/Badge/classes/class.ilObjBadgeAdministrationGUI.php @@ -634,7 +634,6 @@ protected function listObjectBadgeUsers(): void { $ilCtrl = $this->ctrl; $lng = $this->lng; - $tpl = $this->tpl; $parent_obj_id = $this->badge_request->getParentId(); $parent_ref_ids = ilObject::_getAllReferences($parent_obj_id); @@ -657,7 +656,7 @@ protected function listObjectBadgeUsers(): void $ilCtrl->saveParameter($this, 'pid'); - $tbl = new ilBadgeUserTableGUI($parent_ref_id); + $tbl = new ilBadgeUserTableGUI($parent_ref_id, null, $this->badge_request->getBadgeId()); $tbl->renderTable(); } diff --git a/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php b/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php index 04eafe0a2fac..133e732f2644 100755 --- a/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php @@ -336,7 +336,7 @@ public function renderTable(): void $actions = $this->getActions($url_builder, $action_parameter_token, $row_id_token); $table = $f->table() - ->data('', $columns, $data_retrieval) + ->data($this->lng->txt('badge_object_badges'), $columns, $data_retrieval) ->withActions($actions) ->withRequest($request);