[Koha-patches] bug 6334 [PATCH 1/1] In the UNIMARslim2OAID.xsl the link to biblio was hardcoded, with this patch it takes the value of OPACBaseURL.

Christophe Croullebois christophe.croullebois at biblibre.com
Thu May 12 17:13:40 CEST 2011


---
 .../prog/en/xslt/UNIMARCslim2OAIDC.xsl             |    2 +-
 opac/oai.pl                                        |   21 +++++++++++--------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2OAIDC.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2OAIDC.xsl
index 0e5a80d..9c8d8a2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2OAIDC.xsl
+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2OAIDC.xsl
@@ -165,7 +165,7 @@
 		</xsl:for-each>
 		<xsl:for-each select="marc:datafield[@tag=090]">
    	      <dc:identifier>
-		    <xsl:text>http://opac.mylibrary.org/bib/</xsl:text>
+		    <xsl:value-of select="$syspref"/><xsl:text>/bib/</xsl:text>
 		    <xsl:value-of select="marc:subfield[@code='a']"/>
 		  </dc:identifier>
 		</xsl:for-each>
diff --git a/opac/oai.pl b/opac/oai.pl
index 038b6d1..83d31dc 100755
--- a/opac/oai.pl
+++ b/opac/oai.pl
@@ -200,16 +200,19 @@ sub new {
     my $self = $class->SUPER::new(%args);
 
     $timestamp =~ s/ /T/, $timestamp .= 'Z';
-    $self->header( new HTTP::OAI::Header(
-        identifier  => $args{identifier},
-        datestamp   => $timestamp,
-    ) );
-
-    my $parser = XML::LibXML->new();
-    my $record_dom = $parser->parse_string( $marcxml );
-    my $format =  $args{metadataPrefix};
+    $self->header(
+        new HTTP::OAI::Header(
+            identifier => $args{identifier},
+            datestamp  => $timestamp,
+        )
+    );
+
+    my $parser     = XML::LibXML->new();
+    my $record_dom = $parser->parse_string($marcxml);
+    my $format     = $args{metadataPrefix};
+    my $syspref = C4::Context->preference("OPACBaseURL");
     if ( $format ne 'marcxml' ) {
-        $record_dom = $repository->stylesheet($format)->transform( $record_dom );
+        $record_dom = $repository->stylesheet($format)->transform($record_dom, syspref=> $syspref);
     }
     $self->metadata( HTTP::OAI::Metadata->new( dom => $record_dom ) );
 
-- 
1.7.0.4



More information about the Koha-patches mailing list