Lines 31-36
use C4::Auth;
Link Here
|
31 |
use C4::Biblio; |
31 |
use C4::Biblio; |
32 |
use C4::ImportBatch; |
32 |
use C4::ImportBatch; |
33 |
use C4::XSLT (); |
33 |
use C4::XSLT (); |
|
|
34 |
use C4::Templates; |
34 |
|
35 |
|
35 |
my $input = new CGI; |
36 |
my $input = new CGI; |
36 |
my $biblionumber = $input->param('id'); |
37 |
my $biblionumber = $input->param('id'); |
Lines 52-77
if(!ref $record) {
Link Here
|
52 |
} |
53 |
} |
53 |
|
54 |
|
54 |
if ($view eq 'card' || $view eq 'html') { |
55 |
if ($view eq 'card' || $view eq 'html') { |
55 |
my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber); |
56 |
my $xml = $importid ? $record->as_xml(): GetXmlBiblio($biblionumber); |
56 |
my $xslfile; |
57 |
my $xsl = $view eq 'card' ? 'compact.xsl' : 'plainMARC.xsl'; |
57 |
my $xslfilename; |
58 |
my $htdocs = C4::Context->config('opachtdocs'); |
58 |
my $htdocs = C4::Context->config('opachtdocs'); |
59 |
my ($theme, $lang) = C4::Templates::themelanguage($htdocs, $xsl, 'opac', $input); |
59 |
my $theme = C4::Context->preference("opacthemes"); |
60 |
$xsl = "$htdocs/$theme/$lang/xslt/$xsl"; |
60 |
my $lang = C4::Languages::getlanguage($input); |
61 |
print $input->header(-charset => 'UTF-8'), |
61 |
|
62 |
Encode::encode_utf8(C4::XSLT::engine->transform($xml, $xsl)); |
62 |
if ($view eq 'card'){ |
|
|
63 |
$xslfile = "compact.xsl"; |
64 |
} |
65 |
else { # must be html |
66 |
$xslfile = 'plainMARC.xsl'; |
67 |
} |
68 |
$xslfilename = "$htdocs/$theme/$lang/xslt/$xslfile"; |
69 |
$xslfilename = "$htdocs/$theme/en/xslt/$xslfile" unless ( $lang ne 'en' && -f $xslfilename ); |
70 |
$xslfilename = "$htdocs/prog/$lang/xslt/$xslfile" unless ( -f $xslfile ); |
71 |
$xslfilename = "$htdocs/prog/en/xslt/$xslfile" unless ( $lang ne 'en' && -f $xslfilename ); |
72 |
|
73 |
my $newxmlrecord = C4::XSLT::engine->transform($xmlrecord, $xslfilename); |
74 |
print $input->header(-charset => 'UTF-8'), Encode::encode_utf8($newxmlrecord); |
75 |
} |
63 |
} |
76 |
else { #view eq marc |
64 |
else { #view eq marc |
77 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ |
65 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ |
78 |
- |
|
|