Browse Source

Bug 15931: Removing link to records if authority is not used by any records

EDIT:
Fixing typo: records(s) -> record(s)
On details page, if authority is not used in any records, the page will display a more used friendly message: "This authority is not used in any records."

To test:
1) Do an authority search on authorities-home.pl. Notice that authorities not used in any records have a clickable link (under 'Used in:' column) which redirects to a catalog search with no results
2) Go back to your authority search results on authorities-home.pl and click 'Details'. Notice that under the auth name, there is a 'Used in X records' link that again returns a catalog search with no results.
3) Apply patch
4) Repeat steps 1, 2. Authorities not used in any records should no longer have clickable links and links to authorities which are used in records should work as expected.
5) Confirm it now says record(s) instead of records(s)
6) Confirm that on detail page for an authority which is not used by any records, it now says more friendly message.

Sponsored-by: Catalyst IT

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marc Véron <veron@veron.ch>

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

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
new_12478_elasticsearch
Aleisha 6 years ago
committed by Brendan A Gallagher
parent
commit
19f9673a3b
  1. 8
      koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt
  2. 6
      koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt

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

@ -90,9 +90,11 @@ function searchauthority() {
<h1>Authority #[% authid %] ([% authtypetext %])</h1>
<div id="action">
Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an=[% authid %]">[% count %] record(s)</a>
[% IF count > 0 %]
Used in <a href="/cgi-bin/koha/catalogue/search.pl?type=intranet&amp;op=do_search&amp;q=an=[% authid %]">[% count %] record(s)</a>
[% ELSE %]
This authority is not used in any records.
[% END %]
</div>
<div id="authoritiestabs" class="toptabs numbered">

6
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt

@ -80,7 +80,11 @@ function searchauthority() {
<td><a href="detail.pl?authid=[% resul.authid %]">Details</a></td>
[% UNLESS ( resul.isEDITORS ) %]
<td>
<a href="../catalogue/search.pl?type=intranet&amp;op=do_search&amp;idx=an,phr&amp;q=[% resul.authid %]" class="button">[% resul.used %] records(s)</a>
[% IF resul.used > 0 %]
<a href="../catalogue/search.pl?type=intranet&amp;op=do_search&amp;idx=an,phr&amp;q=[% resul.authid %]" class="button">[% resul.used %] record(s)</a>
[% ELSE %]
0 records
[% END %]
</td>
[% END %]
[% IF ( CAN_user_editauthorities ) %]

Loading…
Cancel
Save