Lines 32-37
use C4::Auth;
Link Here
|
32 |
use C4::AuthoritiesMarc; |
32 |
use C4::AuthoritiesMarc; |
33 |
use C4::Output; |
33 |
use C4::Output; |
34 |
use C4::Biblio; |
34 |
use C4::Biblio; |
|
|
35 |
use C4::Members; |
35 |
use C4::ImportBatch; |
36 |
use C4::ImportBatch; |
36 |
use C4::Matcher; |
37 |
use C4::Matcher; |
37 |
use C4::BackgroundJob; |
38 |
use C4::BackgroundJob; |
Lines 42-47
my $script_name = "/cgi-bin/koha/tools/manage-marc-import.pl";
Link Here
|
42 |
|
43 |
|
43 |
my $input = new CGI; |
44 |
my $input = new CGI; |
44 |
my $op = $input->param('op') || ''; |
45 |
my $op = $input->param('op') || ''; |
|
|
46 |
my $no_filter = $input->param('no_filter') || 0; |
45 |
my $completedJobID = $input->param('completedJobID'); |
47 |
my $completedJobID = $input->param('completedJobID'); |
46 |
our $runinbackground = $input->param('runinbackground'); |
48 |
our $runinbackground = $input->param('runinbackground'); |
47 |
my $import_batch_id = $input->param('import_batch_id') || ''; |
49 |
my $import_batch_id = $input->param('import_batch_id') || ''; |
Lines 91-97
if ($op) {
Link Here
|
91 |
if ($op eq "") { |
93 |
if ($op eq "") { |
92 |
# displaying a list |
94 |
# displaying a list |
93 |
if ($import_batch_id eq '') { |
95 |
if ($import_batch_id eq '') { |
94 |
import_batches_list($template, $offset, $results_per_page); |
96 |
import_batches_list($template, $offset, $results_per_page, $no_filter); |
95 |
} else { |
97 |
} else { |
96 |
import_records_list($template, $import_batch_id, $offset, $results_per_page); |
98 |
import_records_list($template, $import_batch_id, $offset, $results_per_page); |
97 |
} |
99 |
} |
Lines 112-125
if ($op eq "") {
Link Here
|
112 |
import_records_list($template, $import_batch_id, $offset, $results_per_page); |
114 |
import_records_list($template, $import_batch_id, $offset, $results_per_page); |
113 |
} elsif ($op eq "clean-batch") { |
115 |
} elsif ($op eq "clean-batch") { |
114 |
CleanBatch($import_batch_id); |
116 |
CleanBatch($import_batch_id); |
115 |
import_batches_list($template, $offset, $results_per_page); |
117 |
import_batches_list($template, $offset, $results_per_page, $no_filter); |
116 |
$template->param( |
118 |
$template->param( |
117 |
did_clean => 1, |
119 |
did_clean => 1, |
118 |
import_batch_id => $import_batch_id, |
120 |
import_batch_id => $import_batch_id, |
119 |
); |
121 |
); |
120 |
} elsif ($op eq "delete-batch") { |
122 |
} elsif ($op eq "delete-batch") { |
121 |
DeleteBatch($import_batch_id); |
123 |
DeleteBatch($import_batch_id); |
122 |
import_batches_list($template, $offset, $results_per_page); |
124 |
import_batches_list($template, $offset, $results_per_page, $no_filter); |
123 |
$template->param( |
125 |
$template->param( |
124 |
did_delete => 1, |
126 |
did_delete => 1, |
125 |
); |
127 |
); |
Lines 203-213
sub create_labelbatch_from_importbatch {
Link Here
|
203 |
} |
205 |
} |
204 |
|
206 |
|
205 |
sub import_batches_list { |
207 |
sub import_batches_list { |
206 |
my ($template, $offset, $results_per_page) = @_; |
208 |
my ($template, $offset, $results_per_page, $no_filter) = @_; |
207 |
my $batches = GetImportBatchRangeDesc($offset, $results_per_page); |
209 |
my $batches = GetImportBatchRangeDesc($offset, $results_per_page, $no_filter); |
208 |
|
210 |
|
209 |
my @list = (); |
211 |
my @list = (); |
210 |
foreach my $batch (@$batches) { |
212 |
foreach my $batch (@$batches) { |
|
|
213 |
my $borrower = GetMember(borrowernumber => $batch->{'borrowernumber'}); |
214 |
my $user_name = ""; |
215 |
if($borrower) { |
216 |
$user_name = $borrower->{'userid'}; |
217 |
} |
218 |
|
211 |
push @list, { |
219 |
push @list, { |
212 |
import_batch_id => $batch->{'import_batch_id'}, |
220 |
import_batch_id => $batch->{'import_batch_id'}, |
213 |
num_records => $batch->{'num_records'}, |
221 |
num_records => $batch->{'num_records'}, |
Lines 218-223
sub import_batches_list {
Link Here
|
218 |
comments => $batch->{'comments'}, |
226 |
comments => $batch->{'comments'}, |
219 |
can_clean => ($batch->{'import_status'} ne 'cleaned') ? 1 : 0, |
227 |
can_clean => ($batch->{'import_status'} ne 'cleaned') ? 1 : 0, |
220 |
record_type => $batch->{'record_type'}, |
228 |
record_type => $batch->{'record_type'}, |
|
|
229 |
user_name => $user_name, |
221 |
}; |
230 |
}; |
222 |
} |
231 |
} |
223 |
$template->param(batch_list => \@list); |
232 |
$template->param(batch_list => \@list); |
Lines 227-232
sub import_batches_list {
Link Here
|
227 |
$template->param(range_top => $offset + $results_per_page - 1); |
236 |
$template->param(range_top => $offset + $results_per_page - 1); |
228 |
$template->param(num_results => $num_batches); |
237 |
$template->param(num_results => $num_batches); |
229 |
$template->param(results_per_page => $results_per_page); |
238 |
$template->param(results_per_page => $results_per_page); |
|
|
239 |
$template->param(no_filter => $no_filter); |
230 |
|
240 |
|
231 |
} |
241 |
} |
232 |
|
242 |
|
Lines 354-359
sub import_records_list {
Link Here
|
354 |
my $batch = GetImportBatch($import_batch_id); |
364 |
my $batch = GetImportBatch($import_batch_id); |
355 |
$template->param(import_batch_id => $import_batch_id); |
365 |
$template->param(import_batch_id => $import_batch_id); |
356 |
|
366 |
|
|
|
367 |
my $borrower = GetMember(borrowernumber => $batch->{'borrowernumber'}); |
368 |
my $user_name = ""; |
369 |
if($borrower) { |
370 |
$user_name = $borrower->{'userid'}; |
371 |
} |
372 |
$template->param("user_name" => $user_name); |
373 |
|
357 |
my $overlay_action = GetImportBatchOverlayAction($import_batch_id); |
374 |
my $overlay_action = GetImportBatchOverlayAction($import_batch_id); |
358 |
$template->param("overlay_action_${overlay_action}" => 1); |
375 |
$template->param("overlay_action_${overlay_action}" => 1); |
359 |
$template->param(overlay_action => $overlay_action); |
376 |
$template->param(overlay_action => $overlay_action); |
360 |
- |
|
|