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