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

(-)a/C4/Templates.pm (-2 / +3 lines)
Lines 288-301 sub themelanguage { Link Here
288
    push @themes, $hardcoded_theme;
288
    push @themes, $hardcoded_theme;
289
289
290
    # Try to find first theme for the selected theme/lang, then for fallback/lang
290
    # Try to find first theme for the selected theme/lang, then for fallback/lang
291
    my $where = $tmpl =~ /xsl$/ ? 'xslt' : 'modules';
291
    for my $theme (@themes) {
292
    for my $theme (@themes) {
292
        if ( -e "$htdocs/$theme/$lang/modules/$tmpl" ) {
293
        if ( -e "$htdocs/$theme/$lang/$where/$tmpl" ) {
293
            return ( $theme, $lang, uniq( \@themes ) );
294
            return ( $theme, $lang, uniq( \@themes ) );
294
        }
295
        }
295
    }
296
    }
296
    # Otherwise return theme/'en', last resort fallback/'en'
297
    # Otherwise return theme/'en', last resort fallback/'en'
297
    for my $theme (@themes) {
298
    for my $theme (@themes) {
298
        if ( -e "$htdocs/$theme/en/modules/$tmpl" ) {
299
        if ( -e "$htdocs/$theme/en/$where/$tmpl" ) {
299
            return ( $theme, 'en', uniq( \@themes ) );
300
            return ( $theme, 'en', uniq( \@themes ) );
300
        }
301
        }
301
    }
302
    }
(-)a/opac/opac-showmarc.pl (-21 / +8 lines)
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
- 

Return to bug 13170