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

(-)a/C4/XSLT.pm (-5 / +6 lines)
Lines 130-153 sub get_xslt_sysprefs { Link Here
130
}
130
}
131
131
132
sub get_xsl_filename {
132
sub get_xsl_filename {
133
    my ( $xslsyspref ) = @_;
133
    my ( $xslsyspref, $xslfilename ) = @_;
134
134
135
    my $lang   = C4::Languages::getlanguage();
135
    my $lang   = C4::Languages::getlanguage();
136
136
137
    my $xslfilename = C4::Context->preference($xslsyspref) || "default";
137
    $xslfilename ||= C4::Context->preference($xslsyspref) || "default";
138
138
139
    if ($xslsyspref eq "XSLTCustomExport") {
139
    if ($xslsyspref eq "XSLTCustomExport") {
140
        my $dir;
140
        my $dir;
141
        $dir = C4::Context->config('intrahtdocs') .
141
        $dir = C4::Context->config('intrahtdocs') .
142
            '/' . C4::Context->preference("template") .
142
            '/' . C4::Context->preference("template") .
143
            '/' . C4::Languages::getlanguage() .
143
            '/' . $lang .
144
            '/xslt/biblioexport';
144
            '/xslt/biblioexport';
145
        $xslfilename = $dir . "/" . $xslfilename;
145
        $xslfilename = $dir . "/" . $xslfilename;
146
    } elsif ($xslsyspref eq "OPACXSLTCustomExport") {
146
    } elsif ($xslsyspref eq "OPACXSLTCustomExport") {
147
        my $dir;
147
        my $dir;
148
        $dir = C4::Context->config('opachtdocs') .
148
        $dir = C4::Context->config('opachtdocs') .
149
            '/' . C4::Context->preference("opacthemes") .
149
            '/' . C4::Context->preference("opacthemes") .
150
            '/' . C4::Languages::getlanguage() .
150
            '/' . $lang .
151
            '/xslt/biblioexport';
151
            '/xslt/biblioexport';
152
        $xslfilename = $dir . "/" . $xslfilename;
152
        $xslfilename = $dir . "/" . $xslfilename;
153
    } elsif ( $xslfilename =~ /^\s*"?default"?\s*$/i ) {
153
    } elsif ( $xslfilename =~ /^\s*"?default"?\s*$/i ) {
Lines 208-218 sub XSLTParse4Display { Link Here
208
    my $variables    = $params->{xslt_variables};
208
    my $variables    = $params->{xslt_variables};
209
    my $items_rs     = $params->{items_rs};
209
    my $items_rs     = $params->{items_rs};
210
    my $interface    = C4::Context->interface;
210
    my $interface    = C4::Context->interface;
211
    my $xslfilename  = $params->{xslfilename};
211
212
212
    die "Mandatory \$params->{xsl_syspref} was not provided, called with biblionumber $params->{biblionumber}"
213
    die "Mandatory \$params->{xsl_syspref} was not provided, called with biblionumber $params->{biblionumber}"
213
        if not defined $params->{xsl_syspref};
214
        if not defined $params->{xsl_syspref};
214
215
215
    my $xslfilename = get_xsl_filename( $xslsyspref);
216
    $xslfilename = get_xsl_filename( $xslsyspref, $xslfilename);
216
217
217
    my $frameworkcode = GetFrameworkCode($biblionumber) || '';
218
    my $frameworkcode = GetFrameworkCode($biblionumber) || '';
218
    my $record_processor = Koha::RecordProcessor->new(
219
    my $record_processor = Koha::RecordProcessor->new(
(-)a/basket/basket.pl (-2 / +1 lines)
Lines 27-34 use C4::Biblio qw( Link Here
27
);
27
);
28
use C4::Auth qw( get_template_and_user );
28
use C4::Auth qw( get_template_and_user );
29
use C4::Output qw( output_html_with_http_headers );
29
use C4::Output qw( output_html_with_http_headers );
30
use C4::XSLT;
30
use C4::XSLT qw( CustomXSLTExportList );
31
32
31
33
use Koha::AuthorisedValues;
32
use Koha::AuthorisedValues;
34
use Koha::Biblios;
33
use Koha::Biblios;
(-)a/basket/downloadcart.pl (-2 / +10 lines)
Lines 26-32 use C4::Auth qw( get_template_and_user ); Link Here
26
use C4::Output qw( output_html_with_http_headers );
26
use C4::Output qw( output_html_with_http_headers );
27
use C4::Record;
27
use C4::Record;
28
use C4::Ris qw( marc2ris );
28
use C4::Ris qw( marc2ris );
29
use C4::XSLT;
29
use C4::XSLT qw( XSLTParse4Display );
30
30
31
use Koha::CsvProfiles;
31
use Koha::CsvProfiles;
32
use Koha::Biblios;
32
use Koha::Biblios;
Lines 66-71 if ($bib_list && $format) { Link Here
66
66
67
            my $biblio = Koha::Biblios->find($biblionumber);
67
            my $biblio = Koha::Biblios->find($biblionumber);
68
            my $record = $biblio->metadata->record({ embed_items => 1 });
68
            my $record = $biblio->metadata->record({ embed_items => 1 });
69
            my $xslFile = $query->param("file");
69
            next unless $record;
70
            next unless $record;
70
71
71
            if ($format eq 'iso2709') {
72
            if ($format eq 'iso2709') {
Lines 80-86 if ($bib_list && $format) { Link Here
80
                $output .= marc2bibtex($record, $biblionumber);
81
                $output .= marc2bibtex($record, $biblionumber);
81
            }
82
            }
82
            elsif ($format =~ /^xsl\.(.*)$/) {
83
            elsif ($format =~ /^xsl\.(.*)$/) {
83
                $output .= XSLTParse4Display($biblio, $record, 'XSLTCustomExport', 1, undef, , '', $1, '');
84
                $output .= XSLTParse4Display({
85
                    biblionumber => $biblio,
86
                    record       => $record,
87
                    xsl_syspref  => "XSLTCustomExport",
88
                    fix_amps     => 1,
89
                    hidden_items => undef,
90
                    xslfilename  => $xslFile,
91
                });
84
            }
92
            }
85
        }
93
        }
86
    }
94
    }
(-)a/catalogue/detail.pl (-1 / +1 lines)
Lines 40-46 use C4::XISBN qw( get_xisbns ); Link Here
40
use C4::External::Amazon qw( get_amazon_tld );
40
use C4::External::Amazon qw( get_amazon_tld );
41
use C4::Search qw( z3950_search_args enabled_staff_search_views new_record_from_zebra );
41
use C4::Search qw( z3950_search_args enabled_staff_search_views new_record_from_zebra );
42
use C4::Tags qw( get_tags );
42
use C4::Tags qw( get_tags );
43
use C4::XSLT qw( XSLTParse4Display );
43
use C4::XSLT qw( XSLTParse4Display CustomXSLTExportList );
44
use Koha::DateUtils qw( format_sqldatetime );
44
use Koha::DateUtils qw( format_sqldatetime );
45
use C4::HTML5Media;
45
use C4::HTML5Media;
46
use C4::CourseReserves qw( GetItemCourseReservesInfo );
46
use C4::CourseReserves qw( GetItemCourseReservesInfo );
(-)a/catalogue/export.pl (-4 / +14 lines)
Lines 7-14 use C4::Output; Link Here
7
use C4::Biblio qw( GetMarcControlnumber );
7
use C4::Biblio qw( GetMarcControlnumber );
8
use CGI qw ( -utf8 );
8
use CGI qw ( -utf8 );
9
use C4::Ris qw( marc2ris );
9
use C4::Ris qw( marc2ris );
10
use C4::XSLT;
10
use C4::XSLT qw( XSLTParse4Display );
11
11
use Koha::Biblios;
12
12
13
13
14
14
Lines 92-102 if ($op eq "export") { Link Here
92
    my $biblionumber = $query->param("bib");
92
    my $biblionumber = $query->param("bib");
93
    if ($biblionumber){
93
    if ($biblionumber){
94
        my $xslFile = $query->param("file");
94
        my $xslFile = $query->param("file");
95
        my $marc = GetMarcBiblio( { biblionumber => $biblionumber, embed_items => 1 } );
95
        my $biblio = Koha::Biblios->find($biblionumber);
96
        my $marc = $biblio->metadata->record( { embed_items => 1 } );
96
        my $format=$query->param("format")||'txt';
97
        my $format=$query->param("format")||'txt';
97
        my @hiddenitems;
98
        my @hiddenitems;
98
99
99
        $marc = XSLTParse4Display($biblionumber, $marc, 'XSLTCustomExport', 1, \@hiddenitems, '', $xslFile,'');
100
        $marc = XSLTParse4Display(
101
            {
102
                biblionumber   => $biblionumber,
103
                record         => $marc,
104
                xsl_syspref    => "XSLTCustomExport",
105
                fix_amps       => 1,
106
                hidden_items   => \@hiddenitems,
107
                xslfilename    => $xslFile,
108
            }
109
        );
100
        print $query->header(
110
        print $query->header(
101
            -type => 'application/octet-stream',
111
            -type => 'application/octet-stream',
102
            -attachment=>"bib-$biblionumber.$format");
112
            -attachment=>"bib-$biblionumber.$format");
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc (-1 / +1 lines)
Lines 37-43 Link Here
37
                        <li><a class="dropdown-item" href="/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=[% csv_profile.export_format_id | uri %]&amp;shelfid=[% shelf.shelfnumber | uri %]">CSV - [% csv_profile.profile | html %]</a></li>
37
                        <li><a class="dropdown-item" href="/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=[% csv_profile.export_format_id | uri %]&amp;shelfid=[% shelf.shelfnumber | uri %]">CSV - [% csv_profile.profile | html %]</a></li>
38
                    [% END %]
38
                    [% END %]
39
                    [% FOREACH xsl_export IN xsl_exports %]
39
                    [% FOREACH xsl_export IN xsl_exports %]
40
                        <li><a href="/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=xsl.[% xsl_export.value | uri %]&amp;shelfid=[% shelf.shelfnumber | uri %]">XSL - [% xsl_export.filename | html %]</a></li>
40
                        <li><a href="/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=xsl.[% xsl_export.value | uri %]&amp;file=[% xsl_export.value | uri %]&amp;shelfid=[% shelf.shelfnumber | uri %]">XSL - [% xsl_export.filename | html %]</a></li>
41
                    [% END %]
41
                    [% END %]
42
                </ul>
42
                </ul>
43
        </div>
43
        </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt (-1 / +1 lines)
Lines 65-71 Link Here
65
                                <li><a class="dropdown-item" href="/cgi-bin/koha/basket/downloadcart.pl?format=[% csv_profile.export_format_id | uri %]&amp;bib_list=[% bib_list | uri %]">CSV - [% csv_profile.profile | html %]</a></li>
65
                                <li><a class="dropdown-item" href="/cgi-bin/koha/basket/downloadcart.pl?format=[% csv_profile.export_format_id | uri %]&amp;bib_list=[% bib_list | uri %]">CSV - [% csv_profile.profile | html %]</a></li>
66
                            [% END %]
66
                            [% END %]
67
                            [% FOREACH xsl_export IN xsl_exports %]
67
                            [% FOREACH xsl_export IN xsl_exports %]
68
                                <li><a href="/cgi-bin/koha/basket/downloadcart.pl?format=xsl.[% xsl_export.value | uri %]&amp;bib_list=[% bib_list | uri %]">XSL - [% xsl_export.filename | html %]</a></li>
68
                                <li><a href="/cgi-bin/koha/basket/downloadcart.pl?format=xsl.[% xsl_export.value | uri %]&amp;file=[% xsl_export.value | uri %]&amp;bib_list=[% bib_list | uri %]">XSL - [% xsl_export.filename | html %]</a></li>
69
                            [% END %]
69
                            [% END %]
70
                            </ul>
70
                            </ul>
71
                        </div>
71
                        </div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (-6 / +5 lines)
Lines 65-76 Link Here
65
            <div id="export">
65
            <div id="export">
66
                <div class="dropdown">
66
                <div class="dropdown">
67
                    <a id="format" class="btn btn-link btn-lg dropdown-toggle" data-bs-toggle="dropdown" href="#"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Save record <b class="caret"></b></a>
67
                    <a id="format" class="btn btn-link btn-lg dropdown-toggle" data-bs-toggle="dropdown" href="#"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Save record <b class="caret"></b></a>
68
                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="format">
68
                    <div class="dropdown-menu dropdown-menu-end" aria-labelledby="format">
69
                        [% FOREACH option IN export_options %]
69
                        [% FOREACH option IN export_options %]
70
                            [% IF option == 'dc' %]
70
                            [% IF option == 'dc' %]
71
                                <li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#exportModal_">Dublin Core</a></li>
71
                                <a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#exportModal_">Dublin Core</a>
72
                            [% ELSIF option != 'custom' %]
72
                            [% ELSIF option != 'custom' %]
73
                                <li><a class="dropdown-item" href="/cgi-bin/koha/opac-export.pl?op=export&amp;bib=[% biblio.biblionumber | html %]&amp;format=[% option | html %]">
73
                                <a class="dropdown-item" href="/cgi-bin/koha/opac-export.pl?op=export&amp;bib=[% biblio.biblionumber | html %]&amp;format=[% option | html %]">
74
                                    [% SWITCH option %]
74
                                    [% SWITCH option %]
75
                                        [% CASE 'bibtex' %]<span>BIBTEX</span>
75
                                        [% CASE 'bibtex' %]<span>BIBTEX</span>
76
                                        [% CASE 'endnote' %]<span>EndNote</span>
76
                                        [% CASE 'endnote' %]<span>EndNote</span>
Lines 83-96 Link Here
83
                                        [% CASE 'isbd' %]<span>ISBD</span>
83
                                        [% CASE 'isbd' %]<span>ISBD</span>
84
                                    [% END %]
84
                                    [% END %]
85
                                    </a>
85
                                    </a>
86
                                </li>
87
                            [% ELSE %]
86
                            [% ELSE %]
88
                                [% FOREACH filesOption IN filesOptions %]
87
                                [% FOREACH filesOption IN filesOptions %]
89
                                    <li><a role="menuitem" href="/cgi-bin/koha/opac-export.pl?format=[% filesOption.format | html %]&amp;op=exportxsl&amp;file=[% filesOption.value | html %]&amp;bib=[% biblionumber | html %]">XSL - [% filesOption.filename | html %]</a></li>
88
                                    <a role="menuitem" href="/cgi-bin/koha/opac-export.pl?format=[% filesOption.format | html %]&amp;op=exportxsl&amp;file=[% filesOption.value | html %]&amp;bib=[% biblionumber | html %]">XSL - [% filesOption.filename | html %]</a>
90
                                [% END %]
89
                                [% END %]
91
                            [% END %]
90
                            [% END %]
92
                        [% END %]
91
                        [% END %]
93
                    </ul>
92
                    </div>
94
                </div>
93
                </div>
95
            </div>
94
            </div>
96
        </li>
95
        </li>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt (+8 lines)
Lines 35-40 Link Here
35
                                    <a class="btn btn-link btn-sm send" href="opac-basket.pl"><i class="fa fa-fw fa-envelope" aria-hidden="true"></i> Send</a>
35
                                    <a class="btn btn-link btn-sm send" href="opac-basket.pl"><i class="fa fa-fw fa-envelope" aria-hidden="true"></i> Send</a>
36
                                [% END %]
36
                                [% END %]
37
37
38
                                [% SET export_options = Koha.Preference('OpacExportOptions').split(',') %]
38
                                <div id="download-cart" class="btn-group dropdown">
39
                                <div id="download-cart" class="btn-group dropdown">
39
                                    <a id="format" class="btn btn-link dropdown-toggle" aria-haspopup="menu" aria-label="Select format and download cart" data-bs-toggle="dropdown" role="button" href="#"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download <b class="caret"></b></a>
40
                                    <a id="format" class="btn btn-link dropdown-toggle" aria-haspopup="menu" aria-label="Select format and download cart" data-bs-toggle="dropdown" role="button" href="#"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download <b class="caret"></b></a>
40
                                    <div class="dropdown-menu" role="menu" aria-labelledby="format">
41
                                    <div class="dropdown-menu" role="menu" aria-labelledby="format">
Lines 45-50 Link Here
45
                                        [% FOREACH csv_profile IN csv_profiles %]
46
                                        [% FOREACH csv_profile IN csv_profiles %]
46
                                            <a role="menuitem" class="dropdown-item download-cart" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
47
                                            <a role="menuitem" class="dropdown-item download-cart" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
47
                                        [% END %]
48
                                        [% END %]
49
                                        [% FOREACH option IN export_options %]
50
                                            [% IF option == 'custom' %]
51
                                                [% FOREACH xsl_export IN xsl_exports %]
52
                                                    <a role="menuitem" class="dropdown-item" href="/cgi-bin/koha/opac-downloadcart.pl?format=xsl.[% xsl_export.value | uri %]&amp;file=[% xsl_export.value | uri %]&amp;bib_list=[% bib_list | uri %]">XSL - [% xsl_export.filename | html %]</a></li>
53
                                                [% END %]
54
                                            [% END %]
55
                                        [% END %]
48
                                    </div>
56
                                    </div>
49
                                </div>
57
                                </div>
50
58
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (+8 lines)
Lines 233-238 Link Here
233
                                    <div class="list-actions">
233
                                    <div class="list-actions">
234
                                        <a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-fw fa-plus" aria-hidden="true"></i> New list</a> <span class="sep">|</span>
234
                                        <a class="btn btn-link newshelf" href="/cgi-bin/koha/opac-shelves.pl?op=add_form"><i class="fa fa-fw fa-plus" aria-hidden="true"></i> New list</a> <span class="sep">|</span>
235
235
236
                                        [% SET export_options = Koha.Preference('OpacExportOptions').split(',') %]
236
                                        <div id="download-list" class="btn-group dropdown">
237
                                        <div id="download-list" class="btn-group dropdown">
237
                                            <a id="format" class="btn btn-link dropdown-toggle" aria-haspopup="menu" aria-label="Select format and download list" data-bs-toggle="dropdown" href="/cgi-bin/koha/opac-downloadshelf.pl?shelfnumber=[% shelf.shelfnumber | html %]"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download <b class="caret"></b></a>
238
                                            <a id="format" class="btn btn-link dropdown-toggle" aria-haspopup="menu" aria-label="Select format and download list" data-bs-toggle="dropdown" href="/cgi-bin/koha/opac-downloadshelf.pl?shelfnumber=[% shelf.shelfnumber | html %]"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download <b class="caret"></b></a>
238
                                            <div class="dropdown-menu pull-left" role="menu" aria-labelledby="format">
239
                                            <div class="dropdown-menu pull-left" role="menu" aria-labelledby="format">
Lines 243-248 Link Here
243
                                                [% FOREACH csv_profile IN csv_profiles %]
244
                                                [% FOREACH csv_profile IN csv_profiles %]
244
                                                    <a role="menuitem" class="dropdown-item download-list" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
245
                                                    <a role="menuitem" class="dropdown-item download-list" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
245
                                                [% END %]
246
                                                [% END %]
247
                                                [% FOREACH option IN export_options %]
248
                                                    [% IF option == 'custom' %]
249
                                                        [% FOREACH xsl_export IN xsl_exports %]
250
                                                            <a role="menuitem" class="dropdown-item" href="/cgi-bin/koha/opac-downloadshelf.pl?format=xsl.[% xsl_export.value | uri %]&amp;file=[% xsl_export.value | uri %]&amp;shelfnumber=[% shelf.shelfnumber | uri %]">XSL - [% xsl_export.filename | html %]</a></li>
251
                                                        [% END %]
252
                                                    [% END %]
253
                                                [% END %]
246
                                            </div>
254
                                            </div>
247
                                        </div>
255
                                        </div>
248
256
(-)a/opac/opac-basket.pl (+2 lines)
Lines 28-33 use C4::Biblio qw( Link Here
28
);
28
);
29
use C4::Auth qw( get_template_and_user );
29
use C4::Auth qw( get_template_and_user );
30
use C4::Output qw( output_html_with_http_headers );
30
use C4::Output qw( output_html_with_http_headers );
31
use C4::XSLT qw( CustomXSLTExportList );
31
use Koha::RecordProcessor;
32
use Koha::RecordProcessor;
32
use Koha::CsvProfiles;
33
use Koha::CsvProfiles;
33
use Koha::AuthorisedValues;
34
use Koha::AuthorisedValues;
Lines 134-139 $template->param( Link Here
134
        { type => 'marc', used_for => 'export_records', staff_only => 0 } ),
135
        { type => 'marc', used_for => 'export_records', staff_only => 0 } ),
135
    bib_list => $bib_list,
136
    bib_list => $bib_list,
136
    BIBLIO_RESULTS => $resultsarray,
137
    BIBLIO_RESULTS => $resultsarray,
138
    xsl_exports => CustomXSLTExportList(),
137
);
139
);
138
140
139
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
141
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
(-)a/opac/opac-detail.pl (-2 / +1 lines)
Lines 58-64 use C4::External::Syndetics qw( Link Here
58
    get_syndetics_toc
58
    get_syndetics_toc
59
);
59
);
60
use C4::Members;
60
use C4::Members;
61
use C4::XSLT qw( XSLTParse4Display );
61
use C4::XSLT qw( XSLTParse4Display CustomXSLTExportList );
62
use C4::ShelfBrowser qw( GetNearbyItems );
62
use C4::ShelfBrowser qw( GetNearbyItems );
63
use C4::Reserves qw( GetReserveStatus IsAvailableForItemLevelRequest );
63
use C4::Reserves qw( GetReserveStatus IsAvailableForItemLevelRequest );
64
use C4::Charset qw( SetUTF8Flag );
64
use C4::Charset qw( SetUTF8Flag );
Lines 103-109 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
103
    }
103
    }
104
);
104
);
105
105
106
#### ADD CUSTOM XSLT
107
$template->param(filesOptions => CustomXSLTExportList(1));
106
$template->param(filesOptions => CustomXSLTExportList(1));
108
107
109
my $patron = Koha::Patrons->find( $borrowernumber );
108
my $patron = Koha::Patrons->find( $borrowernumber );
(-)a/opac/opac-downloadcart.pl (-2 / +10 lines)
Lines 28-34 use C4::Output qw( output_html_with_http_headers ); Link Here
28
use C4::Record;
28
use C4::Record;
29
use C4::Ris qw( marc2ris );
29
use C4::Ris qw( marc2ris );
30
use Koha::Biblios;
30
use Koha::Biblios;
31
use C4::XSLT;
31
use C4::XSLT qw( XSLTParse4Display );
32
32
33
use Koha::CsvProfiles;
33
use Koha::CsvProfiles;
34
use Koha::RecordProcessor;
34
use Koha::RecordProcessor;
Lines 86-91 if ($bib_list && $format) { Link Here
86
                    patron      => $patron,
86
                    patron      => $patron,
87
                }
87
                }
88
            );
88
            );
89
            my $xslFile = $query->param("file");
89
            my $framework = &GetFrameworkCode( $biblio );
90
            my $framework = &GetFrameworkCode( $biblio );
90
            $record_processor->options({
91
            $record_processor->options({
91
                interface => 'opac',
92
                interface => 'opac',
Lines 117-123 if ($bib_list && $format) { Link Here
117
                $type      = "text/plain";
118
                $type      = "text/plain";
118
            }
119
            }
119
            elsif ($format =~ /^xsl\.(.*)$/) {
120
            elsif ($format =~ /^xsl\.(.*)$/) {
120
                $output .= XSLTParse4Display($biblio, $record, 'OPACXSLTCustomExport', 1, undef, undef, $1, '');
121
                $output .= XSLTParse4Display({
122
                    biblionumber   => $biblio,
123
                    record         => $record,
124
                    xsl_syspref    => "OPACXSLTCustomExport",
125
                    fix_amps       => 1,
126
                    hidden_items => undef,
127
                    xslfilename  => $xslFile,
128
                });
121
            }
129
            }
122
        }
130
        }
123
    }
131
    }
(-)a/opac/opac-downloadshelf.pl (-3 / +13 lines)
Lines 27-33 use C4::Output qw( output_html_with_http_headers ); Link Here
27
use C4::Record;
27
use C4::Record;
28
use C4::Ris qw( marc2ris );
28
use C4::Ris qw( marc2ris );
29
use Koha::Biblios;
29
use Koha::Biblios;
30
use C4::XSLT;
30
use C4::XSLT qw( XSLTParse4Display );
31
31
32
use Koha::CsvProfiles;
32
use Koha::CsvProfiles;
33
use Koha::RecordProcessor;
33
use Koha::RecordProcessor;
Lines 99-104 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
99
                        patron      => $patron,
99
                        patron      => $patron,
100
                    }
100
                    }
101
                );
101
                );
102
                my $xslFile = $query->param("file");
102
                my $framework = $biblio->frameworkcode;
103
                my $framework = $biblio->frameworkcode;
103
                $record_processor->options({
104
                $record_processor->options({
104
                    interface => 'opac',
105
                    interface => 'opac',
Lines 125-132 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
125
                    $extension = "txt";
126
                    $extension = "txt";
126
                    $type      = "text/plain";
127
                    $type      = "text/plain";
127
                }elsif ($format =~ /^xsl\.(.*)$/){
128
                }elsif ($format =~ /^xsl\.(.*)$/){
128
                         $output .= XSLTParse4Display($biblionumber, $record, 'XSLTCustomExport', 1, undef, undef, $1, '', 1);
129
                    $output .= XSLTParse4Display(
129
                    }
130
                        {
131
                            biblionumber => $biblionumber,
132
                            record => $record,
133
                            xsl_syspref  => "XSLTCustomExport",
134
                            fix_amps  => 1,
135
                            hidden_items => undef,
136
                            xslfilename  => $xslFile,
137
                        }
138
                    );
139
                }
130
            }
140
            }
131
        }
141
        }
132
142
(-)a/opac/opac-export.pl (-4 / +13 lines)
Lines 31-38 use CGI qw ( -utf8 ); Link Here
31
use C4::Auth;
31
use C4::Auth;
32
use C4::Ris qw( marc2ris );
32
use C4::Ris qw( marc2ris );
33
use Koha::Biblios;
33
use Koha::Biblios;
34
use C4::XSLT;
34
use C4::XSLT qw( XSLTParse4Display );
35
36
use Koha::RecordProcessor;
35
use Koha::RecordProcessor;
37
36
38
use List::MoreUtils qw(none any);
37
use List::MoreUtils qw(none any);
Lines 159-168 elsif ( $format =~ /isbd/ ) { Link Here
159
elsif ($format =~ /html/ ) {
158
elsif ($format =~ /html/ ) {
160
    if ($biblionumber){
159
    if ($biblionumber){
161
        my $xslFile = $query->param("file");
160
        my $xslFile = $query->param("file");
162
        $marc = C4::Biblio::GetMarcBiblio({biblionumber => $biblionumber});
161
        my $biblio = Koha::Biblios->find($biblionumber);
162
        $marc = $biblio->metadata->record;
163
        my @hiddenitems;
163
        my @hiddenitems;
164
164
165
        $marc = XSLTParse4Display($biblionumber, $marc, 'OPACXSLTCustomExport', 1, \@hiddenitems, undef, $xslFile, undef);
165
        $marc = XSLTParse4Display(
166
            {
167
                biblionumber => $biblionumber,
168
                record => $marc,
169
                xsl_syspref  => "OPACXSLTCustomExport",
170
                fix_amps  => 1,
171
                hidden_items => \@hiddenitems,
172
                xslfilename    => $xslFile,
173
            }
174
        );
166
    }
175
    }
167
}
176
}
168
else {
177
else {
(-)a/opac/opac-shelves.pl (-2 / +3 lines)
Lines 32-38 use C4::Koha qw( Link Here
32
use C4::Members;
32
use C4::Members;
33
use C4::Output qw( pagination_bar output_with_http_headers );
33
use C4::Output qw( pagination_bar output_with_http_headers );
34
use C4::Tags qw( get_tags );
34
use C4::Tags qw( get_tags );
35
use C4::XSLT qw( XSLTParse4Display );
35
use C4::XSLT qw( XSLTParse4Display CustomXSLTExportList );
36
36
37
use Koha::Biblios;
37
use Koha::Biblios;
38
use Koha::Biblioitems;
38
use Koha::Biblioitems;
Lines 522-528 $template->param( Link Here
522
    print         => scalar $query->param('print') || 0,
522
    print         => scalar $query->param('print') || 0,
523
    listsview     => 1,
523
    listsview     => 1,
524
    staffuser     => $staffuser,
524
    staffuser     => $staffuser,
525
    permitteduser => $permitteduser
525
    permitteduser => $permitteduser,
526
    xsl_exports => CustomXSLTExportList()
526
);
527
);
527
528
528
my $content_type = $query->param('rss')? 'rss' : 'html';
529
my $content_type = $query->param('rss')? 'rss' : 'html';
(-)a/virtualshelves/downloadshelf.pl (-2 / +12 lines)
Lines 25-31 use C4::Auth qw( get_template_and_user ); Link Here
25
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
26
use C4::Record;
26
use C4::Record;
27
use C4::Ris qw( marc2ris );
27
use C4::Ris qw( marc2ris );
28
use C4::XSLT;
28
use C4::XSLT qw( XSLTParse4Display );
29
29
30
30
31
use Koha::Biblios;
31
use Koha::Biblios;
Lines 72-77 if ($shelfid && $format) { Link Here
72
                    my $biblionumber = $content->biblionumber;
72
                    my $biblionumber = $content->biblionumber;
73
                    my $biblio = Koha::Biblios->find($biblionumber);
73
                    my $biblio = Koha::Biblios->find($biblionumber);
74
                    my $record = $biblio->metadata->record({ embed_items => 1 });
74
                    my $record = $biblio->metadata->record({ embed_items => 1 });
75
                    my $xslFile = $query->param("file");
75
                    if ($format eq 'iso2709') {
76
                    if ($format eq 'iso2709') {
76
                        $output .= $record->as_usmarc();
77
                        $output .= $record->as_usmarc();
77
                    }
78
                    }
Lines 82-88 if ($shelfid && $format) { Link Here
82
                        $output .= marc2bibtex($record, $biblionumber);
83
                        $output .= marc2bibtex($record, $biblionumber);
83
                    }
84
                    }
84
                    elsif ($format =~ /^xsl\.(.*)$/){
85
                    elsif ($format =~ /^xsl\.(.*)$/){
85
                        $output .= XSLTParse4Display($biblionumber, $record, 'XSLTCustomExport', 1, undef, ,'',$1,'');
86
                        $output .= XSLTParse4Display(
87
                            {
88
                                biblionumber => $biblionumber,
89
                                record => $record,
90
                                xsl_syspref  => 'XSLTCustomExport',
91
                                fix_amps     => 1,
92
                                hidden_items => undef,
93
                                xslfilename  => $xslFile,
94
                            }
95
                        );
86
                    }
96
                    }
87
                }
97
                }
88
            }
98
            }
(-)a/virtualshelves/shelves.pl (-2 / +1 lines)
Lines 30-36 use C4::Koha qw( Link Here
30
);
30
);
31
use C4::Members;
31
use C4::Members;
32
use C4::Output qw( pagination_bar output_html_with_http_headers output_and_exit_if_error );
32
use C4::Output qw( pagination_bar output_html_with_http_headers output_and_exit_if_error );
33
use C4::XSLT qw( XSLTParse4Display );
33
use C4::XSLT qw( XSLTParse4Display CustomXSLTExportList );
34
34
35
use Koha::Biblios;
35
use Koha::Biblios;
36
use Koha::Biblioitems;
36
use Koha::Biblioitems;
37
- 

Return to bug 17385