From 23a2cd5214f8c5f234cd80783c3021281e5a6846 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Followed test plan, works as expected. Signed-off-by: Marc VĂ©ron Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall --- .../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 0000000000..229afb5ebe --- /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 65c2f14023..ab6d065b39 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -287,6 +287,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 7ec9f60ad5..4ca398d12d 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 @@ -32,3 +32,9 @@ Tools: - pref: UploadPurgeTemporaryFilesDays class: integer - "days in cleanup_database cron job. NOTE: If you leave this field empty, the cron job will not delete any files. On the other hand a value of 0 means: delete all temporary files." + 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 1c02b1c834..8d86efd9ba 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.11.4.GIT