Bugzilla – Attachment 131583 Details for
Bug 29990
Show authority heading use in search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29990: Show authority appropriate heading use on search results
Bug-29990-Show-authority-appropriate-heading-use-o.patch (text/plain), 6.68 KB, created by
Aleisha Amohia
on 2022-03-10 22:43:44 UTC
(
hide
)
Description:
Bug 29990: Show authority appropriate heading use on search results
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2022-03-10 22:43:44 UTC
Size:
6.68 KB
patch
obsolete
>From fe557e603f9828e37cd4b72fa80e9157fb9b797b Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 23 Sep 2020 17:33:29 +1200 >Subject: [PATCH] Bug 29990: Show authority appropriate heading use on search > results > >Authority heading use is based on authority MARC 008/14-16. This could >be useful to show on authority search results, if new system preference >ShowHeadingUse is enabled. > >To test: > >1. Apply patches, update database, restart services >2. Go to Koha Administration -> system preferences -> searching tab. >Notice new ShowHeadingUse system preference is disabled. Leave it >disabled for now. >3. Do an authority search. Confirm it works as expected and no new >information is shown since ShowHeadingUse is disabled. >4. Do a biblio search and edit a record. Go to one of the authority >fields (1xx, 6xx or 7xx) and launch the authority finder plugin. Do an >authority search and confirm it works as expected and no new information >is shown since ShowHeadingUse is disabled. >5. Go back to system preferences and enable ShowHeadingUse syspref. >6. Repeat steps 3 and 4 but confirm the 'Heading use' column now shows, and >correctly displays what the heading can be used for based on 008/14-16. > >Sponsored-by: Education Services Australia SCIS >--- > C4/AuthoritiesMarc.pm | 12 ++++++++++++ > .../en/modules/authorities/searchresultlist-auth.tt | 20 ++++++++++++++++++++ > .../prog/en/modules/authorities/searchresultlist.tt | 20 ++++++++++++++++++++ > 3 files changed, 52 insertions(+) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 36cbf5c43b..a7915e9056 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -301,6 +301,18 @@ sub SearchAuthorities { > } > my $summary = BuildSummary( $authrecord, $authid, $thisauthtypecode ); > >+ if ( C4::Context->preference('ShowHeadingUse') ) { >+ # checking valid heading use >+ my $f008 = $authrecord->field('008'); >+ my $pos14to16 = substr( $f008->data, 14, 3 ); >+ my $main = substr( $pos14to16, 0, 1 ); >+ $newline{main} = 1 if $main eq 'a'; >+ my $subject = substr( $pos14to16, 1, 1); >+ $newline{subject} = 1 if $subject eq 'a'; >+ my $series = substr( $pos14to16, 2, 1 ); >+ $newline{series} = 1 if $series eq 'a'; >+ } >+ > $newline{authtype} = defined($thisauthtype) ? > $thisauthtype->authtypetext : ''; > $newline{summary} = $summary; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >index ea9754225a..d60a3ce1df 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >@@ -1,11 +1,21 @@ > [% USE raw %] > [% USE Asset %] >+[% USE Koha %] > [% SET footerjs = 1 %] > [% PROCESS 'authorities-search-results.inc' %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Cataloging authority plugin › Koha</title> > [% INCLUDE 'doc-head-close.inc' %] > [% Asset.css("css/addbiblio.css") | $raw %] >+<style> >+.usefor { >+ padding: 0; >+ margin: 0; >+} >+.usefor li { >+ list-style-type: none; >+} >+</style> > </head> > > <body id="auth_searchresultlist_auth" class="auth"> >@@ -45,6 +55,9 @@ > <th>Summary</th> > <th>Heading type</th> > <th>Used</th> >+ [% IF Koha.Preference('ShowHeadingUse') %] >+ <th>Heading use</th> >+ [% END %] > <th>Get it!</th> > <th>Other action</th> > </tr> >@@ -53,6 +66,13 @@ > <td>[% PROCESS authresult summary=resul.summary authid=resul.authid auth_preview=1 %]</td> > <td>[% resul.summary.label | html %]</td> > <td>[% resul.used | html %] times</td> >+ [% IF Koha.Preference('ShowHeadingUse') %] >+ <td class="actions"><ul class="usefor"> >+ <li>[% IF resul.main %]<i class="fa fa-check"></i>[% ELSE %]<i class="fa fa-times"></i>[% END %] Main/Added Entry</li> >+ <li>[% IF resul.subject %]<i class="fa fa-check"></i>[% ELSE %]<i class="fa fa-times"></i>[% END %] Subject</li> >+ <li>[% IF resul.series %]<i class="fa fa-check"></i>[% ELSE %]<i class="fa fa-times"></i>[% END %] Series Title</li> >+ </ul></td> >+ [% END %] > <td> > [% IF resul.summary && resul.summary.authorized && resul.summary.authorized.size > 1 %] > [% FOREACH authorized IN resul.summary.authorized %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >index e5de11f17c..6868f2e80f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >@@ -1,11 +1,21 @@ > [% USE raw %] > [% USE Asset %] >+[% USE Koha %] > [% SET footerjs = 1 %] > [% PROCESS 'authorities-search-results.inc' %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Authority search results › Authorities › Koha</title> > [% INCLUDE 'doc-head-close.inc' %] > [% Asset.css("css/addbiblio.css") | $raw %] >+<style> >+.usefor { >+ padding: 0; >+ margin: 0; >+} >+.usefor li { >+ list-style-type: none; >+} >+</style> > </head> > > <body id="auth_searchresultlist" class="auth"> >@@ -51,6 +61,9 @@ > [% UNLESS ( isEDITORS ) %] > <th>Used in</th> > [% END %] >+ [% IF Koha.Preference('ShowHeadingUse') %] >+ <th>Heading use</th> >+ [% END %] > [% IF ( CAN_user_editauthorities ) %] > <th> </th> > [% END %] >@@ -68,6 +81,13 @@ > [% END %] > </td> > [% END %] >+ [% IF Koha.Preference('ShowHeadingUse') %] >+ <td class="actions"><ul class="usefor"> >+ <li>[% IF resul.main %]<i class="fa fa-check"></i>[% ELSE %]<i class="fa fa-times"></i>[% END %] Main/Added Entry</li> >+ <li>[% IF resul.subject %]<i class="fa fa-check"></i>[% ELSE %]<i class="fa fa-times"></i>[% END %] Subject</li> >+ <li>[% IF resul.series %]<i class="fa fa-check"></i>[% ELSE %]<i class="fa fa-times"></i>[% END %] Series Title</li> >+ </ul></td> >+ [% END %] > [% IF ( CAN_user_editauthorities ) %] > <td> > <div class="btn-group dropup"> >-- >2.11.0
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 29990
:
130034
|
130035
|
131583
|
131617
|
132606
|
132607
|
132608
|
133128