From 7c461ea6909ccf462770364ea13f58e25edac7d6 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Wed, 4 May 2016 13:31:01 +0100 Subject: [PATCH] Bug 16258: Add a syspref to govern EDIFACT functionality Adds an "Edifact" systempreference to govern whether edifact processing is enabled. In most places this is hidden if the current vendor does not appear in the edi vendors table. This preference hides the admin screens which define this and a couple of links. Also fixes an anomaly whereby the basketgroup screen was not making the same check on whether edi ordering should be enabled as the basket screen. Both now use the same logic. Rebased-by: Mark Tompsett Rebased-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- acqui/basketgroup.pl | 1 + installer/data/mysql/atomicupdate/bug_16258.pl | 15 +++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../prog/en/includes/acquisitions-menu.inc | 7 ++++--- .../prog/en/modules/admin/admin-home.tt | 4 ++-- .../modules/admin/preferences/acquisitions.pref | 8 ++++++++ 6 files changed, 31 insertions(+), 5 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_16258.pl diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index 2d4241e025..336a8fb4d2 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -52,6 +52,7 @@ use CGI qw ( -utf8 ); use File::Spec; use C4::Acquisition qw( GetOrders GetOrder get_rounded_price GetBasket GetBasketgroup GetBasketsByBasketgroup GetBasketgroups GetBasketsByBookseller ModBasket CloseBasketgroup GetBasketGroupAsCSV DelBasketgroup ReOpenBasketgroup ModBasketgroup NewBasket NewBasketgroup ); +use Koha::Database; use Koha::EDI qw( get_edifact_ean create_edi_order ); use Koha::Biblioitems; diff --git a/installer/data/mysql/atomicupdate/bug_16258.pl b/installer/data/mysql/atomicupdate/bug_16258.pl new file mode 100755 index 0000000000..521b1ef2cf --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_16258.pl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "16258", + description => "A preference to enabled/disable edifact", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('Edifact', '0', NULL, 'Enables edifact acquisitions functions', 'YesNo') + }); + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index deaf6b6fc2..02e50f42cd 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -186,6 +186,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('DumpTemplateVarsIntranet', '0', NULL , 'If enabled, dump all Template Toolkit variable to a comment in the html source for the staff intranet.', 'YesNo'), ('DumpTemplateVarsOpac', '0', NULL , 'If enabled, dump all Template Toolkit variable to a comment in the html source for the opac.', 'YesNo'), ('EasyAnalyticalRecords','0','','If on, display in the catalogue screens tools to easily setup analytical record relationships','YesNo'), +('Edifact','0','Enables edifact acquisitions functions','Enables use of Edifact electronic message exchange for acquisitions','YesNo'), ('EdifactInvoiceImport', 'automatic', 'automatic|manual', "If on, don't auto-import EDI invoices, just keep them in the database with the status 'new'", 'Choice'), ('ElasticsearchIndexStatus_authorities', '0', 'Authorities index status', NULL, NULL), ('ElasticsearchIndexStatus_biblios', '0', 'Biblios index status', NULL, NULL), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc index a83bc21d96..feabd0861d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-menu.inc @@ -1,3 +1,4 @@ +[% USE Koha %]