From 799d3357313295b7e97f1752d11a483dd7cc573e Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 18 Sep 2013 12:18:20 -0300 Subject: [PATCH] [SIGNED-OFF] Bug 10691: 5xx not properly linked by authid in authority search result list [Staff] This patch changes the URL and data used to show the 'see also' links on the Staff'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 entries with plain text (i.e. no linking) - Make sure zebra is running and changes got indexed. - In the staff interface 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 for linked authorities, and to an authority search result in the case of plain text entries. - Check that the authority search from the cataloguing interface still works as usual. Regards To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Bernardo Gonzalez Kriegel Work as described. No errors --- .../en/includes/authorities-search-results.inc | 110 ++++++++++++-------- .../en/modules/authorities/searchresultlist.tt | 2 +- 2 files changed, 70 insertions(+), 42 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc index 366c695..8fda26b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc @@ -1,4 +1,7 @@ [% BLOCK showreference %] + [% SET authidurl = '/cgi-bin/koha/authorities/detail.pl?authid=' %] + [% SET searchurl = '/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&orderby=HeadingAsc&value=' %] + [% IF marcflavour == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] @@ -11,69 +14,94 @@ RT: [% heading | html %] [% END %] [% ELSE %] - [% IF ( label ) %][% label | html %][% 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 %] + [% ELSIF ( type=='seealso' ) %] + [% 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 %] - [% 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 %] [% END %] [% BLOCK authresult %] [% IF ( summary.summary ) %][% summary.summary | html %]:[% END %] [% UNLESS ( summary.summaryonly ) %]
- [% FOREACH authorize IN summary.authorized %] - [% authorize.heading | html %] - [% END %] + [% FOREACH authorize IN summary.authorized %] + [% authorize.heading | html %] + [% END %]
[% IF ( marcflavour == 'UNIMARC' ) %] - [% IF summary.notes %] -
- [% FOREACH note IN summary.notes %] - [% note.note | html %] - [% END %] -
- [% END %] - [% IF summary.seealso %] -
- [% FOREACH see IN summary.seealso %] - [% PROCESS showreference heading=see.heading label="" type=see.type search='' %] - [% IF ! loop.last %] ; [% END %] + [% IF summary.notes %] +
+ [% FOREACH note IN summary.notes %] + [% note.note | html %] + [% END %] +
[% END %] -
- [% END %] - [% IF summary.otherscript %] -
- [% FOREACH other IN summary.otherscript %] - [% PROCESS language lang=other.lang | trim %]: - [% other.term %] - [% IF ! loop.last %] ; [% END %] + [% IF summary.seealso %] +
+ [% FOREACH see IN summary.seealso %] + [% PROCESS showreference heading=see.heading label="" type=see.type search='' %] + [% IF ! loop.last %] ; [% END %] + [% END %] +
+ [% END %] + [% IF summary.otherscript %] +
+ [% FOREACH other IN summary.otherscript %] + [% PROCESS language lang=other.lang | trim %]: + [% other.term %] + [% IF ! loop.last %] ; [% END %] + [% END %] +
[% END %] -
- [% END %] - [% ELSE %] [% 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 + authid=seefro.authid + %]
[% 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/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt index ea16505..808881a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt @@ -77,7 +77,7 @@ function searchauthority() { [% ELSE %] [% END %] - [% PROCESS authresult summary=resul.summary link="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&orderby=HeadingAsc&value=" %] + [% PROCESS authresult summary=resul.summary %] Details [% UNLESS ( resul.isEDITORS ) %] -- 1.7.9.5