From: Remington Steed <rjs7@calvin.edu>
Date: Wed, 24 Apr 2019 13:37:22 +0000 (-0400)
Subject: LP#1741980: Fetch and show copy tag label in OPAC
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6c986199119358774a444cc8c36e43ef483d1a7b;p=evergreen%2Fjoelewis.git

LP#1741980: Fetch and show copy tag label in OPAC

When copy/item tags (such as "Digital Bookplate") are displayed in the
OPAC, they currently only show the tag's value, but not the label of the
tags type. This commit fleshes in the tag type so we gain access to the
type's label, and it adds it to the OPAC display.

OPAC output before: "(Tag Value Here)"

OPAC output after: "Digital Bookplate: (Tag Value Here)"

Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
---

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
index 0dfebd3bf6..3c40e2dabc 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm
@@ -1109,7 +1109,11 @@ sub fetch_copy_tags {
         }
     };
 
-    return $e->search_asset_copy_tag([$filter, { join => { acptcm => {} } }]);
+    return $e->search_asset_copy_tag([$filter, {
+        join => { acptcm => {} },
+        flesh => 1,
+        flesh_fields => { acpt => ['tag_type'] }
+    }]);
 }
 
 
diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
index 1c7a2de0dd..14c2d70ca2 100644
--- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
@@ -240,7 +240,7 @@ END; # FOREACH bib
                             [% IF tag.url %]
                             <a href="[% tag.url | html %]">
                             [% END %]
-                                [% tag.value | html %]
+                                [% tag.tag_type.label _ ": " _ tag.value | html %]
                             [% IF tag.url %]
                             </a>
                             [% END %]