From a63dcc379228a2ed30ccf98fe04a2b1f57bab135 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 https://bugs.koha-community.org/show_bug.cgi?id=21877 --- 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 a4986652b6..fbd949de74 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -1582,6 +1582,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 c907fdf007..be83a3d754 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 %] @@ -197,6 +198,7 @@ Filename Size Hashvalue + Date added Category [% IF !plugin %]Public[% END %] [% IF !plugin %]Temporary[% END %] @@ -209,6 +211,7 @@ [% record.filename | html %] [% record.filesize | html %] [% record.hashvalue | html %] + [% record.dtcreated | $KohaDates %] [% AuthorisedValues.GetByCode( 'UPLOAD', record.uploadcategorycode ) | html %] @@ -451,8 +454,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.25.1