From: Alex Arnaud <[email protected]>

---
 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 () 
{
                                 <input type="checkbox" class="selection" 
id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% 
SEARCH_RESULT.biblionumber %]" style="display:none" />
                             </td>
                             <td>
+                           [% IF ( SEARCH_RESULT.XSLTResultsRecord ) %]
+                               [% SEARCH_RESULT.XSLTResultsRecord %]
+                           [% ELSE %]
                                 <p>[% SEARCH_RESULT.result_number %].
                                  [% biblionumber = SEARCH_RESULT.biblionumber 
%]
 
@@ -495,6 +498,7 @@ YAHOO.util.Event.onContentReady("searchheader", function () 
{
                                 [% END %]
 
                                 [% END %]
+                                [% END %]
                                   <p class="hold">[% IF ( 
SEARCH_RESULT.norequests ) %]
                                   <span class="noholdstext">No holds 
allowed</span>
                               [% 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
+<xsl:stylesheet version="1.0"
+  xmlns:marc="http://www.loc.gov/MARC21/slim";
+  xmlns:items="http://www.koha.org/items";
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+  exclude-result-prefixes="marc items">
+<xsl:import href="MARC21slimUtils.xsl"/>
+<xsl:output method = "xml" indent="yes" omit-xml-declaration = "yes" />
+<xsl:key name="item-by-status" match="items:item" use="items:status"/>
+<xsl:key name="item-by-status-and-branch" match="items:item" 
use="concat(items:status, ' ', items:homebranch)"/>
+
+<xsl:template match="/">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="marc:record">
+  <xsl:variable name="leader" select="marc:leader"/>
+  <xsl:variable name="leader6" select="substring($leader,7,1)"/>
+  <xsl:variable name="leader7" select="substring($leader,8,1)"/>
+  <xsl:variable name="biblionumber" 
select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
+  <xsl:variable name="isbn" 
select="marc:datafield[@tag=020]/marc:subfield[@code='a']"/>
+       
+  <xsl:if test="marc:datafield[@tag=245]">
+    <xsl:for-each select="marc:datafield[@tag=245]">
+       <a>
+         <xsl:attribute 
name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of 
select="$biblionumber"/>
+         </xsl:attribute>
+         <xsl:variable name="title" select="marc:subfield[@code='a']"/>
+         <xsl:variable name="ntitle"
+           select="translate($title, 
'&#x0098;&#x009C;&#xC29C;&#xC29B;&#xC298;&#xC288;&#xC289;','')"/>
+         <xsl:value-of select="$ntitle" />
+       </a>
+      <xsl:if test="marc:subfield[@code='b']">
+        <xsl:text> : </xsl:text>
+        <xsl:value-of select="marc:subfield[@code='b']"/>
+      </xsl:if>
+      <xsl:if test="marc:subfield[@code='c']">
+        <xsl:text> : </xsl:text>
+        <xsl:value-of select="marc:subfield[@code='c']"/>
+      </xsl:if>
+      <xsl:text> </xsl:text>
+    </xsl:for-each>
+  </xsl:if>
+</xsl:template>
+</xsl:stylesheet>
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ -->
+<xsl:stylesheet version="1.0"
+  xmlns:marc="http://www.loc.gov/MARC21/slim";
+  xmlns:items="http://www.koha.org/items";
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+  exclude-result-prefixes="marc items">
+<xsl:import href="UNIMARCslimUtils.xsl"/>
+<xsl:output method = "xml" indent="yes" omit-xml-declaration = "yes" />
+<xsl:key name="item-by-status" match="items:item" use="items:status"/>
+<xsl:key name="item-by-status-and-branch" match="items:item" 
use="concat(items:status, ' ', items:homebranch)"/>
+
+<xsl:template match="/">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="marc:record">
+  <xsl:variable name="leader" select="marc:leader"/>
+  <xsl:variable name="leader6" select="substring($leader,7,1)"/>
+  <xsl:variable name="leader7" select="substring($leader,8,1)"/>
+  <xsl:variable name="biblionumber" select="marc:controlfield[@tag=001]"/>
+  <xsl:variable name="isbn" 
select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/>
+       
+  <xsl:if test="marc:datafield[@tag=200]">
+    <xsl:for-each select="marc:datafield[@tag=200]">
+       <a><xsl:attribute 
name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of 
select="$biblionumber"/>
+           </xsl:attribute>
+        <xsl:variable name="title" select="marc:subfield[@code='a']"/>
+        <xsl:variable name="ntitle"
+             select="translate($title, 
'&#x0098;&#x009C;&#xC29C;&#xC29B;&#xC298;&#xC288;&#xC289;','')"/>
+        <xsl:value-of select="$ntitle" />
+      </a>
+      <xsl:if test="marc:subfield[@code='e']">
+        <xsl:text> : </xsl:text>
+        <xsl:value-of select="marc:subfield[@code='e']"/>
+      </xsl:if>
+      <xsl:if test="marc:subfield[@code='b']">
+        <xsl:text> [</xsl:text>
+        <xsl:value-of select="marc:subfield[@code='b']"/>
+        <xsl:text>]</xsl:text>
+      </xsl:if>
+      <xsl:if test="marc:subfield[@code='h']">
+        <xsl:text> : </xsl:text>
+        <xsl:value-of select="marc:subfield[@code='h']"/>
+      </xsl:if>
+      <xsl:if test="marc:subfield[@code='i']">
+        <xsl:text> : </xsl:text>
+        <xsl:value-of select="marc:subfield[@code='i']"/>
+      </xsl:if>
+      <xsl:if test="marc:subfield[@code='f']">
+        <xsl:text> / </xsl:text>
+        <xsl:value-of select="marc:subfield[@code='f']"/>
+      </xsl:if>
+      <xsl:if test="marc:subfield[@code='g']">
+        <xsl:text> ; </xsl:text>
+        <xsl:value-of select="marc:subfield[@code='g']"/>
+      </xsl:if>
+      <xsl:text> </xsl:text>
+    </xsl:for-each>
+  </xsl:if>
+
+  <xsl:call-template name="tag_4xx" />
+
+  <xsl:call-template name="tag_210" />
+
+  <xsl:call-template name="tag_215" />
+
+</xsl:template>
+</xsl:stylesheet>
-- 
1.7.0.4

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to