LP#1485374: Use client TZ in the database when supplied to the server
authorMike Rylander <mrylander@gmail.com>
Mon, 3 Aug 2015 17:27:56 +0000 (13:27 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 23 Feb 2016 17:06:32 +0000 (12:06 -0500)
commit315486b89f040dbe382dbe1362379b03e20e1a0f
treed43a71baf3944a13cf22ecf06a6050523afb7376
parent4ae3fa1a24e1e1bbfbd8b1ba77c8cc8e5d5b99a0
LP#1485374: Use client TZ in the database when supplied to the server

In LP#1485371 we teach OpenSRF how to discover and pass the client timezone
to the server.  Now we can use that information to temporarily put the server
into that timezone, including database sessions, so that dates and times
are calculated and reported based on the timezone of the client.

To do that we:

 * Teach CStore and friends to use the client-supplied time zone
 * Teach Storage to use $ENV{TZ} for the db timezone inside transactions,
   and by default except for search-y methods
 * Teach the TPAC to set the client TZ at login

This requires javascript to be enabled in the TPAC, and investigates the
client timezone at patron login time.  No times are displayed in TPAC
interfaces before the patron logs in, so there is no point in detecting
the timezone before this point.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/c-apps/oils_sql.c
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/storage.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/templates/opac/parts/js.tt2
Open-ILS/src/templates/opac/parts/login/form.tt2