Bug 31051: Add OPACShowSavings system preference
authorAleisha Amohia <aleishaamohia@hotmail.com>
Mon, 27 Jun 2022 05:11:23 +0000 (17:11 +1200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 22 Feb 2023 13:03:32 +0000 (10:03 -0300)
Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
installer/data/mysql/atomicupdate/bug_31051_-_add_OPACShowSavings_syspref.pl [new file with mode: 0755]
installer/data/mysql/mandatory/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref

diff --git a/installer/data/mysql/atomicupdate/bug_31051_-_add_OPACShowSavings_syspref.pl b/installer/data/mysql/atomicupdate/bug_31051_-_add_OPACShowSavings_syspref.pl
new file mode 100755 (executable)
index 0000000..f78f77b
--- /dev/null
@@ -0,0 +1,12 @@
+use Modern::Perl;
+
+return {
+    bug_number => "31051",
+    description => "Add new system preference OPACShowSavings",
+    up => sub {
+        my ($args) = @_;
+        my ($dbh, $out) = @$args{qw(dbh out)};
+
+        $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OPACShowSavings', '', 'checkouthistory|summary|user', 'Show on the OPAC the total amount a patron has saved by using a library instead of purchasing, based on replacement prices', 'multiple') });
+    },
+};
index beebd27..a739aac 100644 (file)
@@ -667,6 +667,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
 ('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
 ('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
+('OPACShowSavings', '', 'checkouthistory|summary|user', 'Show on the OPAC the total amount a patron has saved by using a library instead of purchasing, based on replacement prices', 'multiple'),
 ('SIP2SortBinMapping','',NULL,'Use the following mappings to determine the sort_bin of a returned item. The mapping should be on the form \"branchcode:item field:item field value:sort bin number\", with one mapping per line.','free'),
 ('SkipHoldTrapOnNotForLoanValue','',NULL,'If set, Koha will never trap items for hold with this notforloan value','Integer'),
 ('SlipCSS','',NULL,'Slips CSS url.','free'),
index 09e4439..15675aa 100644 (file)
@@ -530,6 +530,13 @@ OPAC:
             - "identifiers for authors and contributors to the detail pages in the OPAC."
             - "This feature requires authorities with 024$2 and 024$a."
             - "Valid source codes in $2 are currently: orcid, scopus, loop, rid and viaf."
+        -
+            - "Calculate the amount a patron has 'saved' by using the library based on replacement prices, and display:"
+            - pref: OPACShowSavings
+              multiple:
+                  checkouthistory: "on patron's checkout history page (the system preference <em>opacreadinghistory</em> must be enabled)"
+                  summary: "in user summary box on OPAC homepage (the system preference <em>OPACUserSummary</em> must be enabled)"
+                  user: "on patron's 'your summary' page"
     OpenURL:
         -
             - 'Complete URL of OpenURL resolver (starting with <code>http://</code> or <code>https://</code>):'