Use search_label for format icons
authorThomas Berezansky <tsbere@mvlc.org>
Tue, 10 Dec 2013 17:23:03 +0000 (12:23 -0500)
committerThomas Berezansky <tsbere@mvlc.org>
Tue, 10 Dec 2013 17:23:03 +0000 (12:23 -0500)
So that they will match what shows up in the search box, thus removing
patron confusion.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/src/sql/Pg/990.schema.unapi.sql
Open-ILS/src/templates/opac/parts/misc_util.tt2

index 78a9a2c..ec1efd0 100644 (file)
@@ -1127,6 +1127,7 @@ CREATE OR REPLACE FUNCTION unapi.mra ( obj_id BIGINT, format TEXT,  ename TEXT,
                                 XMLATTRIBUTES(
                                     key AS name,
                                     cvm.value AS "coded-value",
+                                    cvm.search_label AS "search-value",
                                     rad.filter,
                                     rad.sorter
                                 ),
index cdd8eff..1936690 100644 (file)
                 '//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]');
             IF node AND node.textContent;
                 type = node.textContent;
-                args.format_label = node.getAttribute('coded-value')
+                args.format_label = node.getAttribute('coded-value');
+                IF node.getAttribute('search-value');
+                    args.format_label = node.getAttribute('search-value');
+                END;
                 args.schema.itemtype = schema_typemap.$type || 'CreativeWork';
                 args.format_icon = ctx.media_prefix _ '/images/format_icons/' _ icon_style _ '/' _ type _ '.png';
                 LAST;