From d036b9a4d16eb1cda7c992ec54b9b36d7c86402d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 11 Jul 2014 12:08:07 +0200 Subject: [PATCH] Bug 12557: DB changes - Add the AcqItemSetSubfieldsWhenReceiptIsCancelled pref Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Works as described, passes tests and QA script. Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 9 +++++++++ .../prog/en/modules/admin/preferences/acquisitions.pref | 3 +++ 3 files changed, 13 insertions(+) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 1754c1ceb5..faa9ff32a6 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -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'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 130339666e..00ff3d29cc 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref index ac57f9519f..2babbad290 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref @@ -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 -- 2.11.4.GIT