From ae79ba3e259cee22d239e68048501e13e87c5f86 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 20 Apr 2021 14:24:29 +0000 Subject: [PATCH] Bug 28177: Add date column and column configuration to uploads This patch adds a "Date added" column to the table showing uploaded files. Column configuration is added to the table, and the date column is hidden by default. To test, apply the patch and restart all. - Go to Tools -> Upload. - If necessary, upload multiple files with the same category. - Use the "Search uploads by category" form to find those uploads. - In the table of uploads, confirm that table settings and other DataTable controls work correctly, including the option to show the "Date added" column. - Go to Administration -> Table settings -> Tools -> upload. - Change the settings for the uploads table. - Return to Uploads and confirm that your changes are reflected in the display of the uploads table. Signed-off-by: Salman Ali Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- admin/columns_settings.yml | 22 +++++++++++++++++++ .../prog/en/modules/tools/upload.tt | 8 ++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index b6eee4fb28..9bd8810432 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -1594,6 +1594,28 @@ modules: cannot_be_toggled: 1 cannot_be_modified: 1 + upload: + uploadresults: + columns: + - + columnname: filename + - + columnname: size + - + columnname: hashvalue + - + columnname: date + is_hidden: 1 + - + columnname: category + - + columnname: public + - + columnname: temporary + - + columnname: actions + cannot_be_toggled: 1 + cannot_be_modified: 1 pos: pay: invoices: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt index 03f1f567a9..b2ea09ca2f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt @@ -1,6 +1,7 @@ [% USE raw %] [% USE Asset %] [% USE Koha %] +[% USE KohaDates %] [% USE TablesSettings %] [% USE AuthorisedValues %] [% SET footerjs = 1 %] @@ -202,6 +203,7 @@ Filename Size Hashvalue + Date added Category [% IF !plugin %]Public[% END %] [% IF !plugin %]Temporary[% END %] @@ -214,6 +216,7 @@ [% record.filename | html %] [% record.filesize | html %] [% record.hashvalue | html %] + [% record.dtcreated | $KohaDates %] [% AuthorisedValues.GetByCode( 'UPLOAD', record.uploadcategorycode ) | html %] @@ -456,8 +459,11 @@ [% END %] window.close(); } + var columns_settings = [% TablesSettings.GetColumns( 'tools', 'upload', 'uploadresults', 'json' ) | $raw %]; $(document).ready(function() { - KohaTable("uploadresults",{}); + KohaTable("uploadresults",{ + }, columns_settings); + [% IF msg %] ShowAlerts( [% msg | html %] ); [% END %] -- 2.39.5