From 652edb08e2b9b9f62d6bd939754264bb649b33ec Mon Sep 17 00:00:00 2001
From: Jasmine Amohia
Date: Wed, 16 Jan 2019 03:57:45 +0000
Subject: [PATCH] Bug 22145: Created syspref to hide/show 'rows per page' from
reports print layout
Test Plan:
1. Update the database
2. Find reportRowsPerPage syspref and confirm it is set to Show by default
3. In another tab, make a new report to run or run an existing report
4. Confirm that rows per page dropdown shows
5. Change syspref to Don't show
6. Refresh report tab and confirm that rows per page dropdown doesn't
show.
---
.../bug_20679_-_add_reportRowsPerPage_syspref.sql | 1 +
installer/data/mysql/sysprefs.sql | 1 +
.../en/modules/admin/preferences/web_services.pref | 6 ++++++
.../en/modules/reports/guided_reports_start.tt | 25 ++++++++++++----------
4 files changed, 22 insertions(+), 11 deletions(-)
create mode 100644 installer/data/mysql/atomicupdate/bug_20679_-_add_reportRowsPerPage_syspref.sql
diff --git a/installer/data/mysql/atomicupdate/bug_20679_-_add_reportRowsPerPage_syspref.sql b/installer/data/mysql/atomicupdate/bug_20679_-_add_reportRowsPerPage_syspref.sql
new file mode 100644
index 0000000000..7eff05fa93
--- /dev/null
+++ b/installer/data/mysql/atomicupdate/bug_20679_-_add_reportRowsPerPage_syspref.sql
@@ -0,0 +1 @@
+INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('reportRowsPerPage', '1', NULL, 'Show/hide the rows per page dropdown when running a report', 'YesNo');
diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index 6298acd4e9..0165b4c2e9 100644
--- a/installer/data/mysql/sysprefs.sql
+++ b/installer/data/mysql/sysprefs.sql
@@ -480,6 +480,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'),
('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'),
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
+('reportRowsPerPage', '1', NULL, 'Show/hide the rows per page dropdown when running a report', 'YesNo');
('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'),
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref
index 6b415f212c..0bbafdd82e 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref
@@ -65,6 +65,12 @@ Web services:
- pref: SvcMaxReportRows
class: integer
- rows of a report requested via the reports web service.
+ -
+ - pref: reportRowsPerPage
+ choices:
+ yes: Show
+ no: "Don't show"
+ - rows per page option when running a report.
IdRef:
-
- pref: IdRef
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 18410c2be1..91040f8ecc 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
@@ -714,17 +714,20 @@ canned reports and writing custom SQL reports.
[% END %]
-
-
+ [% IF ( Koha.Preference('reportRowsPerPage') ) %]
+
+
+ [% END %]
+