Bug 23293: Add system preference
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 10 Jul 2019 13:34:47 +0000 (14:34 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 7 Nov 2019 13:13:17 +0000 (13:13 +0000)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_23293.perl [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref

diff --git a/installer/data/mysql/atomicupdate/bug_23293.perl b/installer/data/mysql/atomicupdate/bug_23293.perl
new file mode 100644 (file)
index 0000000..0929850
--- /dev/null
@@ -0,0 +1,11 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do( q{
+            INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES
+            ('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in OPACFineNoRenewals should include any unapplied account credits in the calculation','YesNo')
+    });
+
+    # Always end with this (adjust the bug info)
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 23293 - Add 'OPACFineNoRenewalsIncludeCredits' system preference)\n";
+}
index ab24987..9fc3d58 100644 (file)
@@ -457,6 +457,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('OpenURLResolverURL', '', NULL, 'URL of OpenURL Resolver', 'Free'),
 ('OpenURLText', '', NULL, 'Text of OpenURL links (or image title if OpenURLImageLocation is defined)', 'Free'),
 ('OpenURLImageLocation', '', NULL, 'Location of image for OpenURL links', 'Free'),
+('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in OPACFineNoRenewals should include any unapplied account credits in the calculation','YesNo'),
 ('OPACShowOpenURL', '', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
 ('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free'),
 ('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
index 82214b4..e268558 100644 (file)
@@ -626,6 +626,12 @@ OPAC:
               class: currency
             - '[% local_currency %] in fines (leave blank to disable).'
         -
+            - pref: OPACFineNoRenewalsIncludeCredits
+              choices:
+                  yes: Include
+                  no: "Don't include"
+            - outstanding/unapplied credits when applying the OPACFineNoRenewals rule to users
+        -
             - pref: OPACViewOthersSuggestions
               choices:
                   yes: Show