|
Lines 47-58
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
| 47 |
); |
47 |
); |
| 48 |
|
48 |
|
| 49 |
my $kohaVersion = C4::Context->preference("Version"); |
49 |
my $kohaVersion = C4::Context->preference("Version"); |
|
|
50 |
# restore ., for display consistency |
| 51 |
$kohaVersion =~ /(.)\.(..)(..)(...)/; |
| 52 |
$kohaVersion = "$1.$2.$3.$4"; |
| 50 |
# the $kohaVersion is duplicated since 3.7: the 3.6 (that uses the old mechanism) and the 3.7 (new mechanism). |
53 |
# the $kohaVersion is duplicated since 3.7: the 3.6 (that uses the old mechanism) and the 3.7 (new mechanism). |
| 51 |
# Both versions reflects how the database has been upgraded |
54 |
# Both versions reflects how the database has been upgraded |
| 52 |
my $already_knows = C4::Update::Database::list_versions_already_knows(); |
55 |
my $already_knows = C4::Update::Database::list_versions_already_knows(); |
|
|
56 |
# $last_known contains the previous DBrev applied number (all . removed). It's used to have a . instead of a number in case of continuous updates |
| 57 |
my $last_known=0; |
| 58 |
# $last_known_sep contains the previous DBrev applied with the separator (used for display) |
| 59 |
my $last_known_sep=""; |
| 53 |
for my $v ( @$already_knows ) { |
60 |
for my $v ( @$already_knows ) { |
|
|
61 |
my $current = $v->{version}; |
| 62 |
$current =~s/\.//g; |
| 63 |
# if the current number is the previous one +1, then just add a ., for a better display N.........N+10, for example |
| 64 |
# (instead of N / N+1 / N+2 / ...) |
| 65 |
if ($current==$last_known+1) { |
| 66 |
$kohaVersion.="."; |
| 67 |
} else { # we're not N+1, start a new range |
| 68 |
# if version don't end by a ., no need to add the current loop number |
| 69 |
# this avoid having N...N (in case of an isolated BDrev number) |
| 70 |
if ($last_known & $kohaVersion =~ /\.$/) { |
| 71 |
$kohaVersion .= "...".$last_known_sep; |
| 72 |
} |
| 73 |
# start a new range |
| 54 |
$kohaVersion .= " / ".$v->{version}; |
74 |
$kohaVersion .= " / ".$v->{version}; |
|
|
75 |
} |
| 76 |
$last_known= $current; |
| 77 |
$last_known_sep=$v->{version}; |
| 78 |
} |
| 79 |
# add the last DB rev number, we don't want to end with "..." |
| 80 |
if ($kohaVersion =~ /\.$/) { |
| 81 |
$kohaVersion .= "...".$last_known_sep; |
| 55 |
} |
82 |
} |
|
|
83 |
|
| 84 |
# remove any 0 just after a . for better readability (3.06.02.001 will become 3.6.2.1) |
| 85 |
$kohaVersion =~ s/\.0+/\./g; |
| 86 |
|
| 56 |
my $osVersion = `uname -a`; |
87 |
my $osVersion = `uname -a`; |
| 57 |
my $perl_path = $^X; |
88 |
my $perl_path = $^X; |
| 58 |
if ($^O ne 'VMS') { |
89 |
if ($^O ne 'VMS') { |