From 5bbf80989a5b8d6a1222b0e95c242b9457dfb024 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 12 Aug 2019 11:38:57 +0000 Subject: [PATCH] Bug 13327: OPACPopupAuthorsSearch doesn't work with XSLT views This patch reimplements the OPACPopupAuthorsSearch feature so that it will work in the XSLT view. To test, apply the patch and rebuild the OPAC CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - View the detail page for a bibliographic record in the OPAC. Test under the following conditions: - OPACPopupAuthorsSearch ENABLED, OPACXSLTDetailsDisplay "default" - OPACPopupAuthorsSearch ENABLED, OPACXSLTDetailsDisplay empty - OPACPopupAuthorsSearch DISABLED, OPACXSLTDetailsDisplay "default" - OPACPopupAuthorsSearch DISABLED, OPACXSLTDetailsDisplay empty In each of these cases, test the detail page's listing of additional authors/contributors and subjects. Test records which have both multiple contributors or subjects and which have only one author or subject. When OPACPopupAuthorsSearch is turned on, verify that the author/subject selection modal appears and that your selections are correctly combined to build a search string. Note that OPACPopupAuthorsSearch feature has a problem with terms containing parentheses. The issue predates this patch. Also note that the QA tools will give a false positive about Bootstrap button styles. This rule only applies to the staff client. Signed-off-by: Liz Rea Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- .../bootstrap/en/modules/opac-detail.tt | 263 +++++++----------- .../en/xslt/MARC21slim2OPACDetail.xsl | 18 +- 2 files changed, 110 insertions(+), 171 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index d3b449351d..40421dfe5f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -125,7 +125,7 @@ [% XSLTBloc | $raw %] [% ELSE %]

[% INCLUDE 'biblio-title.inc' %]

- [% IF ( author ) %]
by [% author | html %]
[% END %] + [% IF ( author ) %]
by [% author | html %]
[% END %] [% UNLESS ( item_level_itypes ) %] [ @@ -141,60 +141,18 @@ [% IF ( MARCAUTHORS ) %]
Additional authors: - [% IF OPACPopupAuthorsSearch %] - - - [% END # /OPACPopupAuthorsSearch %] - [% FOREACH MARCAUTHOR IN MARCAUTHORS %] - [% authorsloop = loop %] [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] [% MARCAUTHOR_SUBFIELDS_LOO.separator | html %] - [% IF Koha.Preference( 'OPACPopupAuthorsSearch' ) == 1 %] - [% MARCAUTHOR_SUBFIELDS_LOO.value | html %] + [% IF ( MARCAUTHOR.authoritylink ) %] + [% ELSE %] - [% MARCAUTHOR_SUBFIELDS_LOO.value | html %] + [% END %] + [% MARCAUTHOR_SUBFIELDS_LOO.value | html %] [% END %] [% IF (MARCAUTHOR.authoritylink) %] - + [% END %] [% IF IDREF and MARCAUTHOR.unimarc3 %] IdRef @@ -265,64 +223,23 @@ [% END %] [% IF ( MARCSUBJCTS ) %] -
+
Subject(s): - [% IF OPACPopupAuthorsSearch %] - - - [% END # /OPACPopupAuthorsSearch%] - [% FOREACH MARCSUBJCT IN MARCSUBJCTS %] [% subjectsloop = loop %] [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] [% SUBFIELD.separator | html %] - [% IF Koha.Preference( 'OPACPopupAuthorsSearch' ) == 1 %] - [% SUBFIELD.value | html %] - [% ELSE %] - [% SUBFIELD.value | html %] - [% END %] + [% SUBFIELD.value | html %] [% END %] [% IF (MARCSUBJCT.authoritylink) %] - + [% END %] [% UNLESS ( loop.last ) %] | [% END %] [% END # / FOREACH MARCSUBJCTS %]
[% ELSE # /IF MARCSUBJCTS %] - [% IF ( subjects ) %]Subject(s): [% FOREACH subject IN subjects %][% subject.subject | html %] | [% END %][% END %] + [% IF ( subjects ) %]Subject(s): [% FOREACH subject IN subjects %][% subject.subject | html %] | [% END %][% END %] [% END %] [% IF ( copyrightdate ) %] @@ -1425,6 +1342,30 @@ [% END %][%# end of items_table block %] +[% IF ( OPACPopupAuthorsSearch ) %] + + +[% END %] + [% BLOCK jsinclude %] [% INCLUDE 'datatables.inc' %] [% INCLUDE 'columns_settings.inc' %] @@ -1448,6 +1389,7 @@ [% END %] - -[% IF OPACPopupAuthorsSearch %] - -[% END # / IF OPACPopupAuthorsSearch %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl index 2b0eca3be2..ecb596f828 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl @@ -778,6 +778,7 @@ + subject /cgi-bin/koha/opac-search.pl?q=an: @@ -812,11 +813,8 @@ /cgi-bin/koha/opac-authoritiesdetail.pl?authid= - - /opac-tmpl//images/filefind.png - vertical-align:middle - 15 - 15 + + fa fa-search @@ -863,7 +861,7 @@ /cgi-bin/koha/opac-authoritiesdetail.pl?authid= - /opac-tmpl//images/filefind.png + /opac-tmpl//images/z.png 15 15 @@ -1565,6 +1563,7 @@ /cgi-bin/koha/opac-search.pl?q=au:"" + contributors @@ -1793,11 +1792,8 @@ /cgi-bin/koha/opac-authoritiesdetail.pl?authid= - - /opac-tmpl//images/filefind.png - vertical-align:middle - 15 - 15 + + fa fa-search -- 2.39.5