GetByCode_FFZG which filters LOC "floor, desc" to just "floor"
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 17 Mar 2020 13:41:24 +0000 (14:41 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 17 Mar 2020 13:42:23 +0000 (14:42 +0100)
Koha/Template/Plugin/AuthorisedValues.pm
koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt

index 95b0c4c..92f35e3 100644 (file)
@@ -34,6 +34,18 @@ sub GetByCode {
             : $code;
 }
 
+sub GetByCode_FFZG {
+    my ( $self, $category, $code, $opac ) = @_;
+    my $av = Koha::AuthorisedValues->search({ category => $category, authorised_value => $code });
+    my $label = $av->count
+            ? $opac
+                ? $av->next->opac_description
+                : $av->next->lib
+            : $code;
+    $label =~ s/,.+$// if $category eq 'LOC'; # XXX FFZG strip kat, description
+    return $label;
+}
+
 sub Get {
     my ( $self, $category, $selected, $opac ) = @_;
     return GetAuthorisedValues( $category, $selected, $opac );
index 02e94b0..3ffd406 100644 (file)
         </td>
         <td>
         [% FOREACH loc IN reserveloo.locations %]
-            [% AuthorisedValues.GetByCode('LOC', loc) | html %]
+            [% AuthorisedValues.GetByCode_FFZG('LOC', loc) | html %]
         [% END %]
         </td>
         <td>