Bug 18674: Added timezone information to about page
authorMark Tompsett <mtompset@hotmail.com>
Mon, 26 Feb 2018 15:00:54 +0000 (15:00 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Apr 2018 18:05:02 +0000 (15:05 -0300)
Before patch: No timezone section
After patch: timezone section at bottom of
             Server information tab.

Actual is what is being used. Config overrides environment variables.
So if there is confusion why the environment variables aren't working,
it will be visible why.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

about.pl
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

index cfc2e32..91292a5 100755 (executable)
--- a/about.pl
+++ b/about.pl
@@ -61,6 +61,13 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
+my $time_zone = {
+    actual      => C4::Context->timezone(),
+    config      => C4::Context->config('timezone'),
+    environment => $ENV{TZ},
+};
+$template->param( 'time_zone' => $time_zone );
+
 my $perl_path = $^X;
 if ($^O ne 'VMS') {
     $perl_path .= $Config{_exe} unless $perl_path =~ m/$Config{_exe}$/i;
index 217ac65..cf73d11 100644 (file)
             [% ELSIF (errZebraConnection) %]
             <tr><th scope="row"><b>Warning</b> </th><td>Error message from Zebra: [% ( errZebraConnection ) %] </td></tr>
             [% END %]
+            <tr><th scope="row">Time zone: </th>
+               <td>Used: [% time_zone.actual %]<br/>
+                   Config: [% time_zone.config %]<br/>
+                   ENV: [% time_zone.environment %]</td></tr>
         </table>
         </div>
         <div id="perl">