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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt (+9 lines)
Lines 47-52 $(document).ready(function() { Link Here
47
	<div id="yui-main">
47
	<div id="yui-main">
48
	<div class="yui-b">
48
	<div class="yui-b">
49
49
50
[% FOR m IN messages %]
51
    <div class="dialog [% m.type %]">
52
        [% SWITCH m.code %]
53
        [% CASE 'invalid_mimetype' %]The file used does not have a valid format. Only csv and txt are allowed.
54
        [% CASE %][% m.code %]
55
        [% END %]
56
    </div>
57
[% END %]
58
50
<div id="exporttype" class="toptabs">
59
<div id="exporttype" class="toptabs">
51
<ul>
60
<ul>
52
<li><a href="#bibs">Export bibliographic records</a></li>
61
<li><a href="#bibs">Export bibliographic records</a></li>
(-)a/tools/export.pl (-1 / +12 lines)
Lines 69-74 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( Link Here
69
69
70
my @branch = $query->multi_param("branch");
70
my @branch = $query->multi_param("branch");
71
71
72
my @messages;
73
if ( $op eq 'export' ) {
74
    my $filename = $query->param('id_list_file');
75
    my $mimetype = $query->uploadInfo($filename)->{'Content-Type'};
76
    my @valid_mimetypes = qw( application/octet-stream text/csv text/plain );
77
    unless ( grep { /^$mimetype$/ } @valid_mimetypes ) {
78
        push @messages, { type => 'alert', code => 'invalid_mimetype' };
79
        $op = '';
80
    }
81
}
82
72
if ( $op eq "export" ) {
83
if ( $op eq "export" ) {
73
84
74
    my $export_remove_fields = $query->param("export_remove_fields") || q||;
85
    my $export_remove_fields = $query->param("export_remove_fields") || q||;
Lines 302-307 else { Link Here
302
        authority_types          => $authority_types,
313
        authority_types          => $authority_types,
303
        export_remove_fields     => C4::Context->preference("ExportRemoveFields"),
314
        export_remove_fields     => C4::Context->preference("ExportRemoveFields"),
304
        csv_profiles             => [ Koha::CsvProfiles->search({ type => 'marc' }) ],
315
        csv_profiles             => [ Koha::CsvProfiles->search({ type => 'marc' }) ],
316
        messages                 => \@messages,
305
    );
317
    );
306
318
307
    output_html_with_http_headers $query, $cookie, $template->output;
319
    output_html_with_http_headers $query, $cookie, $template->output;
308
- 

Return to bug 18087