Revert "TPac: non-inherited org unit visibility"
authorBill Erickson <berick@esilibrary.com>
Mon, 2 Apr 2012 17:18:19 +0000 (13:18 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 2 Apr 2012 17:23:19 +0000 (13:23 -0400)
This reverts commit 1b7c563166d60ddee4a9c507f3eded07bc5e70c0.

Signed-off-by: Bill Erickson <berick@esilibrary.com>

Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql [deleted file]
Open-ILS/src/templates/opac/parts/org_selector.tt2

index 4bb8f3b..6c97858 100644 (file)
@@ -11541,16 +11541,3 @@ INSERT INTO action_trigger.environment (event_def, path)
 INSERT INTO actor.toolbar(org,label,layout) VALUES
     ( 1, 'circ', '["circ_checkout","circ_checkin","toolbarseparator.1","search_opac","copy_status","toolbarseparator.2","patron_search","patron_register","toolbarspacer.3","hotkeys_toggle"]' ),
     ( 1, 'cat', '["circ_checkin","toolbarseparator.1","search_opac","copy_status","toolbarseparator.2","create_marc","authority_manage","retrieve_last_record","toolbarspacer.3","hotkeys_toggle"]' );
-
-INSERT INTO config.global_flag (name, enabled, label) 
-    VALUES (
-        'opac.org_unit.non_inheritied_visibility',
-        FALSE,
-        oils_i18n_gettext(
-            'opac.org_unit.non_inheritied_visibility',
-            'Org Units Do Not Inherit Visibility',
-            'cgf',
-            'label'
-        )
-    );
-
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.org_unit_opac_vis_and_sorting.sql
deleted file mode 100644 (file)
index 115613a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-BEGIN;
-
---SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
-
-INSERT INTO config.global_flag (name, enabled, label) 
-    VALUES (
-        'opac.org_unit.non_inheritied_visibility',
-        FALSE,
-        oils_i18n_gettext(
-            'opac.org_unit.non_inheritied_visibility',
-            'Org Units Do Not Inherit Visibility',
-            'cgf',
-            'label'
-        )
-    );
-
-COMMIT;
-
-/* UNDO
-BEGIN;
-DELETE FROM config.global_flag WHERE name = 'opac.org_unit.non_inheritied_visibility';
-COMMIT;
-*/
-
index 49775c4..fd9c8c0 100644 (file)
@@ -8,8 +8,6 @@
 
 BLOCK build_org_selector;
     node_stack = [{org => org_unit || ctx.aou_tree}];
-    inherited_vis = ctx.get_cgf('opac.org_unit.non_inheritied_visibility').enabled == 'f';
-
     IF !name; 
         name = 'loc';
         IF show_loc_groups; name = 'locg'; END;
@@ -32,10 +30,8 @@ BLOCK build_org_selector;
             css_class = '';
             disabled = '';
             selected = '';
-            visible = org_unit.opac_visible == 't';
 
-            # org and all children are invisible.
-            NEXT IF !visible AND inherited_vis AND !ctx.is_staff;
+            NEXT UNLESS ctx.is_staff || org_unit.opac_visible == 't';
 
             IF !loc_grp; # processing an org unit
 
@@ -61,15 +57,11 @@ BLOCK build_org_selector;
                 FOR grp IN top_loc_groups;
                     node_stack.push({org => org_unit, loc_grp => grp});
                 END;
-
             END;
 
-            # This org unit is not publicly visible (though its children may be).
-            NEXT UNLESS ctx.is_staff OR visible;
-
             node_value = ou_id;
+            IF loc_grp; node_value = node_value _ ':' _ loc_grp.id; END;
             IF loc_grp;
-                node_value = node_value _ ':' _ loc_grp.id; 
                 css_class = 'class="loc_grp"';
             ELSE;
                 css_class = 'class="org_unit"';
@@ -79,31 +71,20 @@ BLOCK build_org_selector;
                 disabled = 'disabled="disabled"';
             ELSIF node_value == value;
                 selected = 'selected="selected"';
-            END;
-
-            pad_depth = org_unit.ou_type.depth;
-
-            # copy loc groups appear as children of the owner (current) org
-            SET pad_depth = pad_depth + 1 IF loc_grp;
-
-            # for each parent org unit that is hidden, decrease the pad depth by one.  
-            IF !ctx.is_staff; 
-                porg = ctx.get_aou(org_unit.parent_ou);
-                WHILE porg;
-                    SET pad_depth = pad_depth - 1 IF porg.opac_visible == 'f';
-                    porg = ctx.get_aou(porg.parent_ou);
-                END;
-            END;
-
-            pad_depth = pad_depth * 2;
-            display_name = loc_grp ? loc_grp.name : org_unit.name;
-            
-            %] 
+            END %] 
 
             <option value='[% node_value %]' [% selected %] [% disabled %] [% css_class %]> 
-                [% '&nbsp;' FOR [0..pad_depth]; display_name | html %]
+            [%
+                # loc_grp's are displayed as children of the current org
+                depth = org_unit.ou_type.depth;
+                IF loc_grp; depth = depth + 1; END;
+                pad = depth * 2;
+                FOR idx IN [0..pad]; '&nbsp;'; END;
+                loc_grp ? loc_grp.name : org_unit.name | html ;
+            %]
             </option> 
-
-        [% END %]
+            [%
+        END;
+    %]
     </select>
 [% END %]