Bugzilla – Attachment 88776 Details for
Bug 12533
Improve authority search result display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12533: Improve authority search result display
Bug-12533-Improve-authority-search-result-display.patch (text/plain), 13.88 KB, created by
PTFS Europe Sandboxes
on 2019-04-25 13:18:38 UTC
(
hide
)
Description:
Bug 12533: Improve authority search result display
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2019-04-25 13:18:38 UTC
Size:
13.88 KB
patch
obsolete
>From 48959cd065f7fadd7bcd9212caee4ea71c45350b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 6 Mar 2019 17:12:17 +0000 >Subject: [PATCH] Bug 12533: Improve authority search result display > >This patch implements a few changes in the way authority records are >displayed in search results. > > - In most cases heading type is now displayed as a separate column in > the table of search results. > - The heading itself is now linked rather than a separate "details" > link. > >In the authority search results for MARC editor plugins the heading link >triggers a modal with the authority details instead of linking to a >separate page. > >To test, apply the patch and go to Authorities. > > - Perform an authority search which will return results. > - In the search results headings should be linked to the > corresponding detail page. > - There should be a separate column for heading type. > - Go to Cataloging and create a new record using a framework which has > a field linked to an authority type (e.g. 100a -> PERSO_NAME ). > - Perform a search which will return results. > - In the search results, clicking a heading link should trigger a > modal window with the authority details. > - Test multiple entries in the results and confirm that each > time the correct data is loaded into the modal window. > - Test the same process for a field which is linked to the > unimarc_field_210c.pl plugin. > - Go to Tools -> Batch record modification and submit multiple > authority record numbers. > - In the results list the heading should be linked correctly to the > corresponding detail page. Heading type is not present in this > view. > - Perform the same test with batch record deletion. > >Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> > >Signed-off-by: Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> >--- > .../en/includes/authorities-search-results.inc | 7 +++- > .../modules/authorities/searchresultlist-auth.tt | 44 ++++++++++++++++++++-- > .../en/modules/authorities/searchresultlist.tt | 7 ++-- > .../value_builder/unimarc_field_210c.tt | 41 +++++++++++++++++++- > .../prog/en/modules/tools/batch_delete_records.tt | 2 +- > .../en/modules/tools/batch_record_modification.tt | 2 +- > 6 files changed, 91 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc >index 3832d3c5ca..fe6cbc87fd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc >@@ -53,8 +53,8 @@ > [% END %] > [% END %] > [% END %] >+ > [% BLOCK authresult %] >- [% IF ( summary.label ) %][% summary.label | html %]:[% END %] > [% IF summary.summary %] > <div class="authority-summary"> > [% summary.summary | html %] >@@ -63,7 +63,9 @@ > [% UNLESS ( summary.summaryonly ) %] > <div class="authorizedheading"> > [% FOREACH authorize IN summary.authorized %] >- <span class="authorizedheading">[% authorize.heading | html %]</span> >+ <span class="authorizedheading"> >+ <a data-authid="[% authid | html %]" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | uri %]">[% authorize.heading | html %]</a> >+ </span> > [% UNLESS loop.last %] | [% END %] > [% END %] > </div> >@@ -126,6 +128,7 @@ > [% END %] > [% END %] > [% END %] >+ > [% BLOCK language %] > [% SWITCH lang %] > [% CASE ['en', 'eng'] %]English >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 b50ebbc9af..39b676e4ea 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 >@@ -42,13 +42,15 @@ > <table> > <tr> > <th>Summary</th> >+ <th>Heading type</th> > <th>Used</th> > <th>Get it!</th> > <th>Other action</th> > </tr> > [% FOREACH resul IN result %] > <tr> >- <td>[% PROCESS authresult summary=resul.summary %]</td> >+ <td>[% PROCESS authresult summary=resul.summary authid=resul.authid %]</td> >+ <td>[% resul.summary.label | html %]</td> > <td>[% resul.used | html %] times</td> > <td> > [% IF resul.summary && resul.summary.authorized && resul.summary.authorized.size > 1 %] >@@ -86,14 +88,50 @@ > </div>[% END %] > </div> > >+<!-- Authority details modal --> >+<div class="modal" id="authorityDetail" tabindex="-1" role="dialog" aria-labelledby="authorityDetailLabel"> >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >+ <h4 class="modal-title" id="authorityDetailLabel"></h4> >+ </div> >+ <div class="modal-body"> >+ <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> >+ </div> >+ <div class="modal-footer"> >+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> >+ </div> >+ </div> >+ </div> >+</div> >+ > [% MACRO jsinclude BLOCK %] >- <script type="text/javascript"> >+ <script> > var index = "[% index | html %]"; > var authtypecode = "[% authtypecode | html %]"; > </script> > [% Asset.js("js/auth-finder-search.js") | $raw %] >- <script type="text/javascript"> >+ <script> >+ $(document).ready(function(){ >+ $(".authorizedheading a").on("click", function(e){ >+ e.preventDefault(); >+ var authid = $(this).data("authid"); >+ >+ $.get("/cgi-bin/koha/authorities/detail.pl", { authid : authid }, function( data ){ >+ var auth_detail = $(data).find("#authoritiestabs"); >+ auth_detail.find("ul").remove(); >+ $("#authorityDetail .modal-title").html(_("Authority") + " " + authid ); >+ $("#authorityDetail .modal-body").html( auth_detail ); >+ }); > >+ $("#authorityDetail").modal("show"); >+ }); >+ $("#authorityDetail").on("hidden.bs.modal", function(){ >+ $("#authorityDetail .modal-body, #authorityDetail .modal-title").html(""); >+ $("#authorityDetail .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /></div>"); >+ }); >+ }); > function jumpfull(page){ > window.open(page,'','width=100,height=100,resizable=yes,toolbar=false,scrollbars=yes,top'); > } >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 9da4f2780e..808c33c6a3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >@@ -30,7 +30,8 @@ > <div id="authorities_searchresultlist_results"> > <table> > <tr> >- <th colspan="2">Summary</th> >+ <th>Summary</th> >+ <th>Heading type</th> > [% UNLESS ( isEDITORS ) %] > <th>Used in</th> > [% END %] >@@ -40,8 +41,8 @@ > </tr> > [% FOREACH resul IN result %] > <tr data-authid="[% resul.authid | html %]"> >- <td>[% PROCESS authresult summary=resul.summary %]</td> >- <td><a href="detail.pl?authid=[% resul.authid | uri %]">Details</a></td> >+ <td>[% PROCESS authresult summary=resul.summary authid=resul.authid %]</td> >+ <td>[% resul.summary.label | html %]</td> > [% UNLESS ( resul.isEDITORS ) %] > <td> > [% IF resul.used > 0 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt >index 0ce0861bad..7fb4807599 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt >@@ -58,12 +58,14 @@ > <table> > <tr> > <th>Summary</th> >+ <th>Heading type</th> > <th>Used</th> > <th>Get it!</th> > </tr> > [% FOREACH resul IN result %] > <tr> >- <td>[% PROCESS authresult summary=resul.summary %]</td> >+ <td>[% PROCESS authresult summary=resul.summary authid=resul.authid %]</td> >+ <td>[% resul.summary.label | html %]</td> > <td>[% resul.used | html %] times</td> > <td> > [% IF ( resul.to_report ) %] >@@ -82,13 +84,48 @@ > </div> > [% END %] > >+<!-- Authority details modal --> >+<div class="modal" id="authorityDetail" tabindex="-1" role="dialog" aria-labelledby="authorityDetailLabel"> >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >+ <h4 class="modal-title" id="authorityDetailLabel"></h4> >+ </div> >+ <div class="modal-body"> >+ <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> >+ </div> >+ <div class="modal-footer"> >+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> >+ </div> >+ </div> >+ </div> >+</div> >+ > [% MACRO jsinclude BLOCK %] >- <script type="text/javascript"> >+ <script> > $(document).ready(function(){ > $(".choosebt").on("click",function(){ > var toreport = $(this).siblings(".toreport").text(); > report(toreport); > }); >+ $(".authorizedheading a").on("click", function(e){ >+ e.preventDefault(); >+ var authid = $(this).data("authid"); >+ >+ $.get("/cgi-bin/koha/authorities/detail.pl", { authid : authid }, function( data ){ >+ var auth_detail = $(data).find("#authoritiestabs"); >+ auth_detail.find("ul").remove(); >+ $("#authorityDetail .modal-title").html(_("Authority") + " " + authid ); >+ $("#authorityDetail .modal-body").html( auth_detail ); >+ }); >+ >+ $("#authorityDetail").modal("show"); >+ }); >+ $("#authorityDetail").on("hidden.bs.modal", function(){ >+ $("#authorityDetail .modal-body, #authorityDetail .modal-title").html(""); >+ $("#authorityDetail .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /></div>"); >+ }); > }); > function report(summary){ > var doc = opener.document; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >index 50040559ce..c50a6f4a3a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt >@@ -182,7 +182,7 @@ > <tr> > <td><input type="checkbox" name="record_id" value="[% authority.authid | html %]" data-usage="[% authority.count_usage | html %]" /></td> > <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid | uri %]">[% authority.authid | html %]</a></td> >- <td>[% PROCESS authresult summary=authority.summary %]</td> >+ <td>[% PROCESS authresult summary=authority.summary authid=authority.authid %]</td> > <td><a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&op=do_search&idx=an,phr&q=[% authority.authid | uri %]">[% authority.count_usage | html %] record(s)</a></td> > </tr> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >index bd58fd2398..6faab1772e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt >@@ -221,7 +221,7 @@ > <tr> > <td><input type="checkbox" name="record_id" value="[% authority.authid | html %]" data-usage="[% authority.count_usage | html %]" /></td> > <td><a href="/cgi-bin/koha/authorities/detail.pl?authid=[% authority.authid | uri %]">[% authority.authid | html %]</a></td> >- <td>[% PROCESS authresult summary=authority.summary %]</td> >+ <td>[% PROCESS authresult summary=authority.summary authid=authority.authid %]</td> > <td class="actions"><a href="/cgi-bin/koha/svc/records/preview?record_type=authority&record_id=[% authority.authid | uri %]&mmtid=[% mmtid | uri %]" data-record_type="authority" data-record_id="[% authority.authid | html %]" data-mmtid="[% mmtid | html %]" class="previewMARC btn btn-default btn-xs"><i class='fa fa-eye'></i> Show MARC</a> > </tr> > [% END %] >-- >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 12533
:
86199
|
88774
|
88776
|
112104
|
112175
|
112183
|
112185
|
112186