Browse Source

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>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Owen Leonard 11 months ago
committed by Jonathan Druart
parent
commit
66289610fa
  1. 6
      koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc
  2. 40
      koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt
  3. 7
      koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt
  4. 41
      koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt
  5. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt
  6. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt

6
koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc

@ -53,6 +53,7 @@
[% END %]
[% END %]
[% END %]
[% BLOCK authresult %]
[% IF ( summary.label ) %][% summary.label | html %]:[% END %]
[% IF summary.summary %]
@ -63,7 +64,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 +129,7 @@
[% END %]
[% END %]
[% END %]
[% BLOCK language %]
[% SWITCH lang %]
[% CASE ['en', 'eng'] %]English

40
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,6 +88,24 @@
</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">&times;</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>
var index = "[% index | html %]";
@ -93,7 +113,25 @@
</script>
[% Asset.js("js/auth-finder-search.js") | $raw %]
<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');
}

7
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 %]

41
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">&times;</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;

2
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt

@ -180,7 +180,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&amp;op=do_search&amp;idx=an,phr&amp;q=[% authority.authid | uri %]">[% authority.count_usage | html %] record(s)</a></td>
</tr>
[% END %]

2
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt

@ -216,7 +216,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 %]

Loading…
Cancel
Save