Bugzilla – Attachment 154422 Details for
Bug 14156
Add id tags to each MARC note in the display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14156: Add id tags to each MARC note in the display
Bug-14156-Add-id-tags-to-each-MARC-note-in-the-dis.patch (text/plain), 3.35 KB, created by
Owen Leonard
on 2023-08-15 09:41:53 UTC
(
hide
)
Description:
Bug 14156: Add id tags to each MARC note in the display
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-08-15 09:41:53 UTC
Size:
3.35 KB
patch
obsolete
>From 3c98967bebb0c21ae22249a550b9fd808154ce27 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 15 Aug 2023 07:36:43 +0000 >Subject: [PATCH] Bug 14156: Add id tags to each MARC note in the display > >This patch adds tag number to the data which is returned by >$biblio->get_marc_notes(). The bibliographic detail page in the staff >client is modified to use the tag number in both a class (for consistent >styling across the same tag number) and id (for unique styling for each >repeated tag). > >To test, apply the patch and restart services. > >- As a quick test for custom CSS, go to Administration -> System > preferences and locate the IntranetUserCSS preference. > - Add this testing CSS: > > .marcnote { font-size:140%; font-family: serif; } > .marcnote-500 { background-color: #66FFCC; } > .marcnote-511 { background-color: #99FFFF; } > .marcnote-520 { background-color: #CCFF00; } > .marcnote-521 { background-color: #CCFFFF; } > .marcnote-538 { background-color: #FFCCCC; } > .marcnote-546 { background-color: #FFFFCC; } > >- Locate a record with multiple notes fields. In the sample data, record > 46, "Viridiana" is a good example which works well with the above CSS. >- On the bibliographic detail page for the record, click the > "Descriptions" tab. > - Each MARC note should be colored according to the tag it comes from. > - Inspect the HTML to confirm that each paragraph also has its own > unique ID. >--- > Koha/Biblio.pm | 4 ++-- > .../prog/en/modules/catalogue/detail.tt | 12 ++++++------ > 2 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 125e5df8508..3102f2163ec 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -1080,10 +1080,10 @@ sub get_marc_notes { > push @marcnotes, { marcnote => $field->as_string($othersub) }; > foreach my $sub ( $field->subfield('u') ) { > $sub =~ s/^\s+|\s+$//g; # trim >- push @marcnotes, { marcnote => $sub }; >+ push @marcnotes, { marcnote => $sub, tag => $tag }; > } > } else { >- push @marcnotes, { marcnote => $field->as_string() }; >+ push @marcnotes, { marcnote => $field->as_string(), tag => $tag }; > } > } > return \@marcnotes; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 2d7c7a15352..20696ca2176 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -738,12 +738,12 @@ > <div class="content_set"> > > [% FOREACH MARCNOTE IN MARCNOTES %] >- <p> >- [% IF MARCNOTE.marcnote.match('^https?://\S+$') %] >- <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a> >- [% ELSE %] >- [% MARCNOTE.marcnote | html | html_line_break %] >- [% END %] >+ <p class="marcnote marcnote-[% MARCNOTE.tag | html %]" id="marcnote-[% MARCNOTE.tag | html %]-[% loop.count | html %]"> >+ [% IF MARCNOTE.marcnote.match('^https?://\S+$') %] >+ <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a> >+ [% ELSE %] >+ [% MARCNOTE.marcnote | html | html_line_break %] >+ [% END %] > </p> > [% END %] > </div> >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14156
:
154422
|
155577
|
155601