From 657c417a87f356479c82b11a602006f4f9ab375c Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 26 Apr 2017 05:18:13 +0000 Subject: [PATCH] Bug 2093: Add OPAC Summary for logged-in users This patch adds a summary to the OPAC once the user has logged in that shows the users number of checkouts, overdues, holds pending, holds waiting and total fines. We also have a syspref OPACUserSummary to turn this feature on and off. Default is ON. To test: 1) Apply patch and update database 2) Set up some checkouts, overdues, holds pending AND waiting and fines for a user 3) Log into OPAC as that user, see summary. Confirm links all work as expected 4) Confirm that if there are no checkouts / overdues etc that the link disappears from the summary 5) Turn OPACUserSummary OFF and confirm the summary does not show on the mainpage. Sponsored-by: Catalyst IT Signed-off-by: Hugo Agud Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- ...bug_2093_-_add_OPACUserSummary_syspref.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../en/modules/admin/preferences/opac.pref | 6 +++++ .../bootstrap/en/modules/opac-main.tt | 26 ++++++++++++++++++- opac/opac-main.pl | 21 +++++++++++++++ 5 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_2093_-_add_OPACUserSummary_syspref.sql diff --git a/installer/data/mysql/atomicupdate/bug_2093_-_add_OPACUserSummary_syspref.sql b/installer/data/mysql/atomicupdate/bug_2093_-_add_OPACUserSummary_syspref.sql new file mode 100644 index 0000000000..bd8bba3913 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_2093_-_add_OPACUserSummary_syspref.sql @@ -0,0 +1 @@ +INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`) VALUES ('OPACUserSummary', 1, NULL, "Show the summary of a logged in user's checkouts, overdues, holds and fines on the mainpage", 'YesNo'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 91c125edaa..dba207cc06 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -395,6 +395,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACUserCSS','',NULL,'Add CSS to be included in the OPAC in an embedded