TPAC: Fall back on physical_loc, if set, for org selector user/dbs/tpac_password_loc
authorDan Scott <dscott@laurentian.ca>
Fri, 31 Aug 2012 21:31:17 +0000 (17:31 -0400)
committerDan Scott <dscott@laurentian.ca>
Fri, 31 Aug 2012 21:31:17 +0000 (17:31 -0400)
If "SetEnv physical_loc 123" is set for a given VirtualHost in the
Apache configuration, that's a useful fallback for cases where a
good default is not otherwise available to us.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates/opac/parts/misc_util.tt2

index 1a393c7..f699f87 100644 (file)
             IF show_loc_groups; loc_name = 'locg'; END;
         END;
         IF !loc_value;
-            loc_value = CGI.param('loc') || ctx.search_ou;
+            loc_value = CGI.param('loc') || ctx.search_ou || env.physical_loc;
             IF show_loc_groups; 
-                loc_value = CGI.param('locg') || ctx.search_ou;
+                loc_value = CGI.param('locg') || ctx.search_ou || env.physical_loc;
             END;
         END;
     END;