Lines 6011-6016
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
Link Here
|
6011 |
SetVersion ($DBversion); |
6011 |
SetVersion ($DBversion); |
6012 |
} |
6012 |
} |
6013 |
|
6013 |
|
|
|
6014 |
$DBversion = "3.09.00.XXX"; |
6015 |
if (C4::Context->preference("Version") < TransformToNum($DBversion)) { |
6016 |
my $gst_booksellers = $dbh->selectcol_arrayref("SELECT DISTINCT(gstrate) FROM aqbooksellers"); |
6017 |
my $gist_syspref = C4::Context->preference("gist"); |
6018 |
# remove the undef values and construct and array with the syspref and the supplier values |
6019 |
my @gstrates = map { defined $_ ? $_ : () } @$gst_booksellers; |
6020 |
push @gstrates, split ('\|', $gist_syspref); |
6021 |
# we want to compare integer (or float) |
6022 |
$_ = $_ + 0 for @gstrates; |
6023 |
use List::MoreUtils qw/uniq/; |
6024 |
# remove duplicate values |
6025 |
@gstrates = uniq sort @gstrates; |
6026 |
my $new_syspref_value = join '|', @gstrates; |
6027 |
# update the syspref with the new values |
6028 |
my $sth = $dbh->prepare("UPDATE systempreferences set value=? WHERE variable='gist'"); |
6029 |
$sth->execute( $new_syspref_value ); |
6030 |
|
6031 |
print "Upgrade to $DBversion done (Bug 8832, Set the syspref gist with the existing values)\n"; |
6032 |
SetVersion ($DBversion); |
6033 |
} |
6034 |
|
6014 |
=head1 FUNCTIONS |
6035 |
=head1 FUNCTIONS |
6015 |
|
6036 |
|
6016 |
=head2 TableExists($table) |
6037 |
=head2 TableExists($table) |