Bug 13406: Add styling classes to authority MARC detail display
authorJane Sandberg <sandbej@linnbenton.edu>
Sun, 16 Sep 2018 18:59:40 +0000 (11:59 -0700)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 19 Sep 2018 13:45:38 +0000 (13:45 +0000)
When viewing authority MARC records in the staff client (detail view), the
MARC tags were not displaying with the tag_num, tag_desc, tag_ind1,
tag_ind2, and desc classes, which made it impossible to add styles
to these specific parts of a MARC tag.  This commit adds these
styles (which are the same as the classes in the bibliographic
MARC detail display).

To test:
1) Open the staff client, then click Authorities.
2) Search for an authority record.
3) Click on Details.
4) Examine some MARC fields.  Note that the entire tag title line
is in a single <div>.
5) Apply this commit.
6) Repeat steps 1-3.
7) Notice that the tag title line is now separated into several
spans, each with their own classes.

Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

authorities/detail.pl
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt

index 4589c62..b253238 100755 (executable)
@@ -143,7 +143,14 @@ sub build_tabs {
                                      . C4::Koha::display_marc_indicators($field) 
                                      . ' - '
                                      . $tagslib->{$field->tag()}->{lib};
+                      $tag_data{tag_number} = $tag;
+                      $tag_data{tag_desc} = $tagslib->{$field->tag()}->{lib};
                       $tag_data{subfield} = \@subfields_data;
+                      if ($tag >= 10){ # no indicator for theses tag
+                            $tag_data{ind1} = $field->indicator(1);
+                            $tag_data{ind2} = $field->indicator(2);
+                      }
+
                       push (@loop_data, \%tag_data);
                     }
                   }
index ce45987..d121519 100644 (file)
         [% IF ( innerloo.tag ) %]
             <div class="tag">
             <div class="tag_title">
-                [% innerloo.tag | html %]
+                <span class="tag_num">[% innerloo.tag_number | html %]</span>
+                [% IF (innerloo.defined("ind1") ) %]
+                    <span class="tag_ind1">[% innerloo.ind1 %]</span><span class="tag_ind2">[% innerloo.ind2 | html %]</span>
+                [% END %]
+                [% IF (innerloo.tag_desc) %]<span class="dashwrapper"> -</span> <span class="tag_desc">[% innerloo.tag_desc | html %]</span>[% END %]
             </div>
         [% ELSE %]
             <div class="tag">
@@ -74,7 +78,7 @@
             <p>
                 <label class="labelsubfield">&nbsp;
                 [% UNLESS ( subfiel.hide_marc ) %]<b>[% subfiel.marc_subfield | html %]</b>[% END %]
-                <span title="[% subfiel.long_desc | html %]">[% subfiel.short_desc | html %]</span></label>
+                <span title="[% subfiel.long_desc | html %]" class="desc">[% subfiel.short_desc | html %]</span></label>
                 [% subfiel.marc_value | html %]
                 [% IF ( subfiel.link ) %]
                     <a href="/cgi-bin/koha/catalogue/search.pl?op=do_search&amp;marclist=[% subfiel.link | html %]&amp;operator==&amp;type=intranet&amp;value=[% subfiel.marc_value |url %]">