From 8140a01f8fe1a88954a9474347af0f2e6d8a70fd Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Tue, 27 Sep 2011 10:07:39 +0200 Subject: [PATCH] bug 6919 - Implementing XSLTResultsDisplay - new patch --- C4/Search.pm | 10 +-- .../prog/en/modules/catalogue/results.tt | 4 + .../prog/en/xslt/MARC21slim2intranetResults.xsl | 46 +++++++++++++ .../prog/en/xslt/UNIMARCslim2intranetResults.xsl | 69 ++++++++++++++++++++ 4 files changed, 123 insertions(+), 6 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..c3a885a 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1743,13 +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 - $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, 'Results', + 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 } # if biblio level itypes are used and itemtype is notforloan, it can't be reserved either 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..1e5fbc5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -439,6 +439,9 @@ YAHOO.util.Event.onContentReady("searchheader", function () { + [% IF ( SEARCH_RESULT.XSLTResultsRecord ) %] + [% SEARCH_RESULT.XSLTResultsRecord %] + [% ELSE %]

[% SEARCH_RESULT.result_number %]. [% biblionumber = SEARCH_RESULT.biblionumber %] @@ -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..8fabaa9 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + /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