Lines 32-37
use C4::Serials;
Link Here
|
32 |
use C4::Serials::Frequency; |
32 |
use C4::Serials::Frequency; |
33 |
use C4::Serials::Numberpattern; |
33 |
use C4::Serials::Numberpattern; |
34 |
use C4::Letters; |
34 |
use C4::Letters; |
|
|
35 |
use Koha::AdditionalField; |
35 |
use Carp; |
36 |
use Carp; |
36 |
|
37 |
|
37 |
#use Smart::Comments; |
38 |
#use Smart::Comments; |
Lines 150-155
my $locations_loop = GetAuthorisedValues("LOC",$subs->{'location'});
Link Here
|
150 |
$template->param(branchloop => $branchloop, |
151 |
$template->param(branchloop => $branchloop, |
151 |
locations_loop=>$locations_loop, |
152 |
locations_loop=>$locations_loop, |
152 |
); |
153 |
); |
|
|
154 |
|
155 |
|
156 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
157 |
for my $field ( @$additional_fields ) { |
158 |
if ( $field->{authorised_value_category} ) { |
159 |
$field->{authorised_value_choices} = GetAuthorisedValues( $field->{authorised_value_category} ); |
160 |
} |
161 |
} |
162 |
$template->param( additional_fields_for_subscription => $additional_fields ); |
163 |
|
153 |
# prepare template variables common to all $op conditions: |
164 |
# prepare template variables common to all $op conditions: |
154 |
if ($op!~/^mod/) { |
165 |
if ($op!~/^mod/) { |
155 |
letter_loop(q{}, $template); |
166 |
letter_loop(q{}, $template); |
Lines 335-340
sub redirect_add_subscription {
Link Here
|
335 |
$skip_serialseq |
346 |
$skip_serialseq |
336 |
); |
347 |
); |
337 |
|
348 |
|
|
|
349 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
350 |
my @additional_field_values; |
351 |
for my $field ( @$additional_fields ) { |
352 |
my $af = Koha::AdditionalField->new({ id => $field->{id} }); |
353 |
$af->{values} = { |
354 |
$subscriptionid => $query->param('additional_fields_' . $field->{name}) |
355 |
}; |
356 |
$af->insert_values; |
357 |
} |
358 |
|
338 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
359 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
339 |
return; |
360 |
return; |
340 |
} |
361 |
} |
Lines 410-415
sub redirect_mod_subscription {
Link Here
|
410 |
$skip_serialseq |
431 |
$skip_serialseq |
411 |
); |
432 |
); |
412 |
|
433 |
|
|
|
434 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
435 |
my @additional_field_values; |
436 |
for my $field ( @$additional_fields ) { |
437 |
my $af = Koha::AdditionalField->new({ id => $field->{id} })->fetch; |
438 |
if ( $af->{marcfield} ) { |
439 |
my $record = GetMarcBiblio( $biblionumber, 1 ); |
440 |
my ( $field, $subfield ) = split /\$/, $af->{marcfield}; |
441 |
next unless $field and $subfield; |
442 |
my $value = $record->subfield( $field, $subfield ); |
443 |
$af->{values} = { |
444 |
$subscriptionid => $value |
445 |
}; |
446 |
} else { |
447 |
$af->{values} = { |
448 |
$subscriptionid => $query->param('additional_fields_' . $field->{name}) |
449 |
}; |
450 |
} |
451 |
$af->insert_values; |
452 |
} |
453 |
|
413 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
454 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
414 |
return; |
455 |
return; |
415 |
} |
456 |
} |