Bug 15260: Add new useDaysMode option "Dayweek"
authorAndrew Isherwood <andrew.isherwood@ptfs-europe.com>
Thu, 31 Jan 2019 15:36:52 +0000 (15:36 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 31 Oct 2019 11:51:45 +0000 (11:51 +0000)
This patch adds a new "Dayweek" option to the useDaysMode syspref, it
has the description: "the calendar to push the due date to the next open
day on the same weekday".

Sponsored-by: Cheshire West and Chester Council
Sponsored-by: Cheshire East Council
Sponsored-by: Newcastle City Council
Sponsored-by: Sefton Council
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_15260-add_Dayweek_option_to_useDaysMode_syspref.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_15260-add_Dayweek_option_to_useDaysMode_syspref.perl b/installer/data/mysql/atomicupdate/bug_15260-add_Dayweek_option_to_useDaysMode_syspref.perl
new file mode 100644 (file)
index 0000000..fd58502
--- /dev/null
@@ -0,0 +1,8 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do( 'UPDATE systempreferences SET options = "Calendar|Days|Datedue|Dayweek", explanation = "Choose the method for calculating due date: select Calendar, Datedue or Dayweek to use the holidays module, and Days to ignore the holidays module" WHERE variable = "useDaysMode"' );
+
+    # Always end with this (adjust the bug info)
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug XXXXX - description)\n";
+}
index 3897de8..315b845 100644 (file)
@@ -658,7 +658,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('UseCashRegisters','0','','Use cash registers with the accounting system and assign patron transactions to them.','YesNo'),
 ('UseControlNumber','0','','If ON, record control number (w subfields) and control number (001) are used for linking of bibliographic records.','YesNo'),
 ('UseCourseReserves','0',NULL,'Enable the course reserves feature.','YesNo'),
-('useDaysMode','Calendar','Calendar|Days|Datedue','Choose the method for calculating due date: select Calendar to use the holidays module, and Days to ignore the holidays module','Choice'),
+('useDaysMode','Calendar','Calendar|Days|Datedue|Dayweek','Choose the method for calculating due date: select Calendar, Datedue or Dayweek to use the holidays module, and Days to ignore the holidays module','Choice'),
 ('useDefaultReplacementCost', '0', NULL, 'default replacement cost defined in item type', 'YesNo'),
 ('useDischarge','','','Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'),
 ('UseEmailReceipts','0','','Send email receipts for payments and write-offs','YesNo'),
index 3c24d51..04eeeee 100644 (file)
@@ -286,6 +286,7 @@ Circulation:
                   Days: circulation rules only.
                   Calendar: the calendar to skip all days the library is closed.
                   Datedue: the calendar to push the due date to the next open day
+                  Dayweek: the calendar to push the due date to the next open day on the same weekday
         -
             - Calculate "No renewal before" based on
             - pref: NoRenewalBeforePrecision