Override OU names with display names
authorJeff Godin <jgodin@tadl.org>
Sat, 17 Nov 2012 01:23:14 +0000 (20:23 -0500)
committerJeff Godin <jgodin@tadl.org>
Sat, 17 Nov 2012 02:05:37 +0000 (21:05 -0500)
Use a skin override for display names for libraries, used in copy
availability counts and in copy table.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
templates_tadlskin/opac/parts/config.tt2
templates_tadlskin/opac/parts/record/copy_counts.tt2
templates_tadlskin/opac/parts/record/copy_table.tt2
templates_tadlskin/opac/parts/result/copy_counts.tt2

index 9d802e3..4703765 100644 (file)
@@ -69,4 +69,17 @@ facet.display = [
     {facet_class => 'subject', facet_order => ['name', 'geographic']}
 ];
 
+
+##############################################################################
+# TADL overrides for display
+tadlskin.ou_display_names = {
+    'TADL' => 'in TADL district',
+    'TADL-EBB' => 'at East Bay',
+    'TADL-FLPL' => 'at Fife Lake',
+    'TADL-IPL' => 'at Interlochen',
+    'TADL-KBL' => 'at Kingsley',
+    'TADL-PCL' => 'at Peninsula',
+    'TADL-WOOD' => 'at Woodmere',
+};
+
 %]
index 7be86ea..ef27009 100644 (file)
                 depth = depth + 1;
                 NEXT;
             END;
-            ou_name = cp_org_unit.name;
+            # TADL hack to override displayed OU name
+            IF tadlskin.ou_display_names.exists(cp_org_unit.shortname);
+                ou_name = tadlskin.ou_display_names.${cp_org_unit.shortname};
+            ELSE;
+                ou_name = cp_org_unit.name;
+            END;
             displayed_ous.$ou_name = 1;
     %]
     [% l('[quant,_1,copy,copies] at [_2].', ou_avail, ou_name) | html %]
index 8a582cb..c4b230f 100644 (file)
@@ -77,6 +77,11 @@ END;
             [%- ELSE %]<td header='copy_header_library'>
             [%-
                 org_name = ctx.get_aou(copy_info.circ_lib).name;
+                # TADL hack to override displayed OU name
+                org_shortname = ctx.get_aou(copy_info.circ_lib).shortname;
+                IF tadlskin.ou_display_names.exists(org_shortname);
+                        org_name  = tadlskin.ou_display_names.$org_shortname.remove('^(at|in) ');
+                END;
                 org_name | html
             -%]
             </td>[% END %]
index cb3b3c6..32bc347 100644 (file)
@@ -3,17 +3,23 @@
     displayed_ous = {};
     WHILE depth < depths;
         # TADL hack to hide counts for top of tree
-       IF attrs.copy_counts.$depth.org_unit == 1;
-            depth = depth + 1;
-            NEXT;
-       END;
-        ou_name = ctx.get_aou(attrs.copy_counts.$depth.org_unit).name;
+        IF attrs.copy_counts.$depth.org_unit == 1;
+                depth = depth + 1;
+                NEXT;
+        END;
+        # TADL hack to override displayed OU name
+        ou_shortname = ctx.get_aou(attrs.copy_counts.$depth.org_unit).shortname;
+        IF tadlskin.ou_display_names.exists(ou_shortname);
+            ou_name = tadlskin.ou_display_names.$ou_shortname;
+        ELSE;
+            ou_name = ctx.get_aou(attrs.copy_counts.$depth.org_unit).name;
+        END;
         displayed_ous.$ou_name = 1;
         IF attrs.copy_counts.$depth.count > 0;
 %]
 <div class="result_count">
 [% IF ctx.get_aou(attrs.copy_counts.$depth.org_unit).opac_visible == 't' AND !ctx.is_staff %]
-    [% l('[_1] of [quant,_2,copy,copies] available at [_3].',
+    [% l('[_1] of [quant,_2,copy,copies] available [_3].',
         attrs.copy_counts.$depth.available,
         attrs.copy_counts.$depth.count,
         ou_name) | html
     END;
 
     depth = attrs.plib_copy_counts.size - 1;
-    ou_name = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit).name;
+    # TADL hack to override displayed OU name
+    IF tadlskin.ou_display_names.exists(ou_shortname);
+        ou_name = tadlskin.ou_display_names.$ou_shortname;
+    ELSE;
+        ou_name = ctx.get_aou(attrs.plib_copy_counts.$depth.org_unit).name;
+    END;
     UNLESS displayed_ous.exists(ou_name);
     
 %]
 [%- IF attrs.plib_copy_counts.$depth.count > 0; %]
 <div class="result_count preferred">[%
-     l('[_1] of [quant,_2,copy,copies] available at [_3].',
+     l('[_1] of [quant,_2,copy,copies] available [_3].',
         attrs.plib_copy_counts.$depth.available,
         attrs.plib_copy_counts.$depth.count,
         ou_name) | html