From 7803f4aa26e391c26c8cb3b88746254dbbc0d582 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Mon, 26 Sep 2011 16:38:11 +0200 Subject: [PATCH] bug 6919 - Implementing XSLTResultsDisplay --- C4/Search.pm | 7 +- .../prog/en/modules/catalogue/results.tt | 6 ++- .../prog/en/xslt/MARC21slim2intranetResults.xsl | 43 ++++++++++++ .../prog/en/xslt/UNIMARCslim2intranetResults.xsl | 69 ++++++++++++++++++++ 4 files changed, 120 insertions(+), 5 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetResults.xsl diff --git a/C4/Search.pm b/C4/Search.pm index c3cff65..c34009f 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1743,12 +1743,11 @@ sub searchResults { use C4::Charset; SetUTF8Flag($marcrecord); $debug && warn $marcrecord->as_formatted; - if (!$scan && $search_context eq 'opac' && C4::Context->preference("OPACXSLTResultsDisplay")) { - # FIXME note that XSLTResultsDisplay (use of XSLT to format staff interface bib search results) - # is not implemented yet + my $interface = $search_context eq 'opac' ? 'OPAC' : ''; + if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) { $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, 'Results', $search_context, 1); - # the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs + # the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 7a1039d..71baeff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -439,8 +439,11 @@ YAHOO.util.Event.onContentReady("searchheader", function () { + [% IF ( SEARCH_RESULT.XSLTResultsRecord ) %] + [% SEARCH_RESULT.XSLTResultsRecord %] + [% ELSE %]

[% SEARCH_RESULT.result_number %]. - [% biblionumber = SEARCH_RESULT.biblionumber %] + [% biblionumber = SEARCH_RESULT.biblionumber %] [% INCLUDE 'biblio-default-view.inc' %] [% IF ( SEARCH_RESULT.title ) %][% SEARCH_RESULT.title |html %][% ELSE %]No title[% END %] @@ -495,6 +498,7 @@ YAHOO.util.Event.onContentReady("searchheader", function () { [% END %] [% END %] + [% END %]

[% IF ( SEARCH_RESULT.norequests ) %] No holds allowed [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl new file mode 100644 index 0000000..e71188b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + /cgi-bin/koha/catalogue/detail.pl?biblionumber= + + + + + : + + + + : + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetResults.xsl new file mode 100644 index 0000000..88c9026 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetResults.xsl @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + /cgi-bin/koha/catalogue/detail.pl?biblionumber= + + + + + + + : + + + + [ + + ] + + + : + + + + : + + + + / + + + + ; + + + + + + + + + + + + + + -- 1.7.0.4