From effa48057329f4804d315d53ce4bbe3d02d04fb8 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 --- .../bug_2093_-_add_OPACUserSummary_syspref.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/opac.pref | 6 +++++ .../opac-tmpl/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 0000000..bd8bba3 --- /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 ef52c81..eb439d3 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -386,6 +386,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACUserCSS','',NULL,'Add CSS to be included in the OPAC in an embedded