Copy location group searching repairs
authorBill Erickson <berick@esilibrary.com>
Fri, 21 Sep 2012 21:10:58 +0000 (17:10 -0400)
committerDan Scott <dscott@laurentian.ca>
Fri, 28 Sep 2012 13:46:22 +0000 (09:46 -0400)
In the get_library BLOCK, upgrade any use of 'loc' to 'locg' instead of
trying to determine which to use in which situation.  Before this change,
'loc' was being used as the loc_name for the main org unit selector,
which should always use 'locg'.  For any other cases (related to search
params), it's always safe to use 'locg' over 'loc'.

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

index 67805ac..45d3f54 100644 (file)
 
     # Get the library or location group
     # get_library()
+    # magically upgrades any use of 'loc' to 'locg', 
+    # which is a superset of 'loc'.
     BLOCK get_library;
-        IF !loc_name; 
-            loc_name = 'loc';
-            IF show_loc_groups; loc_name = 'locg'; END;
-        END;
-        IF !loc_value;
-            loc_value = CGI.param('loc') || ctx.search_ou;
-            IF show_loc_groups; 
-                loc_value = CGI.param('locg') || ctx.search_ou;
-            END;
-        END;
+        loc_name = 'locg';
+        loc_value = CGI.param(loc_name) || CGI.param('loc') || ctx.search_ou;
     END;
 %]