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 145-150
my $locations_loop = GetAuthorisedValues("LOC",$subs->{'location'});
Link Here
|
145 |
$template->param(branchloop => $branchloop, |
146 |
$template->param(branchloop => $branchloop, |
146 |
locations_loop=>$locations_loop, |
147 |
locations_loop=>$locations_loop, |
147 |
); |
148 |
); |
|
|
149 |
|
150 |
|
151 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
152 |
for my $field ( @$additional_fields ) { |
153 |
if ( $field->{authorised_value_category} ) { |
154 |
$field->{authorised_value_choices} = GetAuthorisedValues( $field->{authorised_value_category} ); |
155 |
} |
156 |
} |
157 |
$template->param( additional_fields_for_subscription => $additional_fields ); |
158 |
|
148 |
# prepare template variables common to all $op conditions: |
159 |
# prepare template variables common to all $op conditions: |
149 |
if ($op!~/^mod/) { |
160 |
if ($op!~/^mod/) { |
150 |
letter_loop(q{}, $template); |
161 |
letter_loop(q{}, $template); |
Lines 331-336
sub redirect_add_subscription {
Link Here
|
331 |
$skip_serialseq |
342 |
$skip_serialseq |
332 |
); |
343 |
); |
333 |
|
344 |
|
|
|
345 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
346 |
my @additional_field_values; |
347 |
for my $field ( @$additional_fields ) { |
348 |
my $af = Koha::AdditionalField->new({ id => $field->{id} }); |
349 |
$af->{values} = { |
350 |
$subscriptionid => $query->param('additional_fields_' . $field->{name}) |
351 |
}; |
352 |
$af->insert_values; |
353 |
} |
354 |
|
334 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
355 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
335 |
return; |
356 |
return; |
336 |
} |
357 |
} |
Lines 406-411
sub redirect_mod_subscription {
Link Here
|
406 |
$skip_serialseq |
427 |
$skip_serialseq |
407 |
); |
428 |
); |
408 |
|
429 |
|
|
|
430 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
431 |
my @additional_field_values; |
432 |
for my $field ( @$additional_fields ) { |
433 |
my $af = Koha::AdditionalField->new({ id => $field->{id} })->fetch; |
434 |
if ( $af->{marcfield} ) { |
435 |
my $record = GetMarcBiblio( $biblionumber, 1 ); |
436 |
my ( $field, $subfield ) = split /\$/, $af->{marcfield}; |
437 |
next unless $field and $subfield; |
438 |
my $value = $record->subfield( $field, $subfield ); |
439 |
$af->{values} = { |
440 |
$subscriptionid => $value |
441 |
}; |
442 |
} else { |
443 |
$af->{values} = { |
444 |
$subscriptionid => $query->param('additional_fields_' . $field->{name}) |
445 |
}; |
446 |
} |
447 |
$af->insert_values; |
448 |
} |
449 |
|
409 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
450 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
410 |
return; |
451 |
return; |
411 |
} |
452 |
} |