From 73c63168c1fe6ce8698f5daef32de009242f8c66 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 5 Apr 2017 04:41:03 +0000 Subject: [PATCH] Bug 17465: NumSavedReports syspref To test: 1) Apply patch and update database 2) Go to system preferences. Default value should be 20 reports. 3) Go to Reports -> Use saved. Confirm 20 results are showing 4) Change value in syspref to any integer (i.e. 50) 5) Go back to Reports -> Use saved. Confirm the number of results shown is based on the value in the syspref. Sponsored-by: Catalyst IT --- .../mysql/atomicupdate/bug_17465_-_add_NumSavedReports_syspref.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/prog/en/modules/admin/preferences/tools.pref | 6 ++++++ .../intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt | 2 ++ 4 files changed, 10 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_17465_-_add_NumSavedReports_syspref.sql diff --git a/installer/data/mysql/atomicupdate/bug_17465_-_add_NumSavedReports_syspref.sql b/installer/data/mysql/atomicupdate/bug_17465_-_add_NumSavedReports_syspref.sql new file mode 100644 index 0000000..229afb5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_17465_-_add_NumSavedReports_syspref.sql @@ -0,0 +1 @@ +INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('NumSavedReports', '20', NULL, 'By default, show this number of saved reports.', 'Integer'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 7e249b7..9e36813 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -283,6 +283,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('NovelistSelectStaffView','tab','tab|above|below','Where to display Novelist Select content in the staff client','Choice'), ('NovelistSelectView','tab','tab|above|below|right','Where to display Novelist Select content','Choice'), ('numReturnedItemsToShow','20',NULL,'Number of returned items to show on the check-in page','Integer'), +('NumSavedReports', '20', NULL, 'By default, show this number of saved reports.', 'Integer'), ('numSearchResults','20',NULL,'Specify the maximum number of results to display on a page of results','Integer'), ('numSearchRSSResults','50',NULL,'Specify the maximum number of results to display on a RSS page of results','Integer'), ('OAI-PMH','0',NULL,'if ON, OAI-PMH server is enabled','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref index a2a381d..345fbbc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref @@ -26,3 +26,9 @@ Tools: staff: "Staff client only" both: "Both OPAC and staff client" - + Reports: + - + - By default, show + - pref: NumSavedReports + class: integer + - reports on the Saved Reports page. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 1c02b1c..8d86efd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -1,4 +1,5 @@ [% USE KohaDates %] +[% USE Koha %] [%- BLOCK area_name -%] [%- SWITCH area -%] @@ -86,6 +87,7 @@ $("#delColumn").on("click",function(){ [% IF (saved1) %] var rtable = $("#table_reports").dataTable($.extend(true, {}, dataTablesDefaults, { + 'iDisplayLength': [% Koha.Preference('NumSavedReports') %], 'bAutoWidth': false, 'sPaginationType': 'four_button', 'aaSorting': [[ 1, "asc" ]], -- 2.1.4