Permalink
Browse files

[delivers #15796177] Enable setting of timezone in $KOHA_CONF

Koha can't rely on environment variables if using Plack
with multiple libraries since those vars could vary from
instance to instance. This patch allows setting TZ based
on instance-specific configuration info.

Additionally, this displays the active local time on the
about.pl page.
  • Loading branch information...
1 parent d4ae863 commit cf43c83967015cb96e8b72874843903c5398a214 @ctfliblime ctfliblime committed Jul 14, 2011
Showing with 3 additions and 0 deletions.
  1. +1 −0 C4/Context.pm
  2. +1 −0 about.pl
  3. +1 −0 koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl
View
@@ -326,6 +326,7 @@ sub new {
warn "read_config_file($conf_fname) returned undef" if !defined($self->{"config"});
return undef if !defined($self->{"config"});
+ $ENV{TZ} = $self->{config}{timezone} || $ENV{TZ};
$self->{"dbh"} = undef; # Database handle
$self->{"Zconn"} = undef; # Zebra Connections
$self->{"stopwords"} = undef; # stopwords list
View
@@ -169,6 +169,7 @@
}
$template->param( components => \@components );
+$template->param( localtime => scalar localtime() );
my @environment = map { {variable => $_, value => $ENV{$_}} } sort keys %ENV;
$template->param( environment => \@environment);
@@ -44,6 +44,7 @@
<!-- TMPL_VAR ESCAPE="HTML" name="perlinc" --> <br />
<!-- /TMPL_LOOP -->
</td></tr>
+ <tr><th scope="row">Current local time: </th><td><!-- TMPL_VAR ESCAPE="HTML" name="localtime" --></td></tr>
<tr><th scope="row">MySQL version: </th><td><!-- TMPL_VAR ESCAPE="HTML" name="mysqlVersion" --></td></tr>
<tr><th scope="row">Apache version: </th><td><!-- TMPL_VAR ESCAPE="HTML" name="apacheVersion" --></td></tr>
<tr><th scope="row">Zebra version: </th><td><!-- TMPL_VAR ESCAPE="HTML" name="zebraVersion" --></td></tr>

0 comments on commit cf43c83

Please sign in to comment.