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

(-)a/C4/XSLT.pm (-5 / +6 lines)
Lines 131-154 sub get_xslt_sysprefs { Link Here
131
}
131
}
132
132
133
sub get_xsl_filename {
133
sub get_xsl_filename {
134
    my ($xslsyspref) = @_;
134
    my ($xslsyspref, $xslfilename) = @_;
135
135
136
    my $lang = C4::Languages::getlanguage();
136
    my $lang = C4::Languages::getlanguage();
137
137
138
    my $xslfilename = C4::Context->preference($xslsyspref) || "default";
138
    my $xslfilename ||= C4::Context->preference($xslsyspref) || "default";
139
139
140
    if ($xslsyspref eq "XSLTCustomExport") {
140
    if ($xslsyspref eq "XSLTCustomExport") {
141
        my $dir;
141
        my $dir;
142
        $dir = C4::Context->config('intrahtdocs') .
142
        $dir = C4::Context->config('intrahtdocs') .
143
            '/' . C4::Context->preference("template") .
143
            '/' . C4::Context->preference("template") .
144
            '/' . C4::Languages::getlanguage() .
144
            '/' . $lang .
145
            '/xslt/biblioexport';
145
            '/xslt/biblioexport';
146
        $xslfilename = $dir . "/" . $xslfilename;
146
        $xslfilename = $dir . "/" . $xslfilename;
147
    } elsif ($xslsyspref eq "OPACXSLTCustomExport") {
147
    } elsif ($xslsyspref eq "OPACXSLTCustomExport") {
148
        my $dir;
148
        my $dir;
149
        $dir = C4::Context->config('opachtdocs') .
149
        $dir = C4::Context->config('opachtdocs') .
150
            '/' . C4::Context->preference("opacthemes") .
150
            '/' . C4::Context->preference("opacthemes") .
151
            '/' . C4::Languages::getlanguage() .
151
            '/' . $lang .
152
            '/xslt/biblioexport';
152
            '/xslt/biblioexport';
153
        $xslfilename = $dir . "/" . $xslfilename;
153
        $xslfilename = $dir . "/" . $xslfilename;
154
    } elsif ( $xslfilename =~ /^\s*"?default"?\s*$/i ) {
154
    } elsif ( $xslfilename =~ /^\s*"?default"?\s*$/i ) {
Lines 205-215 sub XSLTParse4Display { Link Here
205
    my $variables    = $params->{xslt_variables};
205
    my $variables    = $params->{xslt_variables};
206
    my $items_rs     = $params->{items_rs};
206
    my $items_rs     = $params->{items_rs};
207
    my $interface    = C4::Context->interface;
207
    my $interface    = C4::Context->interface;
208
    my $xslfilename  = $params->{xslfilename};
208
209
209
    die "Mandatory \$params->{xsl_syspref} was not provided, called with biblionumber $params->{biblionumber}"
210
    die "Mandatory \$params->{xsl_syspref} was not provided, called with biblionumber $params->{biblionumber}"
210
        if not defined $params->{xsl_syspref};
211
        if not defined $params->{xsl_syspref};
211
212
212
    my $xslfilename = get_xsl_filename($xslsyspref);
213
    my $xslfilename = get_xsl_filename($xslsyspref, $xslfilename);
213
214
214
    my $frameworkcode    = GetFrameworkCode($biblionumber) || '';
215
    my $frameworkcode    = GetFrameworkCode($biblionumber) || '';
215
    my $record_processor = Koha::RecordProcessor->new(
216
    my $record_processor = Koha::RecordProcessor->new(
(-)a/basket/basket.pl (-1 / +1 lines)
Lines 26-32 use C4::Biblio qw( Link Here
26
);
26
);
27
use C4::Auth   qw( get_template_and_user );
27
use C4::Auth   qw( get_template_and_user );
28
use C4::Output qw( output_html_with_http_headers );
28
use C4::Output qw( output_html_with_http_headers );
29
use C4::XSLT;
29
use C4::XSLT qw( CustomXSLTExportList );
30
30
31
31
32
use Koha::AuthorisedValues;
32
use Koha::AuthorisedValues;
(-)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 79-85 if ( $bib_list && $format ) { Link Here
79
                $output .= marc2bibtex( $record, $biblionumber );
80
                $output .= marc2bibtex( $record, $biblionumber );
80
            }
81
            }
81
            elsif ($format =~ /^xsl\.(.*)$/) {
82
            elsif ($format =~ /^xsl\.(.*)$/) {
82
                $output .= XSLTParse4Display($biblio, $record, 'XSLTCustomExport', 1, undef, , '', $1, '');
83
                $output .= XSLTParse4Display({
84
                    biblionumber => $biblio,
85
                    record       => $record,
86
                    xsl_syspref  => 'XSLTCustomExport',
87
                    fix_amps     => 1,
88
                    hidden_items => undef,
89
                    xslfilename  => $xslFile
90
                });
83
            }
91
            }
84
        }
92
        }
85
    }
93
    }
(-)a/catalogue/detail.pl (-1 / +1 lines)
Lines 39-45 use C4::XISBN qw( get_xisbns ); Link Here
39
use C4::External::Amazon qw( get_amazon_tld );
39
use C4::External::Amazon qw( get_amazon_tld );
40
use C4::Search           qw( z3950_search_args enabled_staff_search_views new_record_from_zebra );
40
use C4::Search           qw( z3950_search_args enabled_staff_search_views new_record_from_zebra );
41
use C4::Tags             qw( get_tags );
41
use C4::Tags             qw( get_tags );
42
use C4::XSLT             qw( XSLTParse4Display );
42
use C4::XSLT             qw( XSLTParse4Display CustomXSLTExportList );
43
use Koha::DateUtils      qw( format_sqldatetime );
43
use Koha::DateUtils      qw( format_sqldatetime );
44
use C4::HTML5Media;
44
use C4::HTML5Media;
45
use C4::CourseReserves qw( GetItemCourseReservesInfo );
45
use C4::CourseReserves qw( GetItemCourseReservesInfo );
(-)a/catalogue/export.pl (-3 / +12 lines)
Lines 6-12 use C4::Auth qw( get_template_and_user ); Link Here
6
use C4::Output;
6
use C4::Output;
7
use CGI     qw ( -utf8 );
7
use CGI     qw ( -utf8 );
8
use C4::Ris qw( marc2ris );
8
use C4::Ris qw( marc2ris );
9
use C4::XSLT;
9
use C4::XSLT qw( XSLTParse4Display );
10
use Koha::Biblios;
10
11
11
12
12
my $query = CGI->new;
13
my $query = CGI->new;
Lines 85-95 if ( $op eq "export" ) { Link Here
85
    my $biblionumber = $query->param("bib");
86
    my $biblionumber = $query->param("bib");
86
    if ($biblionumber){
87
    if ($biblionumber){
87
        my $xslFile = $query->param("file");
88
        my $xslFile = $query->param("file");
88
        my $marc = GetMarcBiblio( { biblionumber => $biblionumber, embed_items => 1 } );
89
        my $biblio = Koha::Biblios->find($biblionumber);
90
        my $marc   = $biblio->metadata->record( { embed_items => 1 } );
89
        my $format=$query->param("format")||'txt';
91
        my $format=$query->param("format")||'txt';
90
        my @hiddenitems;
92
        my @hiddenitems;
91
93
92
        $marc = XSLTParse4Display($biblionumber, $marc, 'XSLTCustomExport', 1, \@hiddenitems, '', $xslFile,'');
94
        $marc = XSLTParse4Display({
95
            biblionumber => $biblionumber,
96
            record       => $marc,
97
            xsl_syspref  => "XSLTCustomExport",
98
            fix_amps     => 1,
99
            hidden_items => \@hiddenitems,
100
            xslfilename  => $xslFile,
101
        });
93
        print $query->header(
102
        print $query->header(
94
            -type => 'application/octet-stream',
103
            -type => 'application/octet-stream',
95
            -attachment=>"bib-$biblionumber.$format");
104
            -attachment=>"bib-$biblionumber.$format");
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc (-1 / +1 lines)
Lines 42-48 Link Here
42
                    <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>
42
                    <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>
43
                [% END %]
43
                [% END %]
44
                [% FOREACH xsl_export IN xsl_exports %]
44
                [% FOREACH xsl_export IN xsl_exports %]
45
                    <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>
45
                    <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>
46
                [% END %]
46
                [% END %]
47
            </ul>
47
            </ul>
48
        </div>
48
        </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt (-1 / +1 lines)
Lines 60-66 Link Here
60
                        <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>
60
                        <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>
61
                    [% END %]
61
                    [% END %]
62
                    [% FOREACH xsl_export IN xsl_exports %]
62
                    [% FOREACH xsl_export IN xsl_exports %]
63
                        <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>
63
                        <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>
64
                    [% END %]
64
                    [% END %]
65
                </ul>
65
                </ul>
66
            </div>
66
            </div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (-7 / +6 lines)
Lines 94-105 Link Here
94
            <div id="export">
94
            <div id="export">
95
                <div class="dropdown">
95
                <div class="dropdown">
96
                    <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>
96
                    <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>
97
                    <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="format">
97
                    <div class="dropdown-menu dropdown-menu-end" aria-labelledby="format">
98
                        [% FOREACH option IN export_options %]
98
                        [% FOREACH option IN export_options %]
99
                            [% IF option == 'dc' %]
99
                            [% IF option == 'dc' %]
100
                                <li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#exportModal_">Dublin Core</a></li>
100
                                <a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#exportModal_">Dublin Core</a>
101
                            [% ELSIF option != 'custom' %]
101
                            [% ELSIF option != 'custom' %]
102
                                <li><a class="dropdown-item" href="/cgi-bin/koha/opac-export.pl?op=export&amp;bib=[% biblio.biblionumber | html %]&amp;format=[% option | html %]">
102
                                <a class="dropdown-item" href="/cgi-bin/koha/opac-export.pl?op=export&amp;bib=[% biblio.biblionumber | html %]&amp;format=[% option | html %]">
103
                                    [% SWITCH option %]
103
                                    [% SWITCH option %]
104
                                    [% CASE 'bibtex' %]
104
                                    [% CASE 'bibtex' %]
105
                                        <span>BIBTEX</span>
105
                                        <span>BIBTEX</span>
Lines 120-134 Link Here
120
                                    [% CASE 'isbd' %]
120
                                    [% CASE 'isbd' %]
121
                                        <span>ISBD</span>
121
                                        <span>ISBD</span>
122
                                    [% END %]
122
                                    [% END %]
123
                                    </a>
123
                                </a>
124
                                </li>
125
                            [% ELSE %]
124
                            [% ELSE %]
126
                                [% FOREACH filesOption IN filesOptions %]
125
                                [% FOREACH filesOption IN filesOptions %]
127
                                    <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>
126
                                    <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>
128
                                [% END %]
127
                                [% END %]
129
                            [% END %]
128
                            [% END %]
130
                        [% END %]
129
                        [% END %]
131
                    </ul>
130
                    </div>
132
                    <!-- /.dropdown-menu -->
131
                    <!-- /.dropdown-menu -->
133
                </div>
132
                </div>
134
                <!-- /.dropdown -->
133
                <!-- /.dropdown -->
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt (+8 lines)
Lines 49-54 Link Here
49
                                <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>
49
                                <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>
50
                            [% END %]
50
                            [% END %]
51
51
52
                            [% SET export_options = Koha.Preference('OpacExportOptions').split(',') %]
52
                            <div id="download-cart" class="btn-group dropdown">
53
                            <div id="download-cart" class="btn-group dropdown">
53
                                <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="#"
54
                                <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="#"
54
                                    ><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download <b class="caret"></b
55
                                    ><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download <b class="caret"></b
Lines 61-66 Link Here
61
                                    [% FOREACH csv_profile IN csv_profiles %]
62
                                    [% FOREACH csv_profile IN csv_profiles %]
62
                                        <a role="menuitem" class="dropdown-item download-cart" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
63
                                        <a role="menuitem" class="dropdown-item download-cart" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
63
                                    [% END %]
64
                                    [% END %]
65
                                    [% FOREACH option IN export_options %]
66
                                        [% IF option == 'custom' %]
67
                                            [% FOREACH xsl_export IN xsl_exports %]
68
                                                <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>
69
                                            [% END %]
70
                                        [% END %]
71
                                    [% END %]
64
                                </div>
72
                                </div>
65
                            </div>
73
                            </div>
66
74
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (+8 lines)
Lines 237-242 Link Here
237
                                    <div class="list-actions">
237
                                    <div class="list-actions">
238
                                        <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>
238
                                        <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>
239
239
240
                                        [% SET export_options = Koha.Preference('OpacExportOptions').split(',') %]
240
                                        <div id="download-list" class="btn-group dropdown">
241
                                        <div id="download-list" class="btn-group dropdown">
241
                                            <a
242
                                            <a
242
                                                id="format"
243
                                                id="format"
Lines 255-260 Link Here
255
                                                [% FOREACH csv_profile IN csv_profiles %]
256
                                                [% FOREACH csv_profile IN csv_profiles %]
256
                                                    <a role="menuitem" class="dropdown-item download-list" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
257
                                                    <a role="menuitem" class="dropdown-item download-list" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
257
                                                [% END %]
258
                                                [% END %]
259
                                                [% FOREACH option IN export_options %]
260
                                                    [% IF option == 'custom' %]
261
                                                        [% FOREACH xsl_export IN xsl_exports %]
262
                                                            <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>
263
                                                        [% END %]
264
                                                    [% END %]
265
                                                [% END %]
258
                                            </div>
266
                                            </div>
259
                                        </div>
267
                                        </div>
260
268
(-)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 135-140 $template->param( Link Here
135
    csv_profiles   => Koha::CsvProfiles->search( { type => 'marc', used_for => 'export_records', staff_only => 0 } ),
136
    csv_profiles   => Koha::CsvProfiles->search( { type => 'marc', used_for => 'export_records', staff_only => 0 } ),
136
    bib_list       => $bib_list,
137
    bib_list       => $bib_list,
137
    BIBLIO_RESULTS => $resultsarray,
138
    BIBLIO_RESULTS => $resultsarray,
139
    xsl_exports    => CustomXSLTExportList(),
138
);
140
);
139
141
140
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
142
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
(-)a/opac/opac-detail.pl (-2 / +1 lines)
Lines 57-63 use C4::External::Syndetics qw( Link Here
57
    get_syndetics_toc
57
    get_syndetics_toc
58
);
58
);
59
use C4::Members;
59
use C4::Members;
60
use C4::XSLT         qw( XSLTParse4Display );
60
use C4::XSLT         qw( XSLTParse4Display CustomXSLTExportList );
61
use C4::ShelfBrowser qw( GetNearbyItems );
61
use C4::ShelfBrowser qw( GetNearbyItems );
62
use C4::Reserves     qw( GetReserveStatus IsAvailableForItemLevelRequest );
62
use C4::Reserves     qw( GetReserveStatus IsAvailableForItemLevelRequest );
63
use C4::Charset      qw( SetUTF8Flag );
63
use C4::Charset      qw( SetUTF8Flag );
Lines 102-108 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
102
    }
102
    }
103
);
103
);
104
104
105
#### ADD CUSTOM XSLT
106
$template->param(filesOptions => CustomXSLTExportList(1));
105
$template->param(filesOptions => CustomXSLTExportList(1));
107
106
108
my $patron = Koha::Patrons->find($borrowernumber);
107
my $patron = Koha::Patrons->find($borrowernumber);
(-)a/opac/opac-downloadcart.pl (-4 / +11 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 84-89 if ( $bib_list && $format ) { Link Here
84
                    patron      => $patron,
84
                    patron      => $patron,
85
                }
85
                }
86
            );
86
            );
87
            my $xslFile = $query->param("file");
87
            my $framework = &GetFrameworkCode($biblio);
88
            my $framework = &GetFrameworkCode($biblio);
88
            $record_processor->options(
89
            $record_processor->options(
89
                {
90
                {
Lines 115-123 if ( $bib_list && $format ) { Link Here
115
                );
116
                );
116
                $extension = "txt";
117
                $extension = "txt";
117
                $type      = "text/plain";
118
                $type      = "text/plain";
118
            }
119
            } elsif ($format =~ /^xsl\.(.*)$/) {
119
            elsif ($format =~ /^xsl\.(.*)$/) {
120
                $output .= XSLTParse4Display({
120
                $output .= XSLTParse4Display($biblio, $record, 'OPACXSLTCustomExport', 1, undef, undef, $1, '');
121
                    biblionumber => $biblionumber,
122
                    record       => $record,
123
                    xsl_syspref  => "OPACXSLTCustomExport",
124
                    fix_amps     => 1,
125
                    hidden_items => undef,
126
                    xslfilename  => $xslFile,
127
                });
121
            }
128
            }
122
        }
129
        }
123
    }
130
    }
(-)a/opac/opac-downloadshelf.pl (-4 / +12 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 97-102 if ( $shelf and $shelf->can_be_viewed($borrowernumber) ) { Link Here
97
                        patron      => $patron,
97
                        patron      => $patron,
98
                    }
98
                    }
99
                );
99
                );
100
                my $xslFile = $query->param("file");
100
                my $framework = $biblio->frameworkcode;
101
                my $framework = $biblio->frameworkcode;
101
                $record_processor->options(
102
                $record_processor->options(
102
                    {
103
                    {
Lines 123-131 if ( $shelf and $shelf->can_be_viewed($borrowernumber) ) { Link Here
123
                    );
124
                    );
124
                    $extension = "txt";
125
                    $extension = "txt";
125
                    $type      = "text/plain";
126
                    $type      = "text/plain";
126
                }elsif ($format =~ /^xsl\.(.*)$/){
127
                } elsif ($format =~ /^xsl\.(.*)$/){
127
                         $output .= XSLTParse4Display($biblionumber, $record, 'XSLTCustomExport', 1, undef, undef, $1, '', 1);
128
                    $output .= XSLTParse4Display({
128
                    }
129
                        biblionumber => $biblionumber,
130
                        record       => $record,
131
                        xsl_syspref  => "OPACXSLTCustomExport",
132
                        fix_amps     => 1,
133
                        hidden_items => undef,
134
                        xslfilename  => $xslFile,
135
                    });
136
                }
129
            }
137
            }
130
        }
138
        }
131
139
(-)a/opac/opac-export.pl (-3 / +11 lines)
Lines 30-36 use CGI qw ( -utf8 ); Link Here
30
use C4::Auth;
30
use C4::Auth;
31
use C4::Ris qw( marc2ris );
31
use C4::Ris qw( marc2ris );
32
use Koha::Biblios;
32
use Koha::Biblios;
33
use C4::XSLT;
33
use C4::XSLT qw( XSLTParse4Display );
34
34
35
use Koha::RecordProcessor;
35
use Koha::RecordProcessor;
36
36
Lines 156-165 if ( $format =~ /endnote/ ) { Link Here
156
} elsif ($format =~ /html/ ) {
156
} elsif ($format =~ /html/ ) {
157
    if ($biblionumber){
157
    if ($biblionumber){
158
        my $xslFile = $query->param("file");
158
        my $xslFile = $query->param("file");
159
        $marc = C4::Biblio::GetMarcBiblio({biblionumber => $biblionumber});
159
        my $biblio = Koha::Biblios->find($biblionumber);
160
        $marc = $biblio->metadata->record;
160
        my @hiddenitems;
161
        my @hiddenitems;
161
162
162
        $marc = XSLTParse4Display($biblionumber, $marc, 'OPACXSLTCustomExport', 1, \@hiddenitems, undef, $xslFile, undef);
163
        $marc = XSLTParse4Display({
164
            biblionumber => $biblionumber,
165
            record       => $marc,
166
            xsl_syspref  => "OPACXSLTCustomExport",
167
            fix_amps     => 1,
168
            hidden_items => \@hiddenitems,
169
            xslfilename  => $xslFile,
170
        });
163
    }
171
    }
164
} else {
172
} else {
165
    $error = "Format $format is not supported.";
173
    $error = "Format $format is not supported.";
(-)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 544-550 $template->param( Link Here
544
    print         => scalar $query->param('print') || 0,
544
    print         => scalar $query->param('print') || 0,
545
    listsview     => 1,
545
    listsview     => 1,
546
    staffuser     => $staffuser,
546
    staffuser     => $staffuser,
547
    permitteduser => $permitteduser
547
    permitteduser => $permitteduser,
548
    xsl_exports   => CustomXSLTExportList(),
548
);
549
);
549
550
550
my $content_type = $query->param('rss') ? 'rss' : 'html';
551
my $content_type = $query->param('rss') ? 'rss' : 'html';
(-)a/virtualshelves/downloadshelf.pl (-2 / +10 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
                    } elsif ( $format eq 'ris' ) {
78
                    } elsif ( $format eq 'ris' ) {
Lines 80-86 if ( $shelfid && $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($biblionumber, $record, 'XSLTCustomExport', 1, undef, ,'',$1,'');
84
                        $output .= XSLTParse4Display({
85
                            biblionumber => $biblionumber,
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/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