Lines 6134-6139
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
Link Here
|
6134 |
SetVersion ($DBversion); |
6134 |
SetVersion ($DBversion); |
6135 |
} |
6135 |
} |
6136 |
|
6136 |
|
|
|
6137 |
if ( CheckVersion($DBversion) ) { |
6138 |
print "Upgrade to $DBversion done (Bug 9191: You shouldn't see this)\n"; |
6139 |
SetVersion($DBversion); |
6140 |
} |
6141 |
|
6142 |
$DBversion = "3.11.00.XXX"; |
6143 |
if ( CheckVersion($DBversion) ) { |
6144 |
print "Upgrade to $DBversion done (Bug 9191: You should see this)\n"; |
6145 |
SetVersion($DBversion); |
6146 |
} |
6147 |
|
6137 |
=head1 FUNCTIONS |
6148 |
=head1 FUNCTIONS |
6138 |
|
6149 |
|
6139 |
=head2 TableExists($table) |
6150 |
=head2 TableExists($table) |
Lines 6215-6218
sub SetVersion {
Link Here
|
6215 |
} |
6226 |
} |
6216 |
C4::Context::clear_syspref_cache(); # invalidate cached preferences |
6227 |
C4::Context::clear_syspref_cache(); # invalidate cached preferences |
6217 |
} |
6228 |
} |
|
|
6229 |
|
6230 |
=head2 CheckVersion |
6231 |
|
6232 |
Check whether a given update should be run when passed the proposed version |
6233 |
number. The update will always be run if the proposed version is greater |
6234 |
than the current database version and less than or equal to the version in |
6235 |
kohaversion.pl. The update is also run if the version contains XXX, though |
6236 |
this behavior will be changed following the adoption of non-linear updates |
6237 |
as implemented in bug 7167. |
6238 |
|
6239 |
=cut |
6240 |
|
6241 |
sub CheckVersion { |
6242 |
my ($proposed_version) = @_; |
6243 |
my $version_number = TransformToNum($proposed_version); |
6244 |
|
6245 |
# The following line should be deleted when bug 7167 is pushed |
6246 |
return 1 if ( $proposed_version =~ m/XXX/ ); |
6247 |
|
6248 |
if ( C4::Context->preference("Version") < $version_number |
6249 |
&& $version_number <= TransformToNum( C4::Context->final_linear_version ) ) |
6250 |
{ |
6251 |
return 1; |
6252 |
} |
6253 |
else { |
6254 |
return 0; |
6255 |
} |
6256 |
} |
6257 |
|
6218 |
exit; |
6258 |
exit; |