From b6313d4514d778cb69252c03003874b5dcb46885 Mon Sep 17 00:00:00 2001 From: Aleksandr Litvin Date: Tue, 27 Oct 2026 08:49:25 +0100 Subject: [PATCH 1/7] refactor export members in course table to KS --- .../classes/Export/Table/DataRetrieval.php | 111 ++++++++++++++++++ .../classes/Export/Table/TableBuilder.php | 67 +++++++++++ .../Export/class.ilMemberExportGUI.php | 111 +++++++++++++++++- 3 files changed, 287 insertions(+), 2 deletions(-) create mode 100644 components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php create mode 100644 components/ILIAS/Membership/classes/Export/Table/TableBuilder.php diff --git a/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php b/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php new file mode 100644 index 000000000000..1a4845486806 --- /dev/null +++ b/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php @@ -0,0 +1,111 @@ +fss_export = $fss_export; + $this->lng = $lng; + } + + public function getRows( + DataRowBuilder $row_builder, + array $visible_column_ids, + Range $range, + Order $order, + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters + ): Generator { + $data = $this->getRawData(); + + $order_field = array_keys($order->get())[0] ?? TableBuilder::COL_DATE; + $order_direction = $order->get()[$order_field] ?? Order::DESC; + + uasort($data, function ($a, $b) use ($order_field) { + if ($order_field === TableBuilder::COL_SIZE || $order_field === TableBuilder::COL_DATE) { + return $a[$order_field] <=> $b[$order_field]; + } + return strnatcasecmp((string) $a[$order_field], (string) $b[$order_field]); + }); + + if ($order_direction === Order::DESC) { + $data = array_reverse($data, true); + } + + $data = array_slice($data, $range->getStart(), $range->getLength() ?? 50, true); + + foreach ($data as $id => $row) { + $row_copy = $row; + $row_copy[TableBuilder::COL_SIZE] = ilUtil::formatSize((int) $row[TableBuilder::COL_SIZE]); + $row_copy[TableBuilder::COL_DATE] = ilDatePresentation::formatDate( + new ilDateTime((int) $row[TableBuilder::COL_DATE], 3) + ); + + yield $row_builder->buildDataRow((string) $id, $row_copy); + } + } + + public function getTotalRowCount( + mixed $additional_viewcontrol_data, + mixed $filter_data, + mixed $additional_parameters + ): ?int { + return count($this->getRawData()); + } + + public function resolveIDs(array|string $ids): array + { + if ($ids === ['ALL_OBJECTS'] || $ids === 'ALL_OBJECTS') { + return $this->getAllIDs(); + } + if (is_array($ids)) { + return array_values(array_filter($ids, 'is_string')); + } + if (is_string($ids)) { + return [$ids]; + } + return []; + } + + public function getAllIDs(): array + { + return array_keys($this->getRawData()); + } + + protected function getRawData(): array + { + $data = []; + foreach ($this->fss_export->getMemberExportFiles() as $exp_file) { + $id = md5($exp_file['name']); + $data[$id] = [ + TableBuilder::COL_ID => $id, + TableBuilder::COL_NAME => $exp_file['name'], + TableBuilder::COL_TYPE => strtoupper((string) $exp_file["type"]), + TableBuilder::COL_DATE => $exp_file['timest'], + TableBuilder::COL_SIZE => $exp_file['size'] + ]; + } + return $data; + } +} diff --git a/components/ILIAS/Membership/classes/Export/Table/TableBuilder.php b/components/ILIAS/Membership/classes/Export/Table/TableBuilder.php new file mode 100644 index 000000000000..0f2a2f823ca7 --- /dev/null +++ b/components/ILIAS/Membership/classes/Export/Table/TableBuilder.php @@ -0,0 +1,67 @@ +ui_factory->table()->column()->text( + $this->lng->txt('type') + )->withIsSortable(true); + $columns[self::COL_SIZE] = $this->ui_factory->table()->column()->text( + $this->lng->txt('ps_size') + )->withIsSortable(true); + $columns[self::COL_DATE] = $this->ui_factory->table()->column()->text( + $this->lng->txt('date') + )->withIsSortable(true); + + $actions = []; + $actions[self::ACTION_DOWNLOAD] = $this->ui_factory->table()->action()->single( + $this->lng->txt('download'), + $url_builder->withParameter($action_token, self::ACTION_DOWNLOAD), + $id_token + ); + $actions[self::ACTION_DELETE] = $this->ui_factory->table()->action()->standard( + $this->lng->txt('delete'), + $url_builder->withParameter($action_token, self::ACTION_DELETE), + $id_token + ); + + return $this->ui_factory->table()->data( + $this->data_retrieval, + $this->lng->txt('ps_export_files'), + $columns + )->withActions($actions)->withRequest($this->http->request()); + } +} diff --git a/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php b/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php index f2cfa653b6a2..979a80342803 100755 --- a/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php +++ b/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php @@ -22,6 +22,13 @@ use ILIAS\Refinery\Factory; use ILIAS\User\Profile\Profile; use ILIAS\User\Context; +use ILIAS\UI\URLBuilder; +use ILIAS\UI\URLBuilderToken; +use ILIAS\Data\Factory as DataFactory; +use ILIAS\Membership\Export\Table\TableBuilder; +use ILIAS\Membership\Export\Table\DataRetrieval; +use ILIAS\UI\Renderer as UIRenderer; +use ILIAS\UI\Factory as UIFactory; /** * @author Stefan Meyer @@ -41,6 +48,9 @@ class ilMemberExportGUI protected ilLanguage $lng; protected ilToolbarGUI $toolbar; protected Profile $profile; + protected UIRenderer $ui_renderer; + protected UIFactory $ui_factory; + protected DataFactory $data_factory; protected ?ilMemberExport $export = null; protected ?ilExportFieldsInfo $fields_info = null; @@ -65,6 +75,9 @@ public function __construct(int $a_ref_id) $this->profile = $DIC['user']->getProfile(); $this->lng = $DIC->language(); $this->lng->loadLanguageModule('ps'); + $this->ui_factory = $DIC->ui()->factory(); + $this->ui_renderer = $DIC->ui()->renderer(); + $this->data_factory = new DataFactory(); $this->ref_id = $a_ref_id; $this->obj_id = ilObject::_lookupObjId($this->ref_id); $this->type = ilObject::_lookupType($this->obj_id); @@ -296,8 +309,70 @@ public function deliverData(): void */ public function showFileList(): void { - $tbl = new ilMemberExportFileTableGUI($this, 'show', $this->fss_export); - $this->tpl->setContent($tbl->getHTML()); + $table = new TableBuilder( + new DataRetrieval($this->fss_export, $this->lng), + $this->lng, + $this->ui_factory, + $this->http + ); + + $this->tpl->setContent( + $this->ui_renderer->render( + $table->get(...$this->getTableActionURLBuilder()) + ) + ); + } + + /** + * @return array{0: URLBuilder, 1: URLBuilderToken, 2: URLBuilderToken} + */ + protected function getTableActionURLBuilder(): array + { + $link = ILIAS_HTTP_PATH . '/' . $this->ctrl->getLinkTarget( + $this, + 'handleTableAction' + ); + $url_builder = new URLBuilder($this->data_factory->uri($link)); + return $url_builder->acquireParameters(['mem_exp_tbl'], 'table_ids', 'table_action'); + } + + protected function handleTableAction(): void + { + list($url_builder, $id_token, $action_token) = $this->getTableActionURLBuilder(); + + if (!$this->http->wrapper()->query()->has($action_token->getName())) { + return; + } + if (!$this->http->wrapper()->query()->has($id_token->getName())) { + return; + } + + $action = $this->http->wrapper()->query()->retrieve( + $action_token->getName(), + $this->refinery->kindlyTo()->string() + ); + + $data_retrieval = new DataRetrieval($this->fss_export, $this->lng); + + $ids = $this->http->wrapper()->query()->retrieve( + $id_token->getName(), + $this->refinery->byTrying([ + $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()), + $this->refinery->kindlyTo()->string() + ]) + ); + + $ids = $data_retrieval->resolveIDs($ids); + + switch ($action) { + case TableBuilder::ACTION_DOWNLOAD: + $this->downloadExportFile(); + break; + + case TableBuilder::ACTION_DELETE: + $this->confirmDeleteExportFile(); + break; + } } /** @@ -313,6 +388,22 @@ public function downloadExportFile(): void ); } + if ($fl === '') { + list($url_builder, $id_token, $action_token) = $this->getTableActionURLBuilder(); + if ($this->http->wrapper()->query()->has($id_token->getName())) { + $ids = $this->http->wrapper()->query()->retrieve( + $id_token->getName(), + $this->refinery->byTrying([ + $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()), + $this->refinery->kindlyTo()->string() + ]) + ); + $data_retrieval = new DataRetrieval($this->fss_export, $this->lng); + $ids = $data_retrieval->resolveIDs($ids); + $fl = $ids[0] ?? ''; + } + } + $hash = trim($fl); if (!$hash) { $this->ctrl->redirect($this, 'show'); @@ -377,6 +468,22 @@ protected function initFileIdsFromPost(): array ) ); } + + if (!count($ids)) { + list($url_builder, $id_token, $action_token) = $this->getTableActionURLBuilder(); + if ($this->http->wrapper()->query()->has($id_token->getName())) { + $ids = $this->http->wrapper()->query()->retrieve( + $id_token->getName(), + $this->refinery->byTrying([ + $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()), + $this->refinery->kindlyTo()->string() + ]) + ); + $data_retrieval = new DataRetrieval($this->fss_export, $this->lng); + $ids = $data_retrieval->resolveIDs($ids); + } + } + return $ids; } From 89382fa07883970d70d1869599b19658284b883d Mon Sep 17 00:00:00 2001 From: Aleksandr Litvin Date: Mon, 2 Nov 2026 09:03:37 +0100 Subject: [PATCH 2/7] fix member export table for Study Programme --- .../class.ilPRGMembersExportGUI.php | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php b/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php index eceff51901b8..b7f97b7d074b 100755 --- a/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php +++ b/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php @@ -19,6 +19,8 @@ declare(strict_types=1); use ILIAS\Data\Factory as DataFactory; +use ILIAS\Membership\Export\Table\DataRetrieval; +use ILIAS\Membership\Export\Table\TableBuilder; /** * export assignments of PRG @@ -174,7 +176,7 @@ public function deleteExportFile(): void } foreach ($this->fss_export->getMemberExportFiles() as $file) { - if (!in_array(md5($file['name']), $_POST['id'])) { + if (!in_array(md5($file['name']), $file_ids)) { continue; } $this->fss_export->deleteMemberExportFile($file['name']); @@ -194,6 +196,22 @@ public function downloadExportFile(): void ); } + if ($fl === '') { + list($url_builder, $id_token, $action_token) = $this->getTableActionURLBuilder(); + if ($this->http->wrapper()->query()->has($id_token->getName())) { + $ids = $this->http->wrapper()->query()->retrieve( + $id_token->getName(), + $this->refinery->byTrying([ + $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()), + $this->refinery->kindlyTo()->string() + ]) + ); + $data_retrieval = new DataRetrieval($this->fss_export, $this->lng); + $ids = $data_retrieval->resolveIDs($ids); + $fl = $ids[0] ?? ''; + } + } + $hash = trim($fl); if (!$hash) { $this->ctrl->redirect($this, 'show'); @@ -203,7 +221,7 @@ public function downloadExportFile(): void if (md5($file['name']) == $hash) { $contents = $this->fss_export->getMemberExportFile($file['name']); $fts = $file['timest']; - $dat = date('Y_m_d_H-i', (int)$fts); + $dat = date('Y_m_d_H-i', (int) $fts); $down_name = str_replace($fts, $dat, $file['name']); $mime = 'text/csv'; From 576b4d912b0b7922e0e7b83e662226b5aa4aea89 Mon Sep 17 00:00:00 2001 From: Aleksandr Litvin Date: Tue, 3 Nov 2026 17:56:11 +0100 Subject: [PATCH 3/7] adjust export table refactoring --- .../classes/Export/Table/DataRetrieval.php | 21 ++--- .../Export/class.ilMemberExportGUI.php | 81 +++++-------------- .../class.ilPRGMembersExportGUI.php | 32 ++------ 3 files changed, 33 insertions(+), 101 deletions(-) diff --git a/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php b/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php index 1a4845486806..8ddf2ffb9e38 100644 --- a/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php +++ b/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php @@ -20,6 +20,8 @@ class DataRetrieval implements DataRetrievalInterface protected ilFileSystemAbstractionStorage $fss_export; protected ilLanguage $lng; + protected ?array $raw_data = null; + public function __construct( ilFileSystemAbstractionStorage $fss_export, ilLanguage $lng @@ -74,20 +76,6 @@ public function getTotalRowCount( return count($this->getRawData()); } - public function resolveIDs(array|string $ids): array - { - if ($ids === ['ALL_OBJECTS'] || $ids === 'ALL_OBJECTS') { - return $this->getAllIDs(); - } - if (is_array($ids)) { - return array_values(array_filter($ids, 'is_string')); - } - if (is_string($ids)) { - return [$ids]; - } - return []; - } - public function getAllIDs(): array { return array_keys($this->getRawData()); @@ -95,6 +83,9 @@ public function getAllIDs(): array protected function getRawData(): array { + if ($this->raw_data !== null) { + return $this->raw_data; + } $data = []; foreach ($this->fss_export->getMemberExportFiles() as $exp_file) { $id = md5($exp_file['name']); @@ -106,6 +97,6 @@ protected function getRawData(): array TableBuilder::COL_SIZE => $exp_file['size'] ]; } - return $data; + return $this->raw_data = $data; } } diff --git a/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php b/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php index 979a80342803..1113352aab21 100755 --- a/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php +++ b/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php @@ -343,69 +343,45 @@ protected function handleTableAction(): void if (!$this->http->wrapper()->query()->has($action_token->getName())) { return; } - if (!$this->http->wrapper()->query()->has($id_token->getName())) { - return; - } $action = $this->http->wrapper()->query()->retrieve( $action_token->getName(), $this->refinery->kindlyTo()->string() ); - $data_retrieval = new DataRetrieval($this->fss_export, $this->lng); - - $ids = $this->http->wrapper()->query()->retrieve( - $id_token->getName(), - $this->refinery->byTrying([ - $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()), - $this->refinery->kindlyTo()->string() - ]) - ); + $ids = []; + if ($this->http->wrapper()->query()->has($id_token->getName())) { + $ids = $this->http->wrapper()->query()->retrieve( + $id_token->getName(), + $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()) + ); - $ids = $data_retrieval->resolveIDs($ids); + if ($ids === ['ALL_OBJECTS']) { + $data_retrieval = new DataRetrieval($this->fss_export, $this->lng); + $ids = $data_retrieval->getAllIDs(); + } + } switch ($action) { case TableBuilder::ACTION_DOWNLOAD: - $this->downloadExportFile(); + $this->downloadExportFile($ids); break; case TableBuilder::ACTION_DELETE: - $this->confirmDeleteExportFile(); + $this->confirmDeleteExportFile($ids); break; } } /** * Download export file + * @param string[] $ids */ - public function downloadExportFile(): void + public function downloadExportFile(array $ids): void { - $fl = ''; - if ($this->http->wrapper()->query()->has('fl')) { - $fl = $this->http->wrapper()->query()->retrieve( - 'fl', - $this->refinery->kindlyTo()->string() - ); - } - - if ($fl === '') { - list($url_builder, $id_token, $action_token) = $this->getTableActionURLBuilder(); - if ($this->http->wrapper()->query()->has($id_token->getName())) { - $ids = $this->http->wrapper()->query()->retrieve( - $id_token->getName(), - $this->refinery->byTrying([ - $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()), - $this->refinery->kindlyTo()->string() - ]) - ); - $data_retrieval = new DataRetrieval($this->fss_export, $this->lng); - $ids = $data_retrieval->resolveIDs($ids); - $fl = $ids[0] ?? ''; - } - } - - $hash = trim($fl); + $hash = $ids[0] ?? ''; if (!$hash) { + $this->tpl->setOnScreenMessage('failure', $this->lng->txt('ps_select_one'), true); $this->ctrl->redirect($this, 'show'); } @@ -469,31 +445,16 @@ protected function initFileIdsFromPost(): array ); } - if (!count($ids)) { - list($url_builder, $id_token, $action_token) = $this->getTableActionURLBuilder(); - if ($this->http->wrapper()->query()->has($id_token->getName())) { - $ids = $this->http->wrapper()->query()->retrieve( - $id_token->getName(), - $this->refinery->byTrying([ - $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()), - $this->refinery->kindlyTo()->string() - ]) - ); - $data_retrieval = new DataRetrieval($this->fss_export, $this->lng); - $ids = $data_retrieval->resolveIDs($ids); - } - } - return $ids; } /** * Confirm deletion of export files + * @param string[] $ids */ - public function confirmDeleteExportFile(): void + public function confirmDeleteExportFile(array $ids): void { - $file_ids = $this->initFileIdsFromPost(); - if (!count($file_ids)) { + if (!count($ids)) { $this->tpl->setOnScreenMessage('failure', $this->lng->txt('ps_select_one'), true); $this->ctrl->redirect($this, 'show'); } @@ -503,7 +464,7 @@ public function confirmDeleteExportFile(): void $confirmation_gui->setCancel($this->lng->txt('cancel'), 'show'); $confirmation_gui->setConfirm($this->lng->txt('delete'), 'deleteExportFile'); foreach ($this->fss_export->getMemberExportFiles() as $file) { - if (!in_array(md5($file['name']), $file_ids)) { + if (!in_array(md5($file['name']), $ids)) { continue; } $confirmation_gui->addItem( diff --git a/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php b/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php index b7f97b7d074b..a16081aeb4fa 100755 --- a/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php +++ b/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php @@ -186,34 +186,14 @@ public function deleteExportFile(): void $this->ctrl->redirect($this, 'show'); } - public function downloadExportFile(): void + /** + * @param string[] $ids + */ + public function downloadExportFile(array $ids): void { - $fl = ''; - if ($this->http->wrapper()->query()->has('fl')) { - $fl = $this->http->wrapper()->query()->retrieve( - 'fl', - $this->refinery->kindlyTo()->string() - ); - } - - if ($fl === '') { - list($url_builder, $id_token, $action_token) = $this->getTableActionURLBuilder(); - if ($this->http->wrapper()->query()->has($id_token->getName())) { - $ids = $this->http->wrapper()->query()->retrieve( - $id_token->getName(), - $this->refinery->byTrying([ - $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()), - $this->refinery->kindlyTo()->string() - ]) - ); - $data_retrieval = new DataRetrieval($this->fss_export, $this->lng); - $ids = $data_retrieval->resolveIDs($ids); - $fl = $ids[0] ?? ''; - } - } - - $hash = trim($fl); + $hash = $ids[0] ?? ''; if (!$hash) { + $this->tpl->setOnScreenMessage('failure', $this->lng->txt('ps_select_one'), true); $this->ctrl->redirect($this, 'show'); } From dc86c567e4fcf6585c34a7b6f336e710ef1cf3eb Mon Sep 17 00:00:00 2001 From: Aleksandr Litvin Date: Tue, 3 Nov 2026 18:09:19 +0100 Subject: [PATCH 4/7] remove no longer used files --- .../class.ilMemberExportFileTableGUI.php | 91 ------------------- .../default/tpl.mem_export_file_row.html | 17 ---- 2 files changed, 108 deletions(-) delete mode 100755 components/ILIAS/Membership/classes/Export/class.ilMemberExportFileTableGUI.php delete mode 100755 components/ILIAS/Membership/templates/default/tpl.mem_export_file_row.html diff --git a/components/ILIAS/Membership/classes/Export/class.ilMemberExportFileTableGUI.php b/components/ILIAS/Membership/classes/Export/class.ilMemberExportFileTableGUI.php deleted file mode 100755 index 9320d9125cc9..000000000000 --- a/components/ILIAS/Membership/classes/Export/class.ilMemberExportFileTableGUI.php +++ /dev/null @@ -1,91 +0,0 @@ - - */ -class ilMemberExportFileTableGUI extends ilTable2GUI -{ - public function __construct(object $a_parent_obj, string $a_parent_cmd, ilFileSystemAbstractionStorage $a_fss_export) - { - $this->setId('memexp'); - parent::__construct($a_parent_obj, $a_parent_cmd); - - $this->setTitle($this->lng->txt('ps_export_files')); - $this->addColumn('', '', '1'); - $this->addColumn($this->lng->txt('type'), 'type'); - $this->addColumn($this->lng->txt('ps_size'), 'size'); - $this->addColumn($this->lng->txt('date'), 'date'); - $this->addColumn($this->lng->txt('action'), ''); - - $this->setDefaultOrderField('date'); - $this->setDefaultOrderDirection('desc'); - - $this->setRowTemplate('tpl.mem_export_file_row.html', 'components/ILIAS/Membership'); - $this->setFormAction($this->ctrl->getFormAction($this->getParentObject(), $this->getParentCmd())); - $this->addMultiCommand('confirmDeleteExportFile', $this->lng->txt('delete')); - $this->setSelectAllCheckbox('id[]'); - $this->getFiles($a_fss_export); - } - - public function numericOrdering(string $a_field): bool - { - return in_array($a_field, array('size', 'date')); - } - - protected function getFiles(ilFileSystemAbstractionStorage $a_fss_export): void - { - $data = []; - foreach ($a_fss_export->getMemberExportFiles() as $exp_file) { - $data[] = [ - 'id' => md5($exp_file['name']), - 'type' => strtoupper($exp_file["type"]), - 'date' => $exp_file['timest'], - 'size' => $exp_file['size'] - ]; - } - - $this->setData($data); - } - - protected function fillRow(array $a_set): void - { - global $DIC; - - $ilCtrl = $DIC['ilCtrl']; - - $this->tpl->setVariable('VAL_ID', $a_set['id']); - $this->tpl->setVariable('VAL_TYPE', $a_set['type']); - $this->tpl->setVariable('VAL_SIZE', ilUtil::formatSize($a_set['size'])); - $this->tpl->setVariable( - 'VAL_DATE', - ilDatePresentation::formatDate(new ilDateTime($a_set['date'], IL_CAL_UNIX)) - ); - - $ilCtrl->setParameter($this->getParentObject(), 'fl', $a_set['id']); - $url = $ilCtrl->getLinkTarget($this->getParentObject(), 'downloadExportFile'); - $ilCtrl->setParameter($this->getParentObject(), 'fl', ''); - - $this->tpl->setVariable('URL_DOWNLOAD', $url); - $this->tpl->setVariable('TXT_DOWNLOAD', $this->lng->txt('download')); - } -} diff --git a/components/ILIAS/Membership/templates/default/tpl.mem_export_file_row.html b/components/ILIAS/Membership/templates/default/tpl.mem_export_file_row.html deleted file mode 100755 index 21ef2d5e5968..000000000000 --- a/components/ILIAS/Membership/templates/default/tpl.mem_export_file_row.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - {VAL_TYPE} - - - {VAL_SIZE} - - - {VAL_DATE} - - - {TXT_DOWNLOAD} - - From d0dbc46f71841d9e8206261ac1ac046cfff88ee8 Mon Sep 17 00:00:00 2001 From: Aleksandr Litvin Date: Tue, 3 Nov 2026 18:21:30 +0100 Subject: [PATCH 5/7] adjust copyright signature --- .../classes/Export/Table/DataRetrieval.php | 16 ++++++++++++++++ .../classes/Export/Table/TableBuilder.php | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php b/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php index 8ddf2ffb9e38..da0081014981 100644 --- a/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php +++ b/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php @@ -1,5 +1,21 @@ Date: Thu, 5 Nov 2026 15:37:45 +0100 Subject: [PATCH 6/7] adjust date column in export file table --- .../classes/Export/Table/DataRetrieval.php | 5 ++--- .../classes/Export/Table/TableBuilder.php | 19 ++++++++++++++++--- .../Export/class.ilMemberExportGUI.php | 8 ++++++-- .../class.ilPRGMembersExportGUI.php | 2 -- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php b/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php index da0081014981..18e6df975276 100644 --- a/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php +++ b/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php @@ -30,6 +30,7 @@ use ilUtil; use ilDatePresentation; use ilDateTime; +use DateTimeImmutable; class DataRetrieval implements DataRetrievalInterface { @@ -76,9 +77,7 @@ public function getRows( foreach ($data as $id => $row) { $row_copy = $row; $row_copy[TableBuilder::COL_SIZE] = ilUtil::formatSize((int) $row[TableBuilder::COL_SIZE]); - $row_copy[TableBuilder::COL_DATE] = ilDatePresentation::formatDate( - new ilDateTime((int) $row[TableBuilder::COL_DATE], 3) - ); + $row_copy[TableBuilder::COL_DATE] = new DateTimeImmutable('@' . $row[TableBuilder::COL_DATE]); yield $row_builder->buildDataRow((string) $id, $row_copy); } diff --git a/components/ILIAS/Membership/classes/Export/Table/TableBuilder.php b/components/ILIAS/Membership/classes/Export/Table/TableBuilder.php index ef5685c4517f..ff41b34c6bbb 100644 --- a/components/ILIAS/Membership/classes/Export/Table/TableBuilder.php +++ b/components/ILIAS/Membership/classes/Export/Table/TableBuilder.php @@ -26,6 +26,9 @@ use ILIAS\HTTP\Services as HTTP; use ILIAS\UI\URLBuilder; use ILIAS\UI\URLBuilderToken; +use ilObjUser; +use ILIAS\Data\Factory as DataFactory; +use ilCalendarSettings; class TableBuilder { @@ -42,7 +45,9 @@ public function __construct( protected DataRetrieval $data_retrieval, protected ilLanguage $lng, protected UIFactory $ui_factory, - protected HTTP $http + protected HTTP $http, + protected ilObjUser $user, + protected DataFactory $data_factory ) { } @@ -51,6 +56,13 @@ public function get( URLBuilderToken $id_token, URLBuilderToken $action_token ): DataTable { + $date_format = $this->user->getDateFormat(); + if ($this->user->getTimeFormat() == ilCalendarSettings::TIME_FORMAT_24) { + $date_format = $this->data_factory->dateFormat()->withTime24($date_format); + } else { + $date_format = $this->data_factory->dateFormat()->withTime12($date_format); + } + $columns = []; $columns[self::COL_TYPE] = $this->ui_factory->table()->column()->text( $this->lng->txt('type') @@ -58,8 +70,9 @@ public function get( $columns[self::COL_SIZE] = $this->ui_factory->table()->column()->text( $this->lng->txt('ps_size') )->withIsSortable(true); - $columns[self::COL_DATE] = $this->ui_factory->table()->column()->text( - $this->lng->txt('date') + $columns[self::COL_DATE] = $this->ui_factory->table()->column()->date( + $this->lng->txt('date'), + $date_format )->withIsSortable(true); $actions = []; diff --git a/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php b/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php index 1113352aab21..4f095bc81ff0 100755 --- a/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php +++ b/components/ILIAS/Membership/classes/Export/class.ilMemberExportGUI.php @@ -47,6 +47,7 @@ class ilMemberExportGUI protected ilGlobalTemplateInterface $tpl; protected ilLanguage $lng; protected ilToolbarGUI $toolbar; + protected ilObjUser $user; protected Profile $profile; protected UIRenderer $ui_renderer; protected UIFactory $ui_factory; @@ -72,6 +73,7 @@ public function __construct(int $a_ref_id) $this->ctrl = $DIC->ctrl(); $this->tpl = $DIC->ui()->mainTemplate(); $this->toolbar = $DIC->toolbar(); + $this->user = $DIC->user(); $this->profile = $DIC['user']->getProfile(); $this->lng = $DIC->language(); $this->lng->loadLanguageModule('ps'); @@ -187,7 +189,7 @@ protected function initSettingsForm(bool $a_is_excel = false): ilPropertyFormGUI } // consultation hours - if (ilBookingEntry::hasObjectBookingEntries($this->obj_id, $GLOBALS['DIC']['ilUser']->getId())) { + if (ilBookingEntry::hasObjectBookingEntries($this->obj_id, $this->user->getId())) { $this->lng->loadLanguageModule('dateplaner'); $chours = new ilCheckboxInputGUI($this->lng->txt('cal_ch_field_ch'), 'export_members[]'); $chours->setValue('consultation_hour'); @@ -313,7 +315,9 @@ public function showFileList(): void new DataRetrieval($this->fss_export, $this->lng), $this->lng, $this->ui_factory, - $this->http + $this->http, + $this->user, + $this->data_factory ); $this->tpl->setContent( diff --git a/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php b/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php index a16081aeb4fa..592694b4bfbf 100755 --- a/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php +++ b/components/ILIAS/StudyProgramme/classes/memberexport/class.ilPRGMembersExportGUI.php @@ -19,8 +19,6 @@ declare(strict_types=1); use ILIAS\Data\Factory as DataFactory; -use ILIAS\Membership\Export\Table\DataRetrieval; -use ILIAS\Membership\Export\Table\TableBuilder; /** * export assignments of PRG From 72be50daebc1d3543d08470f7e85cddf38fd6379 Mon Sep 17 00:00:00 2001 From: Aleksandr Litvin Date: Fri, 6 Nov 2026 11:59:55 +0100 Subject: [PATCH 7/7] remove unnecessary use statements in DataRetrieval --- .../ILIAS/Membership/classes/Export/Table/DataRetrieval.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php b/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php index 18e6df975276..9de0f1a44560 100644 --- a/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php +++ b/components/ILIAS/Membership/classes/Export/Table/DataRetrieval.php @@ -28,8 +28,6 @@ use ilFileSystemAbstractionStorage; use ilLanguage; use ilUtil; -use ilDatePresentation; -use ilDateTime; use DateTimeImmutable; class DataRetrieval implements DataRetrievalInterface