From ae7431608cfa2f9aa2674079d17f3b96fa12c8c7 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 18 Sep 2013 11:33:07 -0300 Subject: [PATCH] Bug 10691: use authority ID in see-also links in authority search results (OPAC) This patch changes the URL and data used to show the 'see also' links on the OPAC's authority search results page. Bonus points: makes some strings translatable. To test: - On your dev setup (master) create some authority records (I created personal name authorities). - Pick one of them and link 400$a to another one, do the same with 500$a - Add some other 400$a and 500$a without linking (i.e. plain text) - Make sure zebra is running and changes got indexed. - In the OPAC search for the authority that is linked to the others. - Check the 'see also:' link points to an authority search - Apply the patch - Reload/re-do the search - Check the 'see also:' link points to the authority id in the case of linked authorities, and to an authority search in the case of plain text headings. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Bernardo Gonzalez Kriegel Work as described. No errors Signed-off-by: Jonathan Druart Signed-off-by: Jared Camins-Esakov Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- .../includes/authorities-search-results.inc | 60 +++++++++++++------ .../opac-authoritiessearchresultlist.tt | 58 +++++++++--------- 2 files changed, 71 insertions(+), 47 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc index ea2aa168ae..b3371aacc7 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc @@ -1,4 +1,6 @@ [% BLOCK showreference %] + [% SET authidurl = '/cgi-bin/koha/opac-authoritiesdetail.pl?authid=' %] + [% SET searchurl = '/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&value=' %] [% IF marcflavour == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] @@ -11,24 +13,39 @@ RT: [% heading | html %] [% END %] [% ELSE %] - [% IF ( label ) %][% SWITCH label %] - [% CASE 'see also:' %]see also: - [% CASE 'used for/see from:' %]used for/see from: - [% END %][% END %] + + [% IF ( type=='seefrom' ) %] + used for/see from: + [% ELSIF ( type=='seealso' ) %] + see also: + [% END %] + - [% IF ( linkpath && search ) %][% heading | html %] - [% ELSE %][% heading | html %][% END %] + [% IF ( type=='seealso' ) %] + [% IF ( authid ) %] + [% heading | html %] + [% ELSE %] + [% heading | html %] + [% END %] + [% ELSE %] + [% heading | html %] + [% END %] - [% UNLESS ( type=='seefrom' || type=='seealso' ) %][% SWITCH type %] - [% CASE 'earlier' %](Earlier heading) - [% CASE 'later' %](Later heading) - [% CASE 'acronym' %](Acronym) - [% CASE 'musical' %](Musical composition) - [% CASE 'broader' %](Broader heading) - [% CASE 'narrower' %](Narrower heading) - [% CASE 'parent' %](Immediate parent body) - [% CASE %][% IF type %]([% type | html %])[% END %] - [% END %][% END %] + [% UNLESS ( type=='seefrom' || type=='seealso' ) %] + + [% SWITCH type %] + [% CASE 'earlier' %](Earlier heading) + [% CASE 'later' %](Later heading) + [% CASE 'acronym' %](Acronym) + [% CASE 'musical' %](Musical composition) + [% CASE 'broader' %](Broader heading) + [% CASE 'narrower' %](Narrower heading) + [% CASE 'parent' %](Immediate parent body) + [% CASE %][% IF type %]([% type | html %]) + [% END %] + [% END %] + + [% END %] [% END %] [% END %] [% BLOCK authresult %] @@ -76,14 +93,21 @@ [% IF ( summary.seefrom ) %] [% FOREACH seefro IN summary.seefrom %]
- [% PROCESS showreference heading=seefro.heading label="used for/see from:" type=seefro.type search='' %] + [% PROCESS showreference + heading=seefro.heading + type=seefro.type + %]
[% END %] [% END %] [% IF ( summary.seealso ) %] [% FOREACH seeals IN summary.seealso %]
- [% PROCESS showreference heading=seeals.heading label="see also:" type=seeals.type linkpath=link search=seeals.search %] + [% PROCESS showreference + heading=seeals.heading + type=seeals.type + authid=seeals.authid + %]
[% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt index 6f889b0f12..7f80fe008d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tt @@ -44,35 +44,35 @@ [% IF ( total ) %]
- - - - - [% UNLESS ( isEDITORS ) %] - - [% END %] - - - [% FOREACH resul IN result %] - [% UNLESS ( loop.odd ) %] - - [% ELSE %] - - [% END %] - - - [% UNLESS ( resul.isEDITORS ) %] - - [% END %] - - - [% END %] -
Authorized headingsType of headingBiblio recordsFull heading
[% PROCESS authresult summary=resul.summary link="/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operatorc=contains&marclistc=mainentry&and_orc=and&orderby=HeadingAsc&value=" %][% resul.authtype %] - [% resul.used %] biblios - - View full heading -
-
+ + + + + [% UNLESS ( isEDITORS ) %] + + [% END %] + + +[% FOREACH resul IN result %] + [% UNLESS ( loop.odd ) %] + + [% ELSE %] + + [% END %] + + + [% UNLESS ( resul.isEDITORS ) %] + + [% END %] + + +[% END %] +
Authorized headingsType of headingBiblio recordsFull heading
[% PROCESS authresult summary=resul.summary %][% resul.authtype %] + [% resul.used %] biblios + + View full heading +
+
[% IF ( displayprev ) %] << -- 2.39.5