Lines 61-71
my $cgiparams = $input->Vars;
Link Here
|
61 |
my $op = $cgiparams->{'op'} || ''; |
61 |
my $op = $cgiparams->{'op'} || ''; |
62 |
my $booksellerid = $input->param('booksellerid'); |
62 |
my $booksellerid = $input->param('booksellerid'); |
63 |
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid }); |
63 |
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid }); |
|
|
64 |
my $is_order = $input->param('is_order'); |
64 |
my $data; |
65 |
my $data; |
65 |
|
66 |
|
66 |
$template->param(scriptname => "/cgi-bin/koha/acqui/addorderiso2709.pl", |
67 |
$template->param(scriptname => "/cgi-bin/koha/acqui/addorderiso2709.pl", |
67 |
booksellerid => $booksellerid, |
68 |
booksellerid => $booksellerid, |
68 |
booksellername => $bookseller->{name}, |
69 |
booksellername => $bookseller->{name}, |
|
|
70 |
is_order => $is_order, |
69 |
); |
71 |
); |
70 |
|
72 |
|
71 |
if ($cgiparams->{'import_batch_id'} && $op eq ""){ |
73 |
if ($cgiparams->{'import_batch_id'} && $op eq ""){ |
Lines 83-89
if (! $cgiparams->{'basketno'}){
Link Here
|
83 |
if ($op eq ""){ |
85 |
if ($op eq ""){ |
84 |
$template->param("basketno" => $cgiparams->{'basketno'}); |
86 |
$template->param("basketno" => $cgiparams->{'basketno'}); |
85 |
#display batches |
87 |
#display batches |
86 |
import_batches_list($template); |
88 |
import_batches_list( $template, $is_order ); |
87 |
# |
89 |
# |
88 |
# 2nd step = display the content of the choosen file |
90 |
# 2nd step = display the content of the choosen file |
89 |
# |
91 |
# |
Lines 269-274
if ($op eq ""){
Link Here
|
269 |
my @serials = $input->param('serial'); |
271 |
my @serials = $input->param('serial'); |
270 |
my @ind_tag = $input->param('ind_tag'); |
272 |
my @ind_tag = $input->param('ind_tag'); |
271 |
my @indicator = $input->param('indicator'); |
273 |
my @indicator = $input->param('indicator'); |
|
|
274 |
|
275 |
if ($is_order) { |
276 |
my ( $notforloan_field, $notforloan_subfield ) = |
277 |
GetMarcFromKohaField('items.notforloan'); |
278 |
push( @tags, $notforloan_field ); |
279 |
push( @subfields, $notforloan_subfield ); |
280 |
push( @field_values, '-1' ); |
281 |
|
282 |
my ( $homebranch_field, $homebranch_subfield ) = |
283 |
GetMarcFromKohaField('items.homebranch'); |
284 |
push( @tags, $homebranch_field ); |
285 |
push( @subfields, $homebranch_subfield ); |
286 |
push( @field_values, C4::Context->userenv->{'branch'} ); |
287 |
|
288 |
my ( $holdingbranch_field, $holdingbranch_subfield ) = |
289 |
GetMarcFromKohaField('items.holdingbranch'); |
290 |
push( @tags, $holdingbranch_field ); |
291 |
push( @subfields, $holdingbranch_subfield ); |
292 |
push( @field_values, C4::Context->userenv->{'branch'} ); |
293 |
|
294 |
my $infos = get_infos_syspref($marcrecord, ['itype']); |
295 |
my ( $itype_field, $itype_subfield ) = |
296 |
GetMarcFromKohaField('items.itype'); |
297 |
push( @tags, $itype_field ); |
298 |
push( @subfields, $itype_subfield ); |
299 |
push( @field_values, $infos->{itype} ); |
300 |
} |
301 |
|
272 |
my $item; |
302 |
my $item; |
273 |
push @{ $item->{tags} }, $tags[0]; |
303 |
push @{ $item->{tags} }, $tags[0]; |
274 |
push @{ $item->{subfields} }, $subfields[0]; |
304 |
push @{ $item->{subfields} }, $subfields[0]; |
Lines 324-331
output_html_with_http_headers $input, $cookie, $template->output;
Link Here
|
324 |
|
354 |
|
325 |
|
355 |
|
326 |
sub import_batches_list { |
356 |
sub import_batches_list { |
327 |
my ($template) = @_; |
357 |
my ($template, $is_order) = @_; |
328 |
my $batches = GetImportBatchRangeDesc(); |
358 |
my $batches = GetImportBatchRangeDesc(undef,undef,$is_order); |
329 |
|
359 |
|
330 |
my @list = (); |
360 |
my @list = (); |
331 |
foreach my $batch (@$batches) { |
361 |
foreach my $batch (@$batches) { |
Lines 420-425
sub import_biblios_list {
Link Here
|
420 |
item_action => $item_action |
450 |
item_action => $item_action |
421 |
); |
451 |
); |
422 |
batch_info($template, $batch); |
452 |
batch_info($template, $batch); |
|
|
453 |
|
454 |
return \@list; |
423 |
} |
455 |
} |
424 |
|
456 |
|
425 |
sub batch_info { |
457 |
sub batch_info { |
Lines 463-470
sub add_matcher_list {
Link Here
|
463 |
$template->param(available_matchers => \@matchers); |
495 |
$template->param(available_matchers => \@matchers); |
464 |
} |
496 |
} |
465 |
|
497 |
|
466 |
sub get_infos_syspref { |
498 |
sub GetMarcFieldsToOrderAsYAML { |
467 |
my ($record, $field_list) = @_; |
|
|
468 |
my $syspref = C4::Context->preference('MarcFieldsToOrder'); |
499 |
my $syspref = C4::Context->preference('MarcFieldsToOrder'); |
469 |
$syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt |
500 |
$syspref = "$syspref\n\n"; # YAML is anal on ending \n. Surplus does not hurt |
470 |
my $yaml = eval { |
501 |
my $yaml = eval { |
Lines 472-479
sub get_infos_syspref {
Link Here
|
472 |
}; |
503 |
}; |
473 |
if ( $@ ) { |
504 |
if ( $@ ) { |
474 |
warn "Unable to parse MarcFieldsToOrder syspref : $@"; |
505 |
warn "Unable to parse MarcFieldsToOrder syspref : $@"; |
475 |
return (); |
506 |
return; |
|
|
507 |
} else { |
508 |
return $yaml; |
476 |
} |
509 |
} |
|
|
510 |
} |
511 |
|
512 |
sub get_infos_syspref { |
513 |
my ($record, $field_list) = @_; |
514 |
|
515 |
my $yaml = GetMarcFieldsToOrderAsYAML; |
516 |
return unless $yaml; |
517 |
|
477 |
my $r; |
518 |
my $r; |
478 |
for my $field_name ( @$field_list ) { |
519 |
for my $field_name ( @$field_list ) { |
479 |
next unless exists $yaml->{$field_name}; |
520 |
next unless exists $yaml->{$field_name}; |