[Koha-patches] [PATCH 44/54] XSLT modifications (patch to double check)

paul.poulain at biblibre.com paul.poulain at biblibre.com
Thu Dec 16 11:54:38 CET 2010


From: Paul Poulain <paul.poulain at biblibre.com>

This patch adds the ccode images on the XSLT

Paul's question : isn't this a duplicate of

commit d3b07c1889ed30693d321394562db627a4c135dd
Author: Owen Leonard <oleonard at myacpl.org>
Date:   Wed Jun 2 15:17:37 2010 -0400

    More fixes for Bug 4423, Staff Client XSLT is just a copy of the OPAC one

    - Adding material type icons from the OPAC side
---
 C4/XSLT.pm |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/C4/XSLT.pm b/C4/XSLT.pm
index 7844330..5616c84 100644
--- a/C4/XSLT.pm
+++ b/C4/XSLT.pm
@@ -123,7 +123,9 @@ sub XSLTParse4Display {
     my ( $biblionumber, $orig_record, $xsl_suffix, $interface ) = @_;
     $interface = 'opac' unless $interface;
     # grab the XML, run it through our stylesheet, push it out to the browser
-    my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
+    my $record = transformMARCXML4XSLT( $biblionumber, $orig_record );
+	my $itemsimageurl = GetKohaImageurlFromAuthorisedValues( "CCODE", $orig_record->field('099')->subfield("t")) || '';
+	my $logoxml = "<logo>" . $itemsimageurl . "</logo>\n";
     #return $record->as_formatted();
     my $itemsxml  = buildKohaItemsNamespace($biblionumber);
     my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
@@ -134,7 +136,7 @@ sub XSLTParse4Display {
                    "</syspref>\n";
     }
     $sysxml .= "</sysprefs>\n";
-    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/;
+    $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml$logoxml\<\/record\>/;
     $xmlrecord =~ s/\& /\&amp\; /;
     $xmlrecord=~ s/\&amp\;amp\; /\&amp\; /;
 
@@ -211,7 +213,8 @@ sub buildKohaItemsNamespace {
             $status = "available";
         }
         my $homebranch = xml_escape($branches->{$item->{homebranch}}->{'branchname'});
-	    my $itemcallnumber = xml_escape($item->{itemcallnumber});
+	my $itemcallnumber = xml_escape($item->{itemcallnumber});
+        my $itemlocation = GetAuthorisedValueByCode( "LOC", $item->{location}) || '';
         $xml.= "<item><homebranch>$homebranch</homebranch>".
 		"<status>$status</status>".
 		"<itemcallnumber>".$itemcallnumber."</itemcallnumber>"
-- 
1.7.1



More information about the Koha-patches mailing list