Bug 17465: NumSavedReports syspref
authorAleisha Amohia <aleishaamohia@hotmail.com>
Wed, 5 Apr 2017 04:41:03 +0000 (04:41 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 9 May 2017 21:17:53 +0000 (21:17 +0000)
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 <veron@veron.ch>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

installer/data/mysql/atomicupdate/bug_17465_-_add_NumSavedReports_syspref.sql [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt

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 (file)
index 0000000..229afb5
--- /dev/null
@@ -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');
index 65c2f14..ab6d065 100644 (file)
@@ -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'),
index 7ec9f60..4ca398d 100644 (file)
@@ -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.
index 1c02b1c..8d86efd 100644 (file)
@@ -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" ]],