From 10eb5ae42019ecda7795228cfb1a8cd09c2df726 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Fri, 7 Oct 2011 16:59:52 +0200 Subject: [PATCH] bug 6919 - implements XSLTResultsDisplay and adding both unimarc and marc21 xslt Signed-off-by: Owen Leonard Signed-off-by: Jared Camins-Esakov --- C4/Search.pm | 13 +- .../prog/en/modules/catalogue/results.tt | 4 + .../en/xslt/MARC21slim2intranetResults.xsl | 1021 +++++++++++++++++ .../en/xslt/UNIMARCslim2intranetResults.xsl | 69 ++ 4 files changed, 1106 insertions(+), 1 deletion(-) 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 e32698600b..77a2aac6ca 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1776,7 +1776,18 @@ sub searchResults { push @available_items_loop, $available_items->{$key} } - # if biblio level itypes are used and itemtype is notforloan, it can't be reserved either + # XSLT processing of some stuff + use C4::Charset; + SetUTF8Flag($marcrecord); + $debug && warn $marcrecord->as_formatted; + 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 + } + + # if biblio level itypes are used and itemtype is notforloan, it can't be reserved either if (!C4::Context->preference("item-level_itypes")) { if ($itemtypes{ $oldbiblio->{itemtype} }->{notforloan}) { $can_place_holds = 0; 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 1931227d5c..d558795fec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -453,6 +453,9 @@ YAHOO.util.Event.onContentReady("searchheader", function () { + [% IF ( SEARCH_RESULT.XSLTResultsRecord ) %] + [% SEARCH_RESULT.XSLTResultsRecord %] + [% ELSE %]

[% SEARCH_RESULT.result_number %]. [% biblionumber = SEARCH_RESULT.biblionumber %] @@ -508,6 +511,7 @@ YAHOO.util.Event.onContentReady("searchheader", function () {

[% END %] + [% END %] [% END %]

[% IF ( SEARCH_RESULT.norequests ) %] No holds allowed 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 0000000000..c398a23ad2 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -0,0 +1,1021 @@ + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ST + + + BK + CR + + + BK + MX + CF + MP + VM + MU + PR + + + + + + + + + + + + + + + reformatted digital + + + digitized microfilm + + + digitized other analog + + + + + + + + + + + + + + + braille + + + print + + + electronic + + + microfiche + + + microfilm + + + + + chip cartridge + + + magnetic disc + + + magneto-optical disc + + + available online + + + tape cartridge + + + tape cassette + + + tape reel + + + + kit + + + + atlas + + + diagram + + + map + + + model + + + profile + + + remote-sensing image + + + section + + + view + + + + aperture card + + + microfiche + + + microfiche cassette + + + microfilm cartridge + + + microfilm cassette + + + microfilm reel + + + microopaque + + + film cartridge + + + film cassette + + + film reel + + + collage + + + photomechanical print + + + photonegative + + + photoprint + + + print + + + technical drawing + + + filmslip + + + filmstrip cartridge + + + filmstrip roll + + + other filmstrip type + + + transparency + + + remote-sensing image + + + cylinder + + + roll + + + sound cartridge + + + sound cassette + + + sound-tape reel + + + sound-track film + + + wire recording + + + braille + + + combination + + + moon + + + tactile, with no writing system + + + braille + + + regular print + + + text in looseleaf binder + + + videocartridge + + + videocassette + + + videoreel + + + + + + + + 245 + abhfgknps + + + + + /cgi-bin/koha/catalogue/detail.pl?biblionumber=title + + + + + + a + + + + + b + + + + + + h + + + + + fgknps + + + + + + + + + + + + + +

+ + + + + 100,110,111,700,710,711 + abc + + + + + + + by + + + + . + + + ; + + + + + + + + -- + + + + + + + + ; + + + + + + + + -- + + + + + + + n + + + + + + + . + + + ; + + + + + + +

+ + + + Edition: + + + ab + + + + + + + + Type: + + Set + + + Book + Continuing Resource + Article + + + Book + Kit + Mixed Materials + Computer File + Map + Visual Material + Score + Sound + Music + + + + ; Format: + + + + + + + ; Type of continuing resource: + + + + loose-leaf + + + series + + + newspaper + + + periodical + + + + + + ; Nature of contents: + + + + abstract or summary + + + bibliography + + + catalog + + + dictionary + + + encyclopedia + + + handbook + + + legal article + + + index + + + discography + + + legislation + + + theses + + + survey of literature + + + review + + + programmed text + + + filmography + + + directory + + + statistics + + + legal case and case notes + + + law report or digest + + + treaty + + + + + conference publication + + + + + + ; Type of computer file: + + + + numeric data + + + + + + ; Nature of contents: + + + patent + + + festschrift + + + + ; Literary form: + + + + not fiction + + + fiction + + + essay + + + drama + + + comic strip + + + fiction + + + humor, satire + + + letter + + + novel + + + short story + + + speech + + + + + ; Literary form: + + biography + + + conference publication + + + drama + + + essay + + + fiction + + + folktale + + + history + + + humor, satire + + + memoir + + + poetry + + + rehearsal + + + reporting + + + sound + + + speech + + + + ; Type of visual material: + + + art original + + + kit + + + art reproduction + + + diorama + + + filmstrip + + + legal article + + + picture + + + graphic + + + technical drawing + + + motion picture + + + chart + + + flash card + + + microscope slide + + + model + + + realia + + + slide + + + transparency + + + videorecording + + + toy + + + + + + + ; Audience: + + + Preschool; + + + Primary; + + + Pre-adolescent; + + + Adolescent; + + + Adult; + + + General; + + + Juvenile; + + + Specialized; + + + + + + + + + + 260 + abcg + results_summary + Publisher: + + + + + + Publisher: + + + abcg + + + + + + + + + 246 + ab + results_summary + Other Title: + + + + + + Other title: + + + ab + + .; + + + + + + Online Access: + + + + + + 100 + + + + y3z + + + + + + + + + Click here to access online + + + + + + + + | + + + + + + Availability: + + + + + + + + + + + + () + + No copies available + + + + + Copies available for loan: + + + + [] + ( + + ) +. , + + + + + + + +
+
+
+ + + + + Copies available for reference: + + + + [] + ( + + ) + . , + + + + + + + + Checked out ( + + ). + + + + + Withdrawn ( + + ). + + + + Lost ( + + ). + + + + Damaged ( + + ). + + + + On order ( + + ). + + + + In transit ( + + ). + + + + On hold ( + + ). + +
+ + + + + + + aq + + + + :,;/ + + + + + + + + + + + + + + + + + cdn + + + + + + + acdeq + + + + + + + + + bc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 0000000000..0ed7bf5233 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetResults.xsl @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + /cgi-bin/koha/catalogue/detail.pl?biblionumber= + + + + + + + : + + + + [ + + ] + + + : + + + + : + + + + / + + + + ; + + + + + + + + + + + + + + -- 2.39.5