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 152-157
my $locations_loop = GetAuthorisedValues("LOC",$subs->{'location'});
Link Here
|
152 |
$template->param(branchloop => $branchloop, |
153 |
$template->param(branchloop => $branchloop, |
153 |
locations_loop=>$locations_loop, |
154 |
locations_loop=>$locations_loop, |
154 |
); |
155 |
); |
|
|
156 |
|
157 |
|
158 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
159 |
for my $field ( @$additional_fields ) { |
160 |
if ( $field->{authorised_value_category} ) { |
161 |
$field->{authorised_value_choices} = GetAuthorisedValues( $field->{authorised_value_category} ); |
162 |
} |
163 |
} |
164 |
$template->param( additional_fields_for_subscription => $additional_fields ); |
165 |
|
155 |
# prepare template variables common to all $op conditions: |
166 |
# prepare template variables common to all $op conditions: |
156 |
if ($op!~/^mod/) { |
167 |
if ($op!~/^mod/) { |
157 |
letter_loop(q{}, $template); |
168 |
letter_loop(q{}, $template); |
Lines 338-343
sub redirect_add_subscription {
Link Here
|
338 |
$skip_serialseq |
349 |
$skip_serialseq |
339 |
); |
350 |
); |
340 |
|
351 |
|
|
|
352 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
353 |
my @additional_field_values; |
354 |
for my $field ( @$additional_fields ) { |
355 |
my $af = Koha::AdditionalField->new({ id => $field->{id} }); |
356 |
$af->{values} = { |
357 |
$subscriptionid => $query->param('additional_fields_' . $field->{name}) |
358 |
}; |
359 |
$af->insert_values; |
360 |
} |
361 |
|
341 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
362 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
342 |
return; |
363 |
return; |
343 |
} |
364 |
} |
Lines 413-418
sub redirect_mod_subscription {
Link Here
|
413 |
$skip_serialseq |
434 |
$skip_serialseq |
414 |
); |
435 |
); |
415 |
|
436 |
|
|
|
437 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
438 |
my @additional_field_values; |
439 |
for my $field ( @$additional_fields ) { |
440 |
my $af = Koha::AdditionalField->new({ id => $field->{id} })->fetch; |
441 |
if ( $af->{marcfield} ) { |
442 |
my $record = GetMarcBiblio( $biblionumber, 1 ); |
443 |
my ( $field, $subfield ) = split /\$/, $af->{marcfield}; |
444 |
next unless $field and $subfield; |
445 |
my $value = $record->subfield( $field, $subfield ); |
446 |
$af->{values} = { |
447 |
$subscriptionid => $value |
448 |
}; |
449 |
} else { |
450 |
$af->{values} = { |
451 |
$subscriptionid => $query->param('additional_fields_' . $field->{name}) |
452 |
}; |
453 |
} |
454 |
$af->insert_values; |
455 |
} |
456 |
|
416 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
457 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
417 |
return; |
458 |
return; |
418 |
} |
459 |
} |