From a45a6618ebfee06f57c08c260fc596eba54be0b5 Mon Sep 17 00:00:00 2001 From: Aleisha Date: Mon, 29 Feb 2016 00:42:28 +0000 Subject: [PATCH] Bug 15931: Removing link to records if authority is not used by any records MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Marc VĂ©ron Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt | 8 +++++--- .../intranet-tmpl/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..3b7f262 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 %] + This authority is not used in any 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 739d033..317a376 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt @@ -80,7 +80,11 @@ function searchauthority() { Details [% UNLESS ( resul.isEDITORS ) %] - [% resul.used %] records(s) + [% IF resul.used > 0 %] + [% resul.used %] record(s) + [% ELSE %] + 0 records + [% END %] [% END %] [% IF ( CAN_user_editauthorities ) %] -- 2.7.0