Bugzilla – Attachment 74036 Details for
Bug 18674
Show timezone for Perl and MySQL on the About Koha page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18674: (QA follow-up) Add date and time
Bug-18674-QA-follow-up-Add-date-and-time.patch (text/plain), 3.08 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-04-11 19:29:50 UTC
(
hide
)
Description:
Bug 18674: (QA follow-up) Add date and time
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-04-11 19:29:50 UTC
Size:
3.08 KB
patch
obsolete
>From a2087d894ba4481d22680cf50c6efbd19abf6017 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 11 Apr 2018 15:47:01 -0300 >Subject: [PATCH] Bug 18674: (QA follow-up) Add date and time > >This patch adds current date and time, formatted as configured. >It makes the timezone name be displayed the system uses it (important >for the 'local' use case). > >It removes some warnings too. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > about.pl | 13 +++++++++---- > koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 5 +++++ > 2 files changed, 14 insertions(+), 4 deletions(-) > >diff --git a/about.pl b/about.pl >index 7ea8acd073..3997d4992a 100755 >--- a/about.pl >+++ b/about.pl >@@ -37,6 +37,7 @@ use C4::Context; > use C4::Installer; > > use Koha; >+use Koha::DateUtils qw(dt_from_string output_pref); > use Koha::Acquisition::Currencies; > use Koha::Patron::Categories; > use Koha::Patrons; >@@ -62,9 +63,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >-my $config_timezone = C4::Context->config('timezone'); >+my $config_timezone = C4::Context->config('timezone') // ''; > my $config_invalid = !DateTime::TimeZone->is_valid_name( $config_timezone ); >-my $env_timezone = $ENV{TZ}; >+my $env_timezone = $ENV{TZ} // ''; > my $env_invalid = !DateTime::TimeZone->is_valid_name( $env_timezone ); > my $actual_bad_tz_fallback = 0; > >@@ -81,14 +82,18 @@ elsif ( $config_timezone eq '' && > } > > my $time_zone = { >- actual => C4::Context->timezone(), >+ actual => C4::Context->tz->name, > actual_bad_tz_fallback => $actual_bad_tz_fallback, > config => $config_timezone, > config_invalid => $config_invalid, > environment => $env_timezone, > environment_invalid => $env_invalid > }; >-$template->param( 'time_zone' => $time_zone ); >+ >+$template->param( >+ time_zone => $time_zone, >+ current_date_and_time => output_pref({ dt => dt_from_string(), dateformat => 'iso' }) >+); > > my $perl_path = $^X; > if ($^O ne 'VMS') { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index e109eb0e33..8feceb395e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -1,5 +1,6 @@ > [% USE HtmlTags %] > [% USE Koha %] >+[% USE KohaDates %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › About Koha</title> >@@ -111,6 +112,10 @@ > [% ELSIF (errZebraConnection) %] > <tr><th scope="row"><b>Warning</b> </th><td>Error message from Zebra: [% ( errZebraConnection ) %] </td></tr> > [% END %] >+ <tr> >+ <th scope="row">Date and time: </th> >+ <td>[% current_date_and_time | $KohaDates with_hours => 1 %]</td> >+ </tr> > <tr> > [% timezone_config_class = (time_zone.config_invalid) ? 'status_warn' : '' %] > [% timezone_env_class = (time_zone.env_invalid) ? 'status_warn' : '' %] >-- >2.17.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18674
:
72214
|
73533
|
73534
|
73700
|
73701
|
73702
|
73720
|
74024
|
74026
| 74036