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

(-)a/C4/XSLT.pm (-1 / +1 lines)
Lines 444-450 sub engine { Link Here
444
444
445
sub CustomXSLTExportList {
445
sub CustomXSLTExportList {
446
    my $opac = shift; # opac (1) vs intranet (0)
446
    my $opac = shift; # opac (1) vs intranet (0)
447
    return [] if $opac && C4::Context->preference('OpacExportOptions') !~ /custom/;
447
    return [] if $opac && C4::Context->preference('OpacExportOptions') !~ /html/;
448
448
449
    my $customXSLTExportPath = C4::Context->preference('CustomXSLTExportPath');
449
    my $customXSLTExportPath = C4::Context->preference('CustomXSLTExportPath');
450
    # Check the cache first
450
    # Check the cache first
(-)a/installer/data/mysql/atomicupdate/bug_17385-CustomOptionForOpacExportOptions_syspref.pl (-2 / +2 lines)
Lines 2-8 use Modern::Perl; Link Here
2
2
3
return {
3
return {
4
    bug_number  => "17385",
4
    bug_number  => "17385",
5
    description => "Add a custom option for OpacExportOptions system preference",
5
    description => "Add a custom html option for OpacExportOptions system preference",
6
    up          => sub {
6
    up          => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
Lines 10-16 return { Link Here
10
        $dbh->do(
10
        $dbh->do(
11
            q{
11
            q{
12
                UPDATE systempreferences
12
                UPDATE systempreferences
13
                SET value = 'bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,custom'
13
                SET value = 'bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,html'
14
                WHERE variable = 'OpacExportOptions';
14
                WHERE variable = 'OpacExportOptions';
15
            }
15
            }
16
        );
16
        );
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 490-496 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
490
('OPACDetailQRCode','0','','Enable the display of a QR Code on the OPAC detail page','YesNo'),
490
('OPACDetailQRCode','0','','Enable the display of a QR Code on the OPAC detail page','YesNo'),
491
('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
491
('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
492
('OPACDisplay856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','Choice'),
492
('OPACDisplay856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','Choice'),
493
('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,custom','','Define export options available on OPAC detail page.','multiple'),
493
('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,html','','Define export options available on OPAC detail page.','multiple'),
494
('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'),
494
('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'),
495
('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'),
495
('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'),
496
('OPACFineNoRenewals','100','','Fine limit above which user cannot renew books via OPAC','Integer'),
496
('OPACFineNoRenewals','100','','Fine limit above which user cannot renew books via OPAC','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +1 lines)
Lines 306-312 OPAC: Link Here
306
                mods: MODS
306
                mods: MODS
307
                ris: RIS
307
                ris: RIS
308
                isbd: ISBD
308
                isbd: ISBD
309
                custom: Simple HTML formats
309
                html: Simple HTML formats
310
        -
310
        -
311
            - pref: OpacSeparateHoldings
311
            - pref: OpacSeparateHoldings
312
              choices:
312
              choices:
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (-1 / +1 lines)
Lines 98-104 Link Here
98
                        [% FOREACH option IN export_options %]
98
                        [% FOREACH option IN export_options %]
99
                            [% IF option == 'dc' %]
99
                            [% IF option == 'dc' %]
100
                                <a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#exportModal_">Dublin Core</a>
100
                                <a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#exportModal_">Dublin Core</a>
101
                            [% ELSIF option != 'custom' %]
101
                            [% ELSIF 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 %]">
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' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt (-1 / +1 lines)
Lines 63-69 Link Here
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
                                        <a role="menuitem" class="dropdown-item download-cart" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
64
                                    [% END %]
64
                                    [% END %]
65
                                    [% FOREACH option IN export_options %]
65
                                    [% FOREACH option IN export_options %]
66
                                        [% IF option == 'custom' %]
66
                                        [% IF option == 'html' %]
67
                                            [% FOREACH xsl_export IN xsl_exports %]
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_export.filename | html %]</a>
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_export.filename | html %]</a>
69
                                            [% END %]
69
                                            [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-1 / +1 lines)
Lines 257-263 Link Here
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
                                                    <a role="menuitem" class="dropdown-item download-list" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a>
258
                                                [% END %]
258
                                                [% END %]
259
                                                [% FOREACH option IN export_options %]
259
                                                [% FOREACH option IN export_options %]
260
                                                    [% IF option == 'custom' %]
260
                                                    [% IF option == 'html' %]
261
                                                        [% FOREACH xsl_export IN xsl_exports %]
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_export.filename | html %]</a>
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_export.filename | html %]</a>
263
                                                        [% END %]
263
                                                        [% END %]
(-)a/t/db_dependent/XSLT.t (-3 / +2 lines)
Lines 118-124 subtest 'Tests moved from t' => sub { Link Here
118
    make_path( "$dir/bootstrap/" . C4::Languages::getlanguage() . "/xslt/biblioexport" );
118
    make_path( "$dir/bootstrap/" . C4::Languages::getlanguage() . "/xslt/biblioexport" );
119
    createXSLTFiles( "$dir/bootstrap/" . C4::Languages::getlanguage() . "/xslt/biblioexport" );
119
    createXSLTFiles( "$dir/bootstrap/" . C4::Languages::getlanguage() . "/xslt/biblioexport" );
120
120
121
    t::lib::Mocks::mock_preference( 'OpacExportOptions', 'custom' );
121
    t::lib::Mocks::mock_preference( 'OpacExportOptions', 'html' );
122
    my @custom_xslts = @{ C4::XSLT::CustomXSLTExportList(1) };
122
    my @custom_xslts = @{ C4::XSLT::CustomXSLTExportList(1) };
123
123
124
    ok( ( scalar @custom_xslts) == 2, "CustomXSLTExportList finds custom XSLTs" );
124
    ok( ( scalar @custom_xslts) == 2, "CustomXSLTExportList finds custom XSLTs" );
Lines 280-286 subtest 'buildKohaItemsNamespace status tests' => sub { Link Here
280
280
281
subtest 'CustomXSLTExportList: Check export options' => sub {
281
subtest 'CustomXSLTExportList: Check export options' => sub {
282
    plan tests => 2;
282
    plan tests => 2;
283
    t::lib::Mocks::mock_preference('OpacExportOptions', 'custom');
283
    t::lib::Mocks::mock_preference('OpacExportOptions', 'html');
284
    my $list = C4::XSLT::CustomXSLTExportList(1);
284
    my $list = C4::XSLT::CustomXSLTExportList(1);
285
    is( $list>0, 1, 'We expect at least one result: simple export' );
285
    is( $list>0, 1, 'We expect at least one result: simple export' );
286
    $cache->clear_from_cache('CustomXSLTExportListOPAC');
286
    $cache->clear_from_cache('CustomXSLTExportListOPAC');
287
- 

Return to bug 17385