From a84776d189403b694f95b7b380d2e2b0dac2d94a 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 --- 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..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 18cea64..79a355d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt @@ -79,7 +79,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 ) %] -- 1.7.10.4