Bug 12557: DB changes - Add the AcqItemSetSubfieldsWhenReceiptIsCancelled pref
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 11 Jul 2014 10:08:07 +0000 (12:08 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 9 Sep 2014 13:09:58 +0000 (10:09 -0300)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref

index 1754c1c..faa9ff3 100644 (file)
@@ -1,6 +1,7 @@
 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
 ('AcqCreateItem','ordering','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice'),
 ('AcqEnableFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to invoice records.','YesNo'),
+('AcqItemSetSubfieldsWhenReceiptIsCancelled','', '','Upon cancelling a receipt, update the items subfields if they were created when placing an order (e.g. o=5|a="bar foo")', 'Free'),
 ('AcqItemSetSubfieldsWhenReceived','','','Upon receiving items, update their subfields if they were created when placing an order (e.g. o=5|a="foo bar")','Free'),
 ('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
 ('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
index 1303396..00ff3d2 100755 (executable)
@@ -8742,6 +8742,15 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.17.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q{
+        INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('AcqItemSetSubfieldsWhenReceiptIsCancelled','', '','Upon cancelling a receipt, update the items subfields if they were created when placing an order (e.g. o=5|a="bar foo")', 'Free')
+    });
+    print "Upgrade to $DBversion done (Bug 11169 - Add AcqItemSetSubfieldsWhenReceiptIsCancelled syspref)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)
index ac57f95..2babbad 100644 (file)
@@ -46,6 +46,9 @@ Acquisitions:
             - Upon receiving items, update their subfields if they were created when placing an order (e.g. o=5|a="foo bar").
             - pref: AcqItemSetSubfieldsWhenReceived
         -
+            - Upon cancelling a receipt, update the item's subfields if they were created when placing an order (e.g. o=5|a="bar foo"").
+            - pref: AcqItemSetSubfieldsWhenReceiptIsCancelled
+        -
             - pref: AcqEnableFiles
               choices:
                   yes: Do