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