From 66a959f28b896c200dd6bc8b8b19a830f2596ae0 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Fri, 4 May 2012 14:28:51 +0200 Subject: [PATCH] Bug 7167, tiny display change, separating koha number and DBrev applied This patch separated the Koha number and the list of database revision that have been applied on this database. Before the patch: a single string was computed in .pl and displayed After the patch: the string containing the kohaVersion and the string containing the list of database revisions applied have been splitted in 2 separate T::T variable The display has been updated a little, with a new string in the template --- about.pl | 22 ++++++++++++---------- koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/about.pl b/about.pl index b0364d3..0048b20 100755 --- a/about.pl +++ b/about.pl @@ -51,7 +51,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $kohaVersion = C4::Context->preference("Version"); # restore ., for display consistency $kohaVersion =~ /(.)\.(..)(..)(...)/; -$kohaVersion = "$1.$2.$3.$4"; +# transform digits to Perl number, to display 3.6.1.2 instead of 3.06.01.002 +$kohaVersion = ($1+0).".".($2+0).".".($3+0).".".($4+0); + +my $dbrev_applied=""; # the list of database revisions + # the $kohaVersion is duplicated since 3.7: the 3.6 (that uses the old mechanism) and the 3.7 (new mechanism). # Both versions reflects how the database has been upgraded my $already_knows = C4::Update::Database::list_versions_already_knows(); @@ -65,27 +69,24 @@ for my $v ( @$already_knows ) { # if the current number is the previous one +1, then just add a ., for a better display N.........N+10, for example # (instead of N / N+1 / N+2 / ...) if ($current==$last_known+1) { - $kohaVersion.="."; + $dbrev_applied.="."; } else { # we're not N+1, start a new range # if version don't end by a ., no need to add the current loop number # this avoid having N...N (in case of an isolated BDrev number) - if ($last_known & $kohaVersion =~ /\.$/) { - $kohaVersion .= "...".$last_known_sep; + if ($last_known & $dbrev_applied =~ /\.$/) { + $dbrev_applied .= "...".$last_known_sep; } # start a new range - $kohaVersion .= " / ".$v->{version}; + $dbrev_applied .= " ".$v->{version}; } $last_known= $current; $last_known_sep=$v->{version}; } # add the last DB rev number, we don't want to end with "..." -if ($kohaVersion =~ /\.$/) { - $kohaVersion .= "...".$last_known_sep; +if ($dbrev_applied =~ /\.$/) { + $dbrev_applied .= "...".$last_known_sep; } -# remove any 0 just after a . for better readability (3.06.02.001 will become 3.6.2.1) -$kohaVersion =~ s/\.0+/\./g; - my $osVersion = `uname -a`; my $perl_path = $^X; if ($^O ne 'VMS') { @@ -100,6 +101,7 @@ my $zebraVersion = `zebraidx -V`; $template->param( kohaVersion => $kohaVersion, + dbrev_applied => $dbrev_applied, osVersion => $osVersion, perlPath => $perl_path, perlVersion => $perlVersion, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index f4f0def..c5e267b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -36,7 +36,7 @@ - + -- 1.7.9.5
Server information
Koha version: [% kohaVersion |html %]
Koha version: [% kohaVersion |html %] with the following database revisionapplied: [% dbrev_applied|html %]
OS version ('uname -a'): [% osVersion |html %]
Perl interpreter: [% perlPath |html %]
Perl version: [% perlVersion |html %]