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 951-957 Link Here
951
    [% Asset.js("js/job_progress.js") | $raw %]
951
    [% Asset.js("js/job_progress.js") | $raw %]
952
    <script>
952
    <script>
953
        [% IF export_job_id %]
953
        [% IF export_job_id %]
954
            updateProgress([% export_job_id | html %], function() {
954
            var job_finish_callback = function() {
955
                $.getJSON('/api/v1/jobs/[% export_job_id | html %]', function(job) {
955
                $.getJSON('/api/v1/jobs/[% export_job_id | html %]', function(job) {
956
                    if (job.data.report.errors.length) {
956
                    if (job.data.report.errors.length) {
957
                        humanMsg.displayMsg(
957
                        humanMsg.displayMsg(
Lines 972-978 Link Here
972
                            .appendTo("#job_callback");
972
                            .appendTo("#job_callback");
973
                    }
973
                    }
974
                });
974
                });
975
            });
975
            };
976
            updateProgress([% export_job_id | html %], { finish_callback: job_finish_callback });
976
        [% END %]
977
        [% END %]
977
978
978
        var PREF_AmazonCoverImages = parseInt( "[% Koha.Preference('AmazonCoverImages') | html %]", 10);
979
        var PREF_AmazonCoverImages = parseInt( "[% Koha.Preference('AmazonCoverImages') | html %]", 10);
979
- 

Return to bug 27859