LP#1346381: Allow copy location filters above branches user/miker/lp-1346381-show_locations-wherever-they-exist
authorMike Rylander <mrylander@gmail.com>
Wed, 22 Apr 2015 21:55:25 +0000 (17:55 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 22 Apr 2015 21:55:25 +0000 (17:55 -0400)
The TPAC, inheriting functionality from the JSPAC, restricted the
copy locations one could filter on in the advanced search screen.
For installations that have many shared copy locations at the (stock-speak)
System level and just a few Branch level special locations, this is
sub-optimal.

This commit allows the display of System-and-above copy locations
for filtering, but excludes Branch-level locations in order to avoid
the heretofore protected-against location list explosion.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/opac/copyloc.js

index ddd1a5c..ade6f3b 100644 (file)
@@ -10,11 +10,6 @@ function apply_adv_copy_locations() {
     var selected_id = sel.options[sel.selectedIndex].getAttribute('value');
     var org_unit = aou_hash[selected_id];
 
-    if (org_unit.can_have_vols != 't') {
-        dojo.addClass('adv_chunk_copy_location', 'hidden');
-        return;
-    }
-
     var display_orgs = [];
 
     // we want to display copy locations at the selected org,
@@ -34,7 +29,9 @@ function apply_adv_copy_locations() {
         collect_parent_orgs(aou_hash[org_id].parent_ou);
     }
 
-    collect_child_orgs(org_unit.id);
+    // If the select org unit cannot have copies
+    // don't show any child org locations.
+    if (org_unit.can_have_vols == 't') collect_child_orgs(org_unit.id);
     collect_parent_orgs(org_unit.parent_ou);
     fetch_adv_copy_locations(display_orgs);
 }