From fe4eee6cac99390abca28b2c09afbdb82ceb03ed Mon Sep 17 00:00:00 2001 From: Aleisha Date: Mon, 29 Feb 2016 00:42:28 +0000 Subject: [PATCH] [SIGNED-OFF] Bug 15931: Removing link to records if authority is not used by 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 authorities which are used in records should work as expected. Sponsored-by: Catalyst IT Signed-off-by: Nick Clemens --- koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt | 8 +++++--- .../prog/en/modules/authorities/searchresultlist.tt | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt index 737130a..fddd91f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt @@ -90,9 +90,11 @@ function searchauthority() {

Authority #[% authid %] ([% authtypetext %])

- - - Used in [% count %] record(s) + [% IF count > 0 %] + Used in [% count %] record(s) + [% ELSE %] + Used in 0 records + [% END %]
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 be2e156..6d40e13 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt @@ -83,7 +83,11 @@ function searchauthority() { Details [% UNLESS ( resul.isEDITORS ) %] - [% resul.used %] records(s) + [% IF resul.used > 0 %] + [% resul.used %] records(s) + [% ELSE %] + 0 records + [% END %] [% END %] [% IF ( CAN_user_editauthorities ) %] -- 1.7.10.4