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

(-)a/C4/XSLT.pm (-5 / +6 lines)
Lines 127-150 sub get_xslt_sysprefs { Link Here
127
}
127
}
128
128
129
sub get_xsl_filename {
129
sub get_xsl_filename {
130
    my ( $xslsyspref ) = @_;
130
    my ( $xslsyspref, $xslfilename ) = @_;
131
131
132
    my $lang   = C4::Languages::getlanguage();
132
    my $lang   = C4::Languages::getlanguage();
133
133
134
    my $xslfilename = C4::Context->preference($xslsyspref) || "default";
134
    $xslfilename ||= C4::Context->preference($xslsyspref) || "default";
135
135
136
    if ($xslsyspref eq "XSLTCustomExport") {
136
    if ($xslsyspref eq "XSLTCustomExport") {
137
        my $dir;
137
        my $dir;
138
        $dir = C4::Context->config('intrahtdocs') .
138
        $dir = C4::Context->config('intrahtdocs') .
139
            '/' . C4::Context->preference("template") .
139
            '/' . C4::Context->preference("template") .
140
            '/' . C4::Languages::getlanguage() .
140
            '/' . $lang .
141
            '/xslt/biblioexport';
141
            '/xslt/biblioexport';
142
        $xslfilename = $dir . "/" . $xslfilename;
142
        $xslfilename = $dir . "/" . $xslfilename;
143
    } elsif ($xslsyspref eq "OPACXSLTCustomExport") {
143
    } elsif ($xslsyspref eq "OPACXSLTCustomExport") {
144
        my $dir;
144
        my $dir;
145
        $dir = C4::Context->config('opachtdocs') .
145
        $dir = C4::Context->config('opachtdocs') .
146
            '/' . C4::Context->preference("opacthemes") .
146
            '/' . C4::Context->preference("opacthemes") .
147
            '/' . C4::Languages::getlanguage() .
147
            '/' . $lang .
148
            '/xslt/biblioexport';
148
            '/xslt/biblioexport';
149
        $xslfilename = $dir . "/" . $xslfilename;
149
        $xslfilename = $dir . "/" . $xslfilename;
150
    } elsif ( $xslfilename =~ /^\s*"?default"?\s*$/i ) {
150
    } 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
    $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 (-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 39-45 Link Here
39
                        <li><a 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>
39
                        <li><a 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>
40
                    [% END %]
40
                    [% END %]
41
                    [% FOREACH xsl_export IN xsl_exports %]
41
                    [% FOREACH xsl_export IN xsl_exports %]
42
                        <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>
42
                        <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>
43
                    [% END %]
43
                    [% END %]
44
                </ul>
44
                </ul>
45
        </div>
45
        </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt (-1 / +1 lines)
Lines 64-70 Link Here
64
                                <li><a 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>
64
                                <li><a 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
                            [% END %]
65
                            [% END %]
66
                            [% FOREACH xsl_export IN xsl_exports %]
66
                            [% FOREACH xsl_export IN xsl_exports %]
67
                                <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>
67
                                <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>
68
                            [% END %]
68
                            [% END %]
69
                            </ul>
69
                            </ul>
70
                        </div>
70
                        </div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (-27 / +25 lines)
Lines 66-101 Link Here
66
        <li>
66
        <li>
67
            <div id="export">
67
            <div id="export">
68
                <div class="dropdown">
68
                <div class="dropdown">
69
                    <a id="format" class="btn btn-link btn-lg dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-fw fa-download"></i> Save record <b class="caret"></b></a>
69
                    <a id="format" class="btn btn-link btn-lg dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Save record <b class="caret"></b></a>
70
                        <ul class="dropdown-menu pull-left" role="menu" aria-labelledby="format">
70
                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="format">
71
                            [% FOREACH option IN export_options %]
71
                        [% FOREACH option IN export_options %]
72
                                [% IF option == 'dc' %]
72
                            [% IF option == 'dc' %]
73
                                    <li><a role="menuitem" href="#" data-toggle="modal" data-target="#exportModal_">Dublin Core</a></li>
73
                                <a class="dropdown-item" href="#" data-toggle="modal" data-target="#exportModal_">Dublin Core</a>
74
                                [% ELSIF option != 'custom' %]
74
                            [% ELSIF option != 'custom' %]
75
                                <li>
75
                                <a class="dropdown-item" href="/cgi-bin/koha/opac-export.pl?op=export&amp;bib=[% biblio.biblionumber | html %]&amp;format=[% option | html %]">
76
                                    <a role="menuitem" href="/cgi-bin/koha/opac-export.pl?op=export&amp;bib=[% biblio.biblionumber | html %]&amp;format=[% option | html %]">
76
                                    [% SWITCH option %]
77
                                        [% SWITCH option %]
77
                                        [% CASE 'bibtex' %]<span>BIBTEX</span>
78
                                            [% CASE 'bibtex' %]BIBTEX
78
                                        [% CASE 'endnote' %]<span>EndNote</span>
79
                                            [% CASE 'endnote' %]EndNote
79
                                        [% CASE 'marcxml' %]<span>MARCXML</span>
80
                                            [% CASE 'marcxml' %]MARCXML
80
                                        [% CASE 'marc8' %]<span>MARC (non-Unicode/MARC-8)</span>
81
                                            [% CASE 'marc8' %]MARC (non-Unicode/MARC-8)
81
                                        [% CASE 'utf8' %]<span>MARC (Unicode/UTF-8)</span>
82
                                            [% CASE 'utf8' %]MARC (Unicode/UTF-8)
82
                                        [% CASE 'marcstd' %]<span>MARC (Unicode/UTF-8, Standard)</span>
83
                                            [% CASE 'marcstd' %]MARC (Unicode/UTF-8, Standard)
83
                                        [% CASE 'mods' %]<span>MODS (XML)</span>
84
                                            [% CASE 'mods' %]MODS (XML)
84
                                        [% CASE 'ris' %]<span>RIS</span>
85
                                            [% CASE 'ris' %]RIS
85
                                        [% CASE 'isbd' %]<span>ISBD</span>
86
                                            [% CASE 'isbd' %]ISBD
87
                                        [% END %]
88
                                    </a>
89
                                </li>
90
                                [% ELSE %]
91
                                    [% FOREACH filesOption IN filesOptions %]
92
                                        <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>
93
                                    [% END %]
86
                                    [% END %]
87
                                </a>
88
                            [% ELSE %]
89
                                [% FOREACH filesOption IN filesOptions %]
90
                                    <a 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>
94
                                [% END %]
91
                                [% END %]
95
                            [% END %]
92
                            [% END %]
96
                        </ul>
93
                        [% END %]
97
                </div>
94
                    </div> <!-- /.dropdown-menu -->
98
            </div>
95
                </div> <!-- /.dropdown -->
96
            </div> <!-- /#export -->
99
        </li>
97
        </li>
100
    [% END %]
98
    [% END %]
101
99
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt (+8 lines)
Lines 30-35 Link Here
30
                                    <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>
30
                                    <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>
31
                                [% END %]
31
                                [% END %]
32
32
33
                                [% SET export_options = Koha.Preference('OpacExportOptions').split(',') %]
33
                                <div id="download-cart" class="btn-group dropdown">
34
                                <div id="download-cart" class="btn-group dropdown">
34
                                    <a id="format" class="btn btn-link dropdown-toggle" aria-haspopup="menu" aria-label="Select format and download cart" data-toggle="dropdown" role="button" href="#"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download <b class="caret"></b></a>
35
                                    <a id="format" class="btn btn-link dropdown-toggle" aria-haspopup="menu" aria-label="Select format and download cart" data-toggle="dropdown" role="button" href="#"><i class="fa fa-fw fa-download" aria-hidden="true"></i> Download <b class="caret"></b></a>
35
                                    <div class="dropdown-menu" role="menu" aria-labelledby="format">
36
                                    <div class="dropdown-menu" role="menu" aria-labelledby="format">
Lines 40-45 Link Here
40
                                        [% FOREACH csv_profile IN csv_profiles %]
41
                                        [% FOREACH csv_profile IN csv_profiles %]
41
                                            <a role="menuitem" class="dropdown-item download-cart" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
42
                                            <a role="menuitem" class="dropdown-item download-cart" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
42
                                        [% END %]
43
                                        [% END %]
44
                                        [% FOREACH option IN export_options %]
45
                                            [% IF option == 'custom' %]
46
                                                [% FOREACH xsl_export IN xsl_exports %]
47
                                                    <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>
48
                                                [% END %]
49
                                            [% END %]
50
                                        [% END %]
43
                                    </div>
51
                                    </div>
44
                                </div>
52
                                </div>
45
53
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (+8 lines)
Lines 227-232 Link Here
227
                                    <div class="list-actions">
227
                                    <div class="list-actions">
228
                                        <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>
228
                                        <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>
229
229
230
                                        [% SET export_options = Koha.Preference('OpacExportOptions').split(',') %]
230
                                        <div id="download-list" class="btn-group dropdown">
231
                                        <div id="download-list" class="btn-group dropdown">
231
                                            <a id="format" class="btn btn-link dropdown-toggle" aria-haspopup="menu" aria-label="Select format and download list" data-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>
232
                                            <a id="format" class="btn btn-link dropdown-toggle" aria-haspopup="menu" aria-label="Select format and download list" data-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>
232
                                            <div class="dropdown-menu pull-left" role="menu" aria-labelledby="format">
233
                                            <div class="dropdown-menu pull-left" role="menu" aria-labelledby="format">
Lines 237-242 Link Here
237
                                                [% FOREACH csv_profile IN csv_profiles %]
238
                                                [% FOREACH csv_profile IN csv_profiles %]
238
                                                    <a role="menuitem" class="dropdown-item download-list" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
239
                                                    <a role="menuitem" class="dropdown-item download-list" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
239
                                                [% END %]
240
                                                [% END %]
241
                                                [% FOREACH option IN export_options %]
242
                                                    [% IF option == 'custom' %]
243
                                                        [% FOREACH xsl_export IN xsl_exports %]
244
                                                            <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>
245
                                                        [% END %]
246
                                                    [% END %]
247
                                                [% END %]
240
                                            </div>
248
                                            </div>
241
                                        </div>
249
                                        </div>
242
250
(-)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
my $query = CGI->new;
37
my $query = CGI->new;
Lines 142-151 elsif ( $format =~ /isbd/ ) { Link Here
142
elsif ($format =~ /html/ ) {
141
elsif ($format =~ /html/ ) {
143
    if ($biblionumber){
142
    if ($biblionumber){
144
        my $xslFile = $query->param("file");
143
        my $xslFile = $query->param("file");
145
        $marc = C4::Biblio::GetMarcBiblio({biblionumber => $biblionumber});
144
        my $biblio = Koha::Biblios->find($biblionumber);
145
        $marc = $biblio->metadata->record;
146
        my @hiddenitems;
146
        my @hiddenitems;
147
147
148
        $marc = XSLTParse4Display($biblionumber, $marc, 'OPACXSLTCustomExport', 1, \@hiddenitems, undef, $xslFile, undef);
148
        $marc = XSLTParse4Display(
149
            {
150
                biblionumber => $biblionumber,
151
                record => $marc,
152
                xsl_syspref  => "OPACXSLTCustomExport",
153
                fix_amps  => 1,
154
                hidden_items => \@hiddenitems,
155
                xslfilename    => $xslFile,
156
            }
157
        );
149
    }
158
    }
150
}
159
}
151
else {
160
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 503-509 $template->param( Link Here
503
    print         => scalar $query->param('print') || 0,
503
    print         => scalar $query->param('print') || 0,
504
    listsview     => 1,
504
    listsview     => 1,
505
    staffuser     => $staffuser,
505
    staffuser     => $staffuser,
506
    permitteduser => $permitteduser
506
    permitteduser => $permitteduser,
507
    xsl_exports => CustomXSLTExportList()
507
);
508
);
508
509
509
my $content_type = $query->param('rss')? 'rss' : 'html';
510
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