View | Details | Raw Unified | Return to bug 6972
Collapse All | Expand All

(-)a/catalogue/showmarc.pl (-19 / +19 lines)
Lines 63-91 if($importid) { Link Here
63
		$xmlrecord = $record->as_xml();
63
		$xmlrecord = $record->as_xml();
64
	} 
64
	} 
65
}
65
}
66
		
66
67
if($view eq 'card') {
67
if($view eq 'card') {
68
$xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord;
68
    my $themelang = '/' . C4::Context->preference("opacthemes") .  '/' . C4::Templates::_current_language();
69
69
70
my $xslfile = C4::Context->config('intrahtdocs')."/prog/en/xslt/compact.xsl";
70
    $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord;
71
my $parser = XML::LibXML->new();
72
my $xslt = XML::LibXSLT->new();
73
my $source = $parser->parse_string($xmlrecord);
74
my $style_doc = $parser->parse_file($xslfile);
75
my $stylesheet = $xslt->parse_stylesheet($style_doc);
76
my $results = $stylesheet->transform($source);
77
my $newxmlrecord = $stylesheet->output_string($results);
78
#warn $newxmlrecord;
79
print "Content-type: text/html\n\n";
80
utf8::encode($newxmlrecord);
81
print $newxmlrecord;
82
71
72
    my $xslfile = C4::Context->config('intrahtdocs').$themelang."/xslt/compact.xsl";
73
    my $parser = XML::LibXML->new();
74
    my $xslt = XML::LibXSLT->new();
75
    my $source = $parser->parse_string($xmlrecord);
76
    my $style_doc = $parser->parse_file($xslfile);
77
    my $stylesheet = $xslt->parse_stylesheet($style_doc);
78
    my $results = $stylesheet->transform($source);
79
    my $newxmlrecord = $stylesheet->output_string($results);
80
    #warn $newxmlrecord;
81
    print "Content-type: text/html\n\n";
82
    utf8::encode($newxmlrecord);
83
    print $newxmlrecord;
83
} else {
84
} else {
85
    $record =GetMarcBiblio($biblionumber) unless $record;
84
86
85
$record =GetMarcBiblio($biblionumber) unless $record; 
87
    my $formatted = $record->as_formatted;
86
88
    $template->param( MARC_FORMATTED => $formatted );
87
my $formatted = $record->as_formatted;
88
$template->param( MARC_FORMATTED => $formatted );
89
89
90
output_html_with_http_headers $input, $cookie, $template->output;
90
    output_html_with_http_headers $input, $cookie, $template->output;
91
}
91
}
(-)a/opac/opac-showmarc.pl (-5 / +5 lines)
Lines 59-76 if ($importid) { Link Here
59
	$record = MARC::Record->new_from_usmarc($marc) ;
59
	$record = MARC::Record->new_from_usmarc($marc) ;
60
 	if($view eq 'card') {
60
 	if($view eq 'card') {
61
		$xmlrecord = $record->as_xml();
61
		$xmlrecord = $record->as_xml();
62
	} 
62
	}
63
}
63
}
64
64
65
66
if ($view eq 'card' || $view eq 'html') {
65
if ($view eq 'card' || $view eq 'html') {
67
    $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord;
66
    $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord;
68
    my $xslfile;
67
    my $xslfile;
68
    my $themelang = '/' . C4::Context->preference("opacthemes") .  '/' . C4::Templates::_current_language();
69
69
    if ($view eq 'card'){
70
    if ($view eq 'card'){
70
	$xslfile = C4::Context->config('opachtdocs')."/prog/en/xslt/compact.xsl";
71
        $xslfile = C4::Context->config('opachtdocs').$themelang."/xslt/compact.xsl";
71
    }
72
    }
72
    else { # must be html
73
    else { # must be html
73
	$xslfile = C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl";	
74
        $xslfile = C4::Context->config('opachtdocs').$themelang."/xslt/MARC21slim2OPACMARCdetail.xsl";
74
    }
75
    }
75
    my $parser = XML::LibXML->new();
76
    my $parser = XML::LibXML->new();
76
    my $xslt   = XML::LibXSLT->new();
77
    my $xslt   = XML::LibXSLT->new();
77
- 

Return to bug 6972