From 2644f64519346771645d8ea6aca3582c01998fc1 Mon Sep 17 00:00:00 2001 From: mjansen Date: Thu, 19 Dec 2024 11:48:29 +0100 Subject: [PATCH] Badges: More badge table fixes (and: Merry X-mas) --- .../Badge/classes/class.ilBadgeGUIRequest.php | 4 +- .../classes/class.ilBadgeManagementGUI.php | 45 ++-- .../Badge/classes/class.ilBadgeTableGUI.php | 6 +- .../classes/class.ilBadgeUserTableGUI.php | 196 +++++++++++++----- .../class.ilObjBadgeAdministrationGUI.php | 58 ++---- .../classes/class.ilObjectBadgeTableGUI.php | 3 +- 6 files changed, 190 insertions(+), 122 deletions(-) diff --git a/components/ILIAS/Badge/classes/class.ilBadgeGUIRequest.php b/components/ILIAS/Badge/classes/class.ilBadgeGUIRequest.php index 16cb3de896bc..f125c4693ae7 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeGUIRequest.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeGUIRequest.php @@ -169,6 +169,9 @@ public function getBadgeIdFromUrl(): int return $id; } + /** + * @return list + */ public function getMultiActionBadgeIdsFromUrl(): array { $tmpl_ids = []; @@ -183,7 +186,6 @@ public function getMultiActionBadgeIdsFromUrl(): array return $tmpl_ids; } - public function getBadgeId(): int { return $this->int("bid"); diff --git a/components/ILIAS/Badge/classes/class.ilBadgeManagementGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeManagementGUI.php index 085ef1c452c6..f4aa7243f5b6 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeManagementGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeManagementGUI.php @@ -96,31 +96,34 @@ public function __construct( $this->flavour_definition = new ilBadgePictureDefinition(); } - protected function splitBadgeAndUserIdsFromString(array $splittable_user_ids): array + /** + * @param list $splittable_user_ids + * @return array{0: list, 1: int} + */ + private function splitBadgeAndUserIdsFromString(array $splittable_user_ids): array { $user_ids = []; $badge_id = null; if ($splittable_user_ids !== []) { - foreach ($splittable_user_ids as $row) { if (str_contains($row, '_')) { $split = explode('_', $row); - if ($badge_id === null && $split[1] !== '') { - $badge_id = $split[1]; + if ($badge_id === null && $split[0] !== '') { + $badge_id = (int) $split[0]; } - if ($split[0] !== '') { - $user_ids[] = $split[0]; + if ($split[1] !== '') { + $user_ids[] = (int) $split[1]; } } else { return [$user_ids, 0]; } } - } - return array($user_ids, $badge_id); + + return [$user_ids, $badge_id]; } public function executeCommand(): void @@ -606,7 +609,6 @@ protected function confirmDeleteBadges(): void $ilTabs = $this->tabs; $badge_ids = $this->request->getMultiActionBadgeIdsFromUrl(); - if ($badge_ids === ['ALL_OBJECTS']) { $badge_ids = []; foreach (ilBadge::getInstancesByParentId($this->parent_obj_id) as $badge) { @@ -747,19 +749,18 @@ protected function toggleBadges(bool $a_status): void $lng = $this->lng; $badge_ids = $this->request->getMultiActionBadgeIdsFromUrl(); - if (count($badge_ids) > 0) { foreach ($badge_ids as $badge_id) { - if ($badge_id !== self::TABLE_ALL_OBJECTS_ACTION) { - $badge = new ilBadge((int) $badge_id); - $badge->setActive($a_status); - $badge->update(); - } elseif ($badge_id === self::TABLE_ALL_OBJECTS_ACTION) { + if ($badge_id === self::TABLE_ALL_OBJECTS_ACTION) { foreach (ilBadge::getInstancesByParentId($this->parent_obj_id) as $badge) { $badge = new ilBadge($badge->getId()); $badge->setActive($a_status); $badge->update(); } + } else { + $badge = new ilBadge((int) $badge_id); + $badge->setActive($a_status); + $badge->update(); } $this->tpl->setOnScreenMessage('success', $lng->txt('settings_saved'), true); } @@ -871,7 +872,7 @@ protected function assignBadge(): void $lng = $this->lng; $splittable_user_ids = $this->request->getBadgeAssignableUsers(); - list($user_ids, $badge_id) = $this->splitBadgeAndUserIdsFromString($splittable_user_ids); + [$user_ids, $badge_id] = $this->splitBadgeAndUserIdsFromString($splittable_user_ids); if (!$user_ids || !$badge_id || @@ -881,8 +882,8 @@ protected function assignBadge(): void $new_badges = []; foreach ($user_ids as $user_id) { - if (!ilBadgeAssignment::exists($badge_id, (int) $user_id)) { - $ass = new ilBadgeAssignment($badge_id, (int) $user_id); + if (!ilBadgeAssignment::exists($badge_id, $user_id)) { + $ass = new ilBadgeAssignment($badge_id, $user_id); $ass->setAwardedBy($ilUser->getId()); $ass->store(); @@ -903,9 +904,8 @@ protected function confirmDeassignBadge(): void $tpl = $this->tpl; $ilTabs = $this->tabs; - $user_ids = $this->request->getIds(); $splittable_user_ids = $this->request->getMultiActionBadgeIdsFromUrl(); - list($user_ids, $badge_id) = $this->splitBadgeAndUserIdsFromString($splittable_user_ids); + [$user_ids, $badge_id] = $this->splitBadgeAndUserIdsFromString($splittable_user_ids); if (!$user_ids || !$badge_id || @@ -934,10 +934,10 @@ protected function confirmDeassignBadge(): void $assigned_users = ilBadgeAssignment::getAssignedUsers($badge->getId()); foreach ($user_ids as $user_id) { - if (in_array($user_id, $assigned_users)) { + if (in_array($user_id, $assigned_users, true)) { $confirmation_gui->addItem( "id[$user_id]", - $badge_id, + (string) $badge_id, ilUserUtil::getNamePresentation($user_id, false, false, '', true) ); } @@ -959,7 +959,6 @@ protected function deassignBadge(): void $user_ids[] = $usr_id; } - if (!$user_ids || !$badge_id || !$this->hasWrite()) { diff --git a/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php index 68f168a48a0f..28a6d1489a04 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeTableGUI.php @@ -192,7 +192,11 @@ public function getRows( $records = $this->getRecords($range, $order); foreach ($records as $record) { $row_id = (string) $record['id']; - yield $row_builder->buildDataRow($row_id, $record); + yield $row_builder->buildDataRow($row_id, $record) + ->withDisabledAction( + 'award_revoke_badge', + !$record['manual'] || !$record['active'] + ); } } diff --git a/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php b/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php index 94a5a2135ba2..a6911cbcb689 100755 --- a/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilBadgeUserTableGUI.php @@ -43,21 +43,23 @@ use ilTree; use ilCalendarSettings; use ilObjUser; +use ILIAS\Data\DateFormat\DateFormat; class ilBadgeUserTableGUI { private readonly Factory $factory; private readonly Renderer $renderer; private readonly ServerRequestInterface|RequestInterface $request; - private readonly int $parent_ref_id; private readonly ilLanguage $lng; private readonly ilGlobalTemplateInterface $tpl; private readonly ilTree $tree; private readonly ilObjUser $user; + private DateFormat $date_format; public function __construct( - int $parent_ref_id, + private readonly ?int $parent_ref_id = null, private readonly ?ilBadge $award_badge = null, + private readonly ?int $parent_obj_id = null, private readonly ?int $restrict_badge_id = null ) { global $DIC; @@ -69,27 +71,47 @@ public function __construct( $this->request = $DIC->http()->request(); $this->tree = $DIC->repositoryTree(); $this->user = $DIC->user(); - $this->parent_ref_id = $parent_ref_id; } private function buildDataRetrievalObject( + bool $is_container_context, Factory $f, Renderer $r, + ilLanguage $lng, ilTree $tree, ilObjUser $user, - int $parent_ref_id, - ?int $restrict_badge_id = null, - ?ilBadge $award_badge = null + DateFormat $date_format, + ?int $parent_ref_id, + ?int $parent_obj_id, + ?int $restrict_badge_id, + ?ilBadge $award_badge ): DataRetrieval { - return new class ($f, $r, $tree, $user, $parent_ref_id, $restrict_badge_id, $award_badge) implements DataRetrieval { + return new class ( + $is_container_context, + $f, + $r, + $lng, + $tree, + $user, + $date_format, + $parent_ref_id, + $parent_obj_id, + $restrict_badge_id, + $award_badge + ) implements + DataRetrieval { public function __construct( + private readonly bool $is_container_context, private readonly Factory $ui_factory, private readonly Renderer $ui_renderer, + private readonly ilLanguage $lng, private readonly ilTree $tree, private readonly ilObjUser $user, - private readonly int $parent_ref_id, - private readonly ?int $restrict_badge_id = null, - private readonly ?ilBadge $award_badge = null + private readonly DateFormat $date_format, + private readonly ?int $parent_ref_id, + private readonly ?int $parent_obj_id, + private readonly ?int $restrict_badge_id, + private readonly ?ilBadge $award_badge ) { } @@ -100,7 +122,10 @@ public function __construct( * login: string, * type: string, * title: string, - * issued: ?DateTimeImmutable + * issued: ?DateTimeImmutable, + * issued_sortable: ?DateTimeImmutable, + * parent: ?string, + * parent_sortable: ?string * }> */ private function getBadgeImageTemplates(): array @@ -111,17 +136,23 @@ private function getBadgeImageTemplates(): array $rows = []; $badges = []; - $a_parent_obj_id = ilObject::_lookupObjId($this->parent_ref_id); + $parent_obj_id = $this->parent_obj_id; + if (!$parent_obj_id && $this->parent_ref_id) { + $parent_obj_id = ilObject::_lookupObjId($this->parent_ref_id); + } + if ($this->parent_ref_id) { - $user_ids = ilBadgeHandler::getInstance()->getUserIds($this->parent_ref_id, $a_parent_obj_id); + $user_ids = ilBadgeHandler::getInstance()->getUserIds($this->parent_ref_id, $parent_obj_id); } - $obj_ids = [$a_parent_obj_id]; - foreach ($this->tree->getSubTree($this->tree->getNodeData($this->parent_ref_id)) as $node) { - $obj_ids[] = (int) $node['obj_id']; + $obj_ids = [$parent_obj_id]; + if ($this->is_container_context) { + foreach ($this->tree->getSubTree($this->tree->getNodeData($this->parent_ref_id)) as $node) { + $obj_ids[] = (int) $node['obj_id']; + } + $obj_ids = array_unique($obj_ids); } - $obj_ids = array_unique($obj_ids); foreach ($obj_ids as $obj_id) { foreach (ilBadge::getInstancesByParentId($obj_id) as $badge) { $badges[$badge->getId()] = $badge; @@ -132,7 +163,8 @@ private function getBadgeImageTemplates(): array continue; } - if ($this->award_badge && $ass->getBadgeId() !== $this->award_badge->getId()) { + if ($this->award_badge instanceof ilBadge && + $ass->getBadgeId() !== $this->award_badge->getId()) { continue; } @@ -155,10 +187,25 @@ private function getBadgeImageTemplates(): array foreach ($tmp['set'] as $user) { if (\array_key_exists($user['usr_id'], $assignments)) { foreach ($assignments[$user['usr_id']] as $user_ass) { - $idx = $user_ass->getBadgeId() . '-' . $user['usr_id']; + $idx = $user_ass->getBadgeId() . '_' . $user_ass->getUserId(); $badge = $badges[$user_ass->getBadgeId()]; + $parent = null; + $paren_sortable = null; + if ($this->is_container_context) { + $parent_metadata = $badge->getParentMeta(); + + $parent = implode(' ', [ + $this->ui_renderer->render($this->ui_factory->symbol()->icon()->custom( + ilObject::_getIcon($parent_metadata['id'], 'big', $parent_metadata['type']), + $this->lng->txt('obj_' . $parent_metadata['type']) + )), + $parent_metadata['title'] + ]); + $paren_sortable = $parent_metadata['title']; + } + $rows[] = [ 'id' => $idx, 'name' => $user['lastname'] . ', ' . $user['firstname'], @@ -168,10 +215,16 @@ private function getBadgeImageTemplates(): array 'issued' => (new DateTimeImmutable()) ->setTimestamp($user_ass->getTimestamp()) ->setTimezone(new \DateTimeZone($this->user->getTimeZone())) + ->format($this->date_format->toString()), + 'issued_sortable' => (new DateTimeImmutable()) + ->setTimestamp($user_ass->getTimestamp()) + ->setTimezone(new \DateTimeZone($this->user->getTimeZone())), + 'parent' => $parent, + 'parent_sortable' => $paren_sortable, ]; } } elseif ($this->award_badge) { - $idx = '0-' . $user['usr_id']; + $idx = $this->award_badge->getId() . '_' . $user['usr_id']; $rows[] = [ 'id' => $idx, @@ -180,6 +233,9 @@ private function getBadgeImageTemplates(): array 'type' => '', 'title' => '', 'issued' => null, + 'issued_sortable' => null, + 'parent' => null, + 'parent_sortable' => null, ]; } } @@ -197,7 +253,13 @@ public function getRows( ): Generator { $records = $this->getRecords($range, $order); foreach ($records as $record) { - yield $row_builder->buildDataRow($record['id'], $record); + yield $row_builder->buildDataRow($record['id'], $record)->withDisabledAction( + 'badge_award_badge', + $record['issued'] === null + )->withDisabledAction( + 'badge_revoke_badge', + $record['issued'] !== null + ); } } @@ -215,7 +277,10 @@ public function getTotalRowCount( * login: string, * type: string, * title: string, - * issued: ?DateTimeImmutable + * issued: ?DateTimeImmutable, + * issued_sortable: ?DateTimeImmutable, + * parent: ?string, + * parent_sortable: ?string * }> */ private function getRecords(Range $range = null, Order $order = null): array @@ -230,13 +295,22 @@ private function getRecords(Range $range = null, Order $order = null): array usort( $rows, static function (array $left, array $right) use ($order_field): int { - if (\in_array($order_field, ['name', 'login', 'type', 'title'], true)) { + if (\in_array($order_field, ['name', 'login', 'type', 'title', 'parent'], true)) { + if ($order_field === 'parent') { + $order_field .= '_sortable'; + } + return \ilStr::strCmp( - $left[$order_field], - $right[$order_field ] + $left[$order_field] ?? '', + $right[$order_field ] ?? '' ); } + if ($order_field === 'issued') { + $order_field .= '_sortable'; + return $left[$order_field] <=> $right[$order_field]; + } + return $left[$order_field] <=> $right[$order_field]; } ); @@ -262,7 +336,7 @@ private function getActions( URLBuilderToken $action_parameter_token, URLBuilderToken $row_id_token, ): array { - if ($this->award_badge) { + if ($this->award_badge instanceof ilBadge) { $f = $this->factory; return [ @@ -292,22 +366,11 @@ public function renderTable(): void $df = new \ILIAS\Data\Factory(); if ((int) $this->user->getTimeFormat() === ilCalendarSettings::TIME_FORMAT_12) { - $date_format = $df->dateFormat()->withTime12($this->user->getDateFormat()); + $this->date_format = $df->dateFormat()->withTime12($this->user->getDateFormat()); } else { - $date_format = $df->dateFormat()->withTime24($this->user->getDateFormat()); + $this->date_format = $df->dateFormat()->withTime24($this->user->getDateFormat()); } - $columns = [ - 'name' => $f->table()->column()->text($this->lng->txt('name')), - 'login' => $f->table()->column()->text($this->lng->txt('login')), - 'type' => $f->table()->column()->text($this->lng->txt('type')), - 'title' => $f->table()->column()->text($this->lng->txt('title')), - 'issued' => $f->table()->column()->date( - $this->lng->txt('badge_issued_on'), - $date_format - ) - ]; - $table_uri = $df->uri($request->getUri()->__toString()); $url_builder = new URLBuilder($table_uri); $query_params_namespace = ['tid']; @@ -319,26 +382,22 @@ public function renderTable(): void 'id', ); - $data_retrieval = $this->buildDataRetrievalObject( - $f, - $r, - $this->tree, - $this->user, - $this->parent_ref_id, - $this->restrict_badge_id, - $this->award_badge - ); - $actions = $this->getActions($url_builder, $action_parameter_token, $row_id_token); + $is_container_context = false; + if ($this->parent_ref_id) { + $parent_type = ilObject::_lookupType($this->parent_ref_id, true); + if (\in_array($parent_type, ['grp', 'crs'], true)) { + $is_container_context = $this->parent_obj_id === null && $this->award_badge === null; + } + } - if ($this->award_badge) { + if ($this->award_badge instanceof ilBadge) { $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 ($this->parent_obj_id) { + $title = ilObject::_lookupTitle($this->parent_obj_id); if (!$title) { - $title = ilObjectDataDeletionLog::get($parent_obj_id); + $title = ilObjectDataDeletionLog::get($this->parent_obj_id); if ($title) { $title = $title['title']; } @@ -354,6 +413,35 @@ public function renderTable(): void $title = $parent . $this->lng->txt('users'); } + $data_retrieval = $this->buildDataRetrievalObject( + $is_container_context, + $f, + $r, + $this->lng, + $this->tree, + $this->user, + $this->date_format, + $this->parent_ref_id, + $this->parent_obj_id, + $this->restrict_badge_id, + $this->award_badge + ); + + $columns = [ + 'name' => $f->table()->column()->text($this->lng->txt('name')), + 'login' => $f->table()->column()->text($this->lng->txt('login')), + 'type' => $f->table()->column()->text($this->lng->txt('type')), + 'title' => $f->table()->column()->text($this->lng->txt('title')), + // Cannot be a date column, because when awarding/revoking badges for uses, the list items may contain NULL values for `issued` + 'issued' => $f->table()->column()->text($this->lng->txt('badge_issued_on')) + ]; + + if ($is_container_context) { + $columns['parent'] = $f->table()->column()->text($this->lng->txt('object')); + } + + $actions = $this->getActions($url_builder, $action_parameter_token, $row_id_token); + $table = $f->table() ->data($title, $columns, $data_retrieval) ->withId(self::class . '_' . $this->parent_ref_id) diff --git a/components/ILIAS/Badge/classes/class.ilObjBadgeAdministrationGUI.php b/components/ILIAS/Badge/classes/class.ilObjBadgeAdministrationGUI.php index daa496be5159..a9cf96aec60b 100755 --- a/components/ILIAS/Badge/classes/class.ilObjBadgeAdministrationGUI.php +++ b/components/ILIAS/Badge/classes/class.ilObjBadgeAdministrationGUI.php @@ -63,22 +63,6 @@ public function __construct( $this->lng->loadLanguageModule('badge'); } - /** - * @return list - */ - private function getTemplateIdsFromUrl(): array - { - $tmpl_ids = []; - if ($this->http->wrapper()->query()->has('tid_id')) { - $tmpl_ids = $this->http->wrapper()->query()->retrieve( - 'tid_id', - $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()) - ); - } - - return $tmpl_ids; - } - public function executeCommand(): void { $next_class = $this->ctrl->getNextClass($this) ?? ''; @@ -105,12 +89,8 @@ public function executeCommand(): void $cmd = 'editSettings'; } - if ($this->http->wrapper()->query()->has('tid_id')) { - $id = $this->http->wrapper()->query()->retrieve( - 'tid_id', - $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()) - ); - $this->ctrl->setParameter($this, 'tid', array_pop($id)); + if ($this->badge_request->getBadgeIdFromUrl()) { + $this->ctrl->setParameter($this, 'tid', $this->badge_request->getBadgeIdFromUrl()); } $table_action = $this->http->wrapper()->query()->retrieve( @@ -286,8 +266,7 @@ protected function activateTypes(): void $lng = $this->lng; $this->assertActive(); - $tmpl_ids = $this->getTemplateIdsFromUrl(); - + $tmpl_ids = $this->badge_request->getMultiActionBadgeIdsFromUrl(); if ($this->checkPermissionBool('write') && count($tmpl_ids) > 0) { $handler = ilBadgeHandler::getInstance(); $change_state = []; @@ -313,7 +292,7 @@ protected function deactivateTypes(): void $lng = $this->lng; $this->assertActive(); - $tmpl_ids = $this->getTemplateIdsFromUrl(); + $tmpl_ids = $this->badge_request->getMultiActionBadgeIdsFromUrl(); if ($this->checkPermissionBool('write') && count($tmpl_ids) > 0) { $handler = ilBadgeHandler::getInstance(); $change_state = []; @@ -348,7 +327,6 @@ protected function deactivateTypes(): void protected function listImageTemplates(): void { - $ilAccess = $this->access; $lng = $this->lng; $ilToolbar = $this->toolbar; $ilCtrl = $this->ctrl; @@ -472,14 +450,16 @@ protected function editImageTemplate( $this->assertActive(); $this->tabs_gui->setTabActive('imgtmpl'); - $tmpl_ids = $this->getTemplateIdsFromUrl(); - if (count($tmpl_ids) === 1) { - $tmpl_ids = array_pop($tmpl_ids); + + $tmpl_ids = $this->badge_request->getMultiActionBadgeIdsFromUrl(); + if (count($tmpl_ids) !== 1) { + $this->ctrl->redirect($this, 'listImageTemplates'); } - $ilCtrl->setParameter($this, 'tid', $tmpl_ids); + $template_id = (int) array_pop($tmpl_ids); + $ilCtrl->setParameter($this, 'tid', $template_id); - $tmpl = new ilBadgeImageTemplate($tmpl_ids); + $tmpl = new ilBadgeImageTemplate($template_id); if (!$a_form) { $a_form = $this->initImageTemplateForm('edit'); @@ -633,13 +613,12 @@ protected function resetObjectFilter(): void protected function listObjectBadgeUsers(): void { $parent_obj_id = $this->badge_request->getParentId(); - $parent_ref_ids = ilObject::_getAllReferences($parent_obj_id); - $parent_ref_id = array_pop($parent_ref_ids); - - if ($this->http->wrapper()->query()->has('ref_id')) { - $parent_ref_id = $this->http->wrapper()->query()->retrieve('ref_id', $this->refinery->kindlyTo()->int()); + if (!$parent_obj_id && $this->badge_request->getBadgeIdFromUrl()) { + // In this case, we want't to list the users that have been awarded a specific badge + $badge = new ilBadge($this->badge_request->getBadgeIdFromUrl()); + $parent_obj_id = $badge->getParentId(); } - if (!$parent_ref_id) { + if (!$parent_obj_id) { $this->ctrl->redirect($this, 'listObjectBadges'); } @@ -653,7 +632,7 @@ protected function listObjectBadgeUsers(): void $this->ctrl->saveParameter($this, 'pid'); - $tbl = new ilBadgeUserTableGUI($parent_ref_id, null, $this->badge_request->getBadgeId()); + $tbl = new ilBadgeUserTableGUI(null, null, $parent_obj_id, $this->badge_request->getBadgeId()); $tbl->renderTable(); } @@ -669,9 +648,6 @@ protected function resetlistObjectBadgeUsers(): void protected function listObjectBadges(): void { - $ilAccess = $this->access; - $tpl = $this->tpl; - $this->assertActive(); $this->tabs_gui->setTabActive('obj_badges'); diff --git a/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php b/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php index 5bc68133f5af..a2d04f556953 100755 --- a/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php +++ b/components/ILIAS/Badge/classes/class.ilObjectBadgeTableGUI.php @@ -108,8 +108,7 @@ public function getRows( ): Generator { $records = $this->getRecords($range, $order); foreach ($records as $record) { - $row_id = (string) $record['id']; - yield $row_builder->buildDataRow($row_id, $record); + yield $row_builder->buildDataRow((string) $record['id'], $record); } }