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

(-)a/Koha/BackgroundJob/SearchResultExport.pm (-2 / +3 lines)
Lines 113-118 sub process { Link Here
113
        my $upload_dir = Koha::UploadedFile->permanent_directory;
113
        my $upload_dir = Koha::UploadedFile->permanent_directory;
114
114
115
        while (my ($format, $data) = each %{$encoded_results}) {
115
        while (my ($format, $data) = each %{$encoded_results}) {
116
            $data = encode('UTF-8', $data);
116
            my $hash = md5_hex($data);
117
            my $hash = md5_hex($data);
117
            my $category = "search_marc_export";
118
            my $category = "search_marc_export";
118
            my $time = strftime "%Y%m%d_%H%M", localtime time;
119
            my $time = strftime "%Y%m%d_%H%M", localtime time;
Lines 131-137 sub process { Link Here
131
132
132
            if ($fh) {
133
            if ($fh) {
133
                $fh->binmode;
134
                $fh->binmode;
134
                print $fh encode('UTF-8', $data);
135
                print $fh $data;
135
                $fh->close;
136
                $fh->close;
136
137
137
                my $size = -s $filepath;
138
                my $size = -s $filepath;
Lines 159-165 sub process { Link Here
159
        errors => \@errors,
160
        errors => \@errors,
160
        query_string => $query_string,
161
        query_string => $query_string,
161
    };
162
    };
162
    $data->{report}   = $report;
163
    $data->{report} = $report;
163
    if (@errors) {
164
    if (@errors) {
164
        $self->set({ progress => 0, status => 'failed' })->store;
165
        $self->set({ progress => 0, status => 'failed' })->store;
165
    }
166
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-3 / +3 lines)
Lines 994-1000 Link Here
994
    [% Asset.js("js/job_progress.js") | $raw %]
994
    [% Asset.js("js/job_progress.js") | $raw %]
995
    <script>
995
    <script>
996
        [% IF export_job_id %]
996
        [% IF export_job_id %]
997
            updateProgress([% export_job_id | html %], function() {
997
            var job_finish_callback = function() {
998
                $.getJSON('/api/v1/jobs/[% export_job_id | html %]', function(job) {
998
                $.getJSON('/api/v1/jobs/[% export_job_id | html %]', function(job) {
999
                    if (job.data.report.errors.length) {
999
                    if (job.data.report.errors.length) {
1000
                        humanMsg.displayMsg(
1000
                        humanMsg.displayMsg(
Lines 1015-1021 Link Here
1015
                            .appendTo("#job_callback");
1015
                            .appendTo("#job_callback");
1016
                    }
1016
                    }
1017
                });
1017
                });
1018
            });
1018
            };
1019
            updateProgress([% export_job_id | html %], { finish_callback: job_finish_callback });
1019
        [% END %]
1020
        [% END %]
1020
1021
1021
        var PREF_AmazonCoverImages = parseInt( "[% Koha.Preference('AmazonCoverImages') | html %]", 10);
1022
        var PREF_AmazonCoverImages = parseInt( "[% Koha.Preference('AmazonCoverImages') | html %]", 10);
1022
- 

Return to bug 27859