From 22aaf8f1f9ade2a37a14ef409388b012224041da Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 7 Oct 2019 13:55:38 +0100 Subject: [PATCH] Bug 18421: DBRev 19.06.00.035 Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- .../bug_18421_add_coce_intranet.perl | 24 ------------------- installer/data/mysql/updatedatabase.pl | 20 ++++++++++++++++ 3 files changed, 21 insertions(+), 25 deletions(-) delete mode 100755 installer/data/mysql/atomicupdate/bug_18421_add_coce_intranet.perl diff --git a/Koha.pm b/Koha.pm index ba47782034..13aa950f35 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "19.06.00.034"; +$VERSION = "19.06.00.035"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_18421_add_coce_intranet.perl b/installer/data/mysql/atomicupdate/bug_18421_add_coce_intranet.perl deleted file mode 100755 index 3b3f88f7bf..0000000000 --- a/installer/data/mysql/atomicupdate/bug_18421_add_coce_intranet.perl +++ /dev/null @@ -1,24 +0,0 @@ -#! /usr/bin/perl - -use Modern::Perl; -use C4::Context; - -my $dbh=C4::Context->dbh; - -################ -# IntranetCoce # -################ - -# validate systempreferences.Coce and save the config for OpacCoce -my $current_coce_pref = C4::Context->preference('Coce') || 0; - -# add two new systempreferences in order to have distinct behavior between intranet and OPAC -$dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES - ('IntranetCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the staff client', 'YesNo'), - ('OpacCoce','$current_coce_pref', NULL, 'If on, enables cover retrieval from the configured Coce server in the OPAC', 'YesNo') - ;") or die "Error applying Bug 18421: error inserting new values into database: ". $dbh->errstr . "\n"; - -$dbh->do("DELETE IGNORE FROM systempreferences WHERE variable = 'Coce';") - or die "Error applying Bug 18421: error deleting the old syspref 'Coce': ". $dbh->errstr . "\n"; - -print "Upgrade to XX.XX done (Bug 18421: Add Coce image cache to the Intranet)\n"; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index ca5357da7c..220b57ca20 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -19599,6 +19599,26 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 23007: Make transfer modals optionally block circ)\n"; } +$DBversion = '19.06.00.035'; +if( CheckVersion( $DBversion ) ) { + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES + ( 'IntranetCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the staff client', 'YesNo') + }); + + $dbh->do(qq{ + UPDATE systempreferences SET + variable = 'OpacCoce', + explanation = 'If on, enables cover retrieval from the configured Coce server in the OPAC' + WHERE + variable = 'Coce' + }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 18421: Add Coce image cache to the Intranet)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5