Bug 16041 - DBRev 3.23.00.058
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 13:51:00 +0000 (13:51 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 13:51:29 +0000 (13:51 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha.pm
installer/data/mysql/atomicupdate/bug_16041.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 641f9df..4bfbada 100644 (file)
--- 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 = "3.23.00.057";
+$VERSION = "3.23.00.058";
 
 sub version {
     return $VERSION;
diff --git a/installer/data/mysql/atomicupdate/bug_16041.perl b/installer/data/mysql/atomicupdate/bug_16041.perl
deleted file mode 100644 (file)
index 809325c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-my $dbh = C4::Context->dbh;
-my ( $count_imageurl ) = $dbh->selectrow_array(q|
-    SELECT COUNT(*)
-    FROM authorised_values
-    WHERE imageurl IS NOT NULL
-        AND imageurl <> ""
-|);
-unless ( $count_imageurl ) {
-    if ( C4::Context->preference('AuthorisedValueImages')
-        or C4::Context->preference('StaffAuthorisedValueImages') ) {
-        $dbh->do(q|
-            UPDATE systempreferences
-            SET value=0
-            WHERE variable="AuthorisedValueImages"
-               or variable="StaffAuthorisedValueImages"
-        |);
-        warn "The system preferences AuthorisedValueImages and StaffAuthorisedValueImages have been turned off\n";
-        warn "authorised_values.imageurl is not populated, that means you are not using this feature\n"
-    }
-} else {
-    warn "At least one authorised value has an icon defined (imageurl)\n";
-    warn "The system preference AuthorisedValueImages or StaffAuthorisedValueImages could be turned off if you are not aware of this feature\n";
-}
index eed4c23..f3f4463 100755 (executable)
@@ -12492,6 +12492,39 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.23.00.058";
+if ( CheckVersion($DBversion) ) {
+
+    my ($count_imageurl) = $dbh->selectrow_array(q|
+        SELECT COUNT(*)
+        FROM authorised_values
+        WHERE imageurl IS NOT NULL
+            AND imageurl <> ""
+    |);
+
+    unless ($count_imageurl) {
+        if (   C4::Context->preference('AuthorisedValueImages')
+            or C4::Context->preference('StaffAuthorisedValueImages') )
+        {
+            $dbh->do(q|
+                UPDATE systempreferences
+                SET value = 0
+                WHERE variable = "AuthorisedValueImages"
+                   or variable = "StaffAuthorisedValueImages"
+            |);
+            warn "The system preferences AuthorisedValueImages and StaffAuthorisedValueImages have been turned off\n";
+            warn "authorised_values.imageurl is not populated, that means you are not using this feature\n";
+        }
+    }
+    else {
+        warn "At least one authorised value has an icon defined (imageurl)\n";
+        warn "The system preference AuthorisedValueImages or StaffAuthorisedValueImages could be turned off if you are not aware of this feature\n";
+    }
+
+    print "Upgrade to $DBversion done (Bug 15531 - Add support for standing orders)\n";
+    SetVersion($DBversion);
+}
+
 
 # DEVELOPER PROCESS, search for anything to execute in the db_update directory
 # SEE bug 13068