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

(-)a/C4/XSLT.pm (-3 / +9 lines)
Lines 163-168 sub _get_best_default_xslt_filename { Link Here
163
    }
163
    }
164
    return $xslfilename;
164
    return $xslfilename;
165
}
165
}
166
=head2 get_xslt_sysprefs
167
168
    returns XML xslt sysprefs
169
170
=cut
166
171
167
sub get_xslt_sysprefs {
172
sub get_xslt_sysprefs {
168
    my $sysxml = "<sysprefs>\n";
173
    my $sysxml = "<sysprefs>\n";
Lines 263-269 sub XSLTParse4Display { Link Here
263
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
268
    my $itemsxml  = buildKohaItemsNamespace($biblionumber, $hidden_items);
264
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
269
    my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
265
270
266
    $variables ||= {};
271
    my $variables ||= {};
267
    if (C4::Context->preference('OPACShowOpenURL')) {
272
    if (C4::Context->preference('OPACShowOpenURL')) {
268
        my @biblio_itemtypes;
273
        my @biblio_itemtypes;
269
        my $biblio = Koha::Biblios->find($biblionumber);
274
        my $biblio = Koha::Biblios->find($biblionumber);
Lines 416-422 sub CustomXSLTExportList { Link Here
416
                      '/' . C4::Context->preference( $opac ? "opacthemes" : "template") .
421
                      '/' . C4::Context->preference( $opac ? "opacthemes" : "template") .
417
                      '/' . C4::Languages::getlanguage() .
422
                      '/' . C4::Languages::getlanguage() .
418
                      '/xslt/biblioexport';
423
                      '/xslt/biblioexport';
419
    my @files = <$dir/*.xsl>;
424
    my @files = glob qq("$dir/*.xsl");
420
    foreach my $file (@files) {
425
    foreach my $file (@files) {
421
        if ( -f "$file" ) {
426
        if ( -f "$file" ) {
422
            (my $text = $file) =~ s/.*\///g;
427
            (my $text = $file) =~ s/.*\///g;
Lines 433-439 sub CustomXSLTExportList { Link Here
433
            # Get output format
438
            # Get output format
434
            # There should only be one xsl:output node, so taking the first one only is OK
439
            # There should only be one xsl:output node, so taking the first one only is OK
435
            $node = @{$node->findnodes("xsl:output")}[0];
440
            $node = @{$node->findnodes("xsl:output")}[0];
436
            my $outputformat = $node->{"method"} if $node;
441
            my $outputformat= "";
442
            $outputformat = $node->{"method"} if $node;
437
            $outputformat = "txt" if ($outputformat eq "" || $outputformat eq "text");
443
            $outputformat = "txt" if ($outputformat eq "" || $outputformat eq "text");
438
444
439
            my %row = (
445
            my %row = (
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-1 / +1 lines)
Lines 97-103 CAN_user_serials_create_subscription ) %] Link Here
97
        <li><a href="/cgi-bin/koha/catalogue/export.pl?format=mods&amp;op=export&amp;bib=[% biblionumber | uri %]">MODS (XML)</a></li>
97
        <li><a href="/cgi-bin/koha/catalogue/export.pl?format=mods&amp;op=export&amp;bib=[% biblionumber | uri %]">MODS (XML)</a></li>
98
        <li><a href="/cgi-bin/koha/catalogue/export.pl?format=ris&amp;op=export&amp;bib=[% biblionumber | uri %]">RIS</a></li>
98
        <li><a href="/cgi-bin/koha/catalogue/export.pl?format=ris&amp;op=export&amp;bib=[% biblionumber | uri %]">RIS</a></li>
99
        [% FOREACH filesOption IN filesOptions %]
99
        [% FOREACH filesOption IN filesOptions %]
100
            <li><a href="/cgi-bin/koha/catalogue/export.pl?format=[% filesOption.format %]&amp;op=exportxsl&amp;file=[% filesOption.value %]&amp;bib=[% biblionumber | html %]">[% filesOption.filename %]</a></li>
100
            <li><a href="/cgi-bin/koha/catalogue/export.pl?format=[% filesOption.format | uri %]&amp;op=exportxsl&amp;file=[% filesOption.value | uri %]&amp;bib=[% biblionumber | uri %]">[% filesOption.filename | html %]</a></li>
101
        [% END %]
101
        [% END %]
102
    </ul>
102
    </ul>
103
    </div>
103
    </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc (-1 / +1 lines)
Lines 32-38 Link Here
32
                        <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>
32
                        <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>
33
                    [% END %]
33
                    [% END %]
34
                    [% FOREACH xsl_export IN xsl_exports %]
34
                    [% FOREACH xsl_export IN xsl_exports %]
35
                        <li><a href="/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=xsl.[% xsl_export.value %]&amp;shelfid=[% shelf.shelfnumber %]">XSL - [% xsl_export.filename %]</a></li>
35
                        <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>
36
                    [% END %]
36
                    [% END %]
37
                </ul>
37
                </ul>
38
        </div>
38
        </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt (-1 / +1 lines)
Lines 57-63 Link Here
57
                                <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>
57
                                <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>
58
                            [% END %]
58
                            [% END %]
59
                            [% FOREACH xsl_export IN xsl_exports %]
59
                            [% FOREACH xsl_export IN xsl_exports %]
60
                                <li><a href="/cgi-bin/koha/basket/downloadcart.pl?format=xsl.[% xsl_export.value %]&amp;bib_list=[% bib_list %]">XSL - [% xsl_export.filename %]</a></li>
60
                                <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>
61
                            [% END %]
61
                            [% END %]
62
                            </ul>
62
                            </ul>
63
                        </div>
63
                        </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +1 lines)
Lines 754-760 Link Here
754
754
755
        <option value="utf8">MARC (Unicode/UTF-8)</option>
755
        <option value="utf8">MARC (Unicode/UTF-8)</option>
756
        [% FOREACH filesOption IN filesOptions %]
756
        [% FOREACH filesOption IN filesOptions %]
757
            <option value="[% filesOption.value %]">[% filesOption.filename %]</option>
757
            <option value="[% filesOption.value | html %]">[% filesOption.filename | html %]</option>
758
        [% END %]</select>
758
        [% END %]</select>
759
        <input type="submit" name="save" value="Download Record" /></td>
759
        <input type="submit" name="save" value="Download Record" /></td>
760
  </tr>
760
  </tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt (-1 / +1 lines)
Lines 37-43 Link Here
37
	    <option value="[% csv_profile.export_format_id | html %]">CSV - [% csv_profile.profile | html %]</option>
37
	    <option value="[% csv_profile.export_format_id | html %]">CSV - [% csv_profile.profile | html %]</option>
38
	    [% END %]
38
	    [% END %]
39
        [% FOREACH xsl_export IN xsl_exports %]
39
        [% FOREACH xsl_export IN xsl_exports %]
40
            <option value="xsl.[% xsl_export.value %]">XSL - [% xsl_export.filename %]</option>
40
            <option value="xsl.[% xsl_export.value | html %]">XSL - [% xsl_export.filename | html %]</option>
41
        [% END %]
41
        [% END %]
42
	</select>
42
	</select>
43
	</li></ol>
43
	</li></ol>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (-1 / +1 lines)
Lines 80-86 Link Here
80
                                </li>
80
                                </li>
81
                                [% ELSE %]
81
                                [% ELSE %]
82
                                    [% FOREACH filesOption IN filesOptions %]
82
                                    [% FOREACH filesOption IN filesOptions %]
83
                                        <li><a role="menuitem" href="/cgi-bin/koha/opac-export.pl?format=[% filesOption.format %]&amp;op=exportxsl&amp;file=[% filesOption.value %]&amp;bib=[% biblionumber %]">[% filesOption.filename %]</a></li>
83
                                        <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 %]">[% filesOption.filename | html %]</a></li>
84
                                    [% END %]
84
                                    [% END %]
85
                                [% END %]
85
                                [% END %]
86
                            [% END %]
86
                            [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt (-1 / +1 lines)
Lines 21-27 Link Here
21
                                    <option value="[% csv_profile.export_format_id | html %]">CSV - [% csv_profile.profile | html %]</option>
21
                                    <option value="[% csv_profile.export_format_id | html %]">CSV - [% csv_profile.profile | html %]</option>
22
                                [% END %]
22
                                [% END %]
23
                                [% FOREACH xsl_export IN xsl_exports %]
23
                                [% FOREACH xsl_export IN xsl_exports %]
24
                                    <option value="xsl.[% xsl_export.value %]">XSL - [% xsl_export.filename %]</option>
24
                                    <option value="xsl.[% xsl_export.value | html %]">XSL - [% xsl_export.filename | html %]</option>
25
                                [% END %]
25
                                [% END %]
26
                            </select>
26
                            </select>
27
                            <fieldset class="action">
27
                            <fieldset class="action">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt (-1 / +1 lines)
Lines 60-66 Link Here
60
                                            <option value="[% csv_profile.export_format_id | html %]">CSV - [% csv_profile.profile | html %]</option>
60
                                            <option value="[% csv_profile.export_format_id | html %]">CSV - [% csv_profile.profile | html %]</option>
61
                                            [% END %]
61
                                            [% END %]
62
                                            [% FOREACH xsl_export IN xsl_exports %]
62
                                            [% FOREACH xsl_export IN xsl_exports %]
63
                                                <option value="xsl.[% xsl_export.value %]">XSL - [% xsl_export.filename %]</option>
63
                                                <option value="xsl.[% xsl_export.value | html %]">XSL - [% xsl_export.filename | html %]</option>
64
                                            [% END %]
64
                                            [% END %]
65
                                        </select>
65
                                        </select>
66
                                        <span class="required">Required</span>
66
                                        <span class="required">Required</span>
(-)a/t/db_dependent/XSLT.t (-18 / +2 lines)
Lines 1-13 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
use Test::More tests => 2;
2
use Test::More tests => 1;
3
3
4
use t::lib::Mocks;
4
use t::lib::Mocks;
5
use C4::XSLT;
5
use C4::XSLT;
6
use Koha::Caches;
7
use Koha::Database;
6
use Koha::Database;
8
7
9
our $schema = Koha::Database->new->schema;
8
our $schema = Koha::Database->new->schema;
10
our $cache = Koha::Caches->get_instance;
11
9
12
# Here we go
10
# Here we go
13
$schema->storage->txn_begin;
11
$schema->storage->txn_begin;
Lines 22-38 subtest 'CustomXSLTExportList: Check export options' => sub { Link Here
22
    $list = C4::XSLT::CustomXSLTExportList(1);
20
    $list = C4::XSLT::CustomXSLTExportList(1);
23
    is( @$list, 0, 'We expect an empty list now' );
21
    is( @$list, 0, 'We expect an empty list now' );
24
};
22
};
25
23
$schema->storage->txn_rollback;
26
subtest  'CustomXSLTExportList: Caching' => sub {
27
    plan tests => 1;
28
    t::lib::Mocks::mock_preference('OpacExportOptions', 'custom');
29
    $cache->clear_from_cache('CustomXSLTExportListOPAC');
30
    my $list = C4::XSLT::CustomXSLTExportList(1);
31
    push @$list, { nonsense => 1 };
32
    $cache->set_in_cache( 'CustomXSLTExportListOPAC', $list );
33
    my $n = @$list;
34
    $list = C4::XSLT::CustomXSLTExportList(1);
35
    is( @$list, $n, 'This list comes from the cache and that is fine' );
36
    $cache->clear_from_cache('CustomXSLTExportListOPAC');
37
};
38
$schema->storage->txn_rollback;
39
- 

Return to bug 17385