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)
committerMike Rylander <mrylander@gmail.com>
Sun, 16 Aug 2015 20:44:01 +0000 (16:44 -0400)
commit9cfc7584a251fa696bf9099f6f97366047be22b9
tree3356913ba43c1249e8be75affb875056f768484a
parentb8422397ff57cb4f2709db75451db8a97eb19575
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>
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