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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-1 / +1 lines)
Lines 98-104 CAN_user_serials_create_subscription ) %] Link Here
98
        <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=mods&amp;op=export&amp;bib=[% biblionumber | uri %]">MODS (XML)</a></li>
99
        <li><a href="/cgi-bin/koha/catalogue/export.pl?format=ris&amp;op=export&amp;bib=[% biblionumber | uri %]">RIS</a></li>
99
        <li><a href="/cgi-bin/koha/catalogue/export.pl?format=ris&amp;op=export&amp;bib=[% biblionumber | uri %]">RIS</a></li>
100
        [% FOREACH filesOption IN filesOptions %]
100
        [% FOREACH filesOption IN filesOptions %]
101
            <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
            <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 %]">XSL - [% filesOption.filename | html %]</a></li>
102
        [% END %]
102
        [% END %]
103
    </ul>
103
    </ul>
104
    </div>
104
    </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +1 lines)
Lines 313-319 OPAC: Link Here
313
                mods: MODS
313
                mods: MODS
314
                ris: RIS
314
                ris: RIS
315
                isbd: ISBD
315
                isbd: ISBD
316
                custom: Custom
316
                custom: XSL - Simple Export
317
        -
317
        -
318
            - pref: OpacSeparateHoldings
318
            - pref: OpacSeparateHoldings
319
              choices:
319
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +1 lines)
Lines 949-955 Note that permanent location is a code, and location may be an authval. Link Here
949
        <option value="marc8">MARC (non-Unicode/MARC-8)</option>
949
        <option value="marc8">MARC (non-Unicode/MARC-8)</option>
950
        <option value="utf8">MARC (Unicode/UTF-8)</option>
950
        <option value="utf8">MARC (Unicode/UTF-8)</option>
951
        [% FOREACH filesOption IN filesOptions %]
951
        [% FOREACH filesOption IN filesOptions %]
952
            <option value="[% filesOption.value | html %]">[% filesOption.filename | html %]</option>
952
            <option value="[% filesOption.value | html %]">XSL -[% filesOption.filename | html %]</option>
953
        [% END %]</select>
953
        [% END %]</select>
954
        <input type="submit" name="save" value="Download Record" /></td>
954
        <input type="submit" name="save" value="Download Record" /></td>
955
  </tr>
955
  </tr>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (-1 / +1 lines)
Lines 109-115 Link Here
109
                                </li>
109
                                </li>
110
                                [% ELSE %]
110
                                [% ELSE %]
111
                                    [% FOREACH filesOption IN filesOptions %]
111
                                    [% FOREACH filesOption IN filesOptions %]
112
                                        <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>
112
                                        <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>
113
                                    [% END %]
113
                                    [% END %]
114
                                [% END %]
114
                                [% END %]
115
                            [% END %]
115
                            [% END %]
(-)a/opac/opac-downloadshelf.pl (-2 / +6 lines)
Lines 28-33 use C4::Items; Link Here
28
use C4::Output;
28
use C4::Output;
29
use C4::Record;
29
use C4::Record;
30
use C4::Ris;
30
use C4::Ris;
31
use C4::XSLT;
31
use Koha::CsvProfiles;
32
use Koha::CsvProfiles;
32
use Koha::RecordProcessor;
33
use Koha::RecordProcessor;
33
use Koha::Virtualshelves;
34
use Koha::Virtualshelves;
Lines 125-137 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
125
                    });
126
                    });
126
                    $extension = "txt";
127
                    $extension = "txt";
127
                    $type      = "text/plain";
128
                    $type      = "text/plain";
128
                }
129
                }elsif ($format =~ /^xsl\.(.*)$/){
130
                         $output .= XSLTParse4Display($biblionumber, $record, 'XSLTCustomExport', 1, undef, undef, $1, '', 1);
131
                    }
129
            }
132
            }
130
        }
133
        }
131
134
132
        # If it was a CSV export we change the format after the export so the file extension is fine
135
        # If it was a CSV export we change the format after the export so the file extension is fine
133
        $format = "csv" if ($format =~ m/^\d+$/);
136
        $format = "csv" if ($format =~ m/^\d+$/);
134
137
        $format = "html" if ($format =~ /^xsl\./);
135
        print $query->header(
138
        print $query->header(
136
                                   -type => ($type) ? $type : 'application/octet-stream',
139
                                   -type => ($type) ? $type : 'application/octet-stream',
137
            -'Content-Transfer-Encoding' => 'binary',
140
            -'Content-Transfer-Encoding' => 'binary',
Lines 158-163 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
158
                )
161
                )
159
            ]
162
            ]
160
        );
163
        );
164
        $template->param(xsl_exports => CustomXSLTExportList());
161
        $template->param( shelf => $shelf );
165
        $template->param( shelf => $shelf );
162
        output_html_with_http_headers $query, $cookie, $template->output;
166
        output_html_with_http_headers $query, $cookie, $template->output;
163
    }
167
    }
(-)a/t/db_dependent/XSLT.t (-1 / +22 lines)
Lines 102-105 subtest 'buildKohaItemsNamespace status tests' => sub { Link Here
102
    $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
102
    $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
103
    like($xml,qr{<status>Pending hold</status>},"Pending status takes precedence over all");
103
    like($xml,qr{<status>Pending hold</status>},"Pending status takes precedence over all");
104
};
104
};
105
subtest  'CustomXSLTExportList: Caching' => sub {
106
    plan tests => 1;
107
    t::lib::Mocks::mock_preference('OpacExportOptions', 'custom');
108
    $cache->clear_from_cache('CustomXSLTExportListOPAC');
109
    my $list = C4::XSLT::CustomXSLTExportList(1);
110
    push @$list, { nonsense => 1 };
111
    $cache->set_in_cache('CustomXSLTExportListOPAC', $list );
112
    my $n = @$list;
113
    $list = C4::XSLT::CustomXSLTExportList(1);
114
    is( @$list, $n, 'This list comes from the cache and that is fine' );
115
    $cache->clear_from_cache('CustomXSLTExportListOPAC');
116
};
117
subtest 'CustomXSLTExportList: Check export options' => sub {
118
    plan tests => 2;
119
    t::lib::Mocks::mock_preference('OpacExportOptions', 'custom');
120
    my $list = C4::XSLT::CustomXSLTExportList(1);
121
    is( $list>0, 1, 'We expect at least one result: simple export' );
122
    $cache->clear_from_cache('CustomXSLTExportListOPAC');
123
    t::lib::Mocks::mock_preference('OpacExportOptions', 'dc');
124
    $list = C4::XSLT::CustomXSLTExportList(1);
125
    is( @$list, 0, 'We expect an empty list now' );
126
};
105
$schema->storage->txn_rollback;
127
$schema->storage->txn_rollback;
106
- 

Return to bug 17385