Bug 13958: Add SuspensionsCalendar syspref
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 May 2019 14:30:33 +0000 (11:30 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 7 Nov 2019 09:11:58 +0000 (09:11 +0000)
Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

diff --git a/installer/data/mysql/atomicupdate/bug_13958.perl b/installer/data/mysql/atomicupdate/bug_13958.perl
new file mode 100644 (file)
index 0000000..3c3abec
--- /dev/null
@@ -0,0 +1,18 @@
+$DBversion = 'XXX';
+if( CheckVersion( $DBversion ) ) {
+
+    $dbh->do(q{
+        INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
+        SELECT
+            'SuspensionsCalendar',
+            IF( value='noFinesWhenClosed', 'noSuspensionsWhenClosed', 'ignoreCalendar'),
+            'ignoreCalendar|noSuspensionsWhenClosed',
+            'Specify whether to use the Calendar in calculating suspensions',
+            'Choice'
+        FROM systempreferences
+        WHERE variable='finesCalendar';
+    });
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 13958 - Add a SuspensionsCalendar syspref)\n";
+}
index 86514d9..ab24987 100644 (file)
@@ -600,6 +600,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('suggestion','1','','If ON, enables patron suggestions feature in OPAC','YesNo'),
 ('SuspendHoldsIntranet','1','Allow holds to be suspended from the intranet.',NULL,'YesNo'),
 ('SuspendHoldsOpac','1','Allow holds to be suspended from the OPAC.',NULL,'YesNo'),
+('SuspensionsCalendar','noSuspensionsWhenClosed','ignoreCalendar|noSuspensionsWhenClosed','Specify whether to use the Calendar in calculating suspension expiration','Choice'),
 ('SvcMaxReportRows','10',NULL,'Maximum number of rows to return via the report web service.','Integer'),
 ('SwitchOnSiteCheckouts','0',NULL,'Automatically switch an on-site checkout to a normal checkout','YesNo'),
 ('SyndeticsAuthorNotes','0','','Display Notes about the Author on OPAC from Syndetics','YesNo'),
index 52fdc24..e949eac 100644 (file)
@@ -840,7 +840,13 @@ Circulation:
               choices:
                   ignoreCalendar: directly.
                   noFinesWhenClosed: not including days the library is closed.
-            -
+        -
+            - Calculate suspension expiration based on days overdue
+            - pref: SuspensionsCalendar
+              type: choice
+              choices:
+                  ignoreCalendar: directly.
+                  noSuspensionsWhenClosed: not including days the library is closed.
         -
             - pref: finesMode
               type: choice