Lines 30-35
use C4::Context;
Link Here
|
30 |
use C4::Branch; # GetBranches |
30 |
use C4::Branch; # GetBranches |
31 |
use C4::Serials; |
31 |
use C4::Serials; |
32 |
use C4::Letters; |
32 |
use C4::Letters; |
|
|
33 |
use Koha::AdditionalField; |
33 |
use Carp; |
34 |
use Carp; |
34 |
|
35 |
|
35 |
#use Smart::Comments; |
36 |
#use Smart::Comments; |
Lines 141-146
my $locations_loop = GetAuthorisedValues("LOC",$subs->{'location'});
Link Here
|
141 |
$template->param(branchloop => $branchloop, |
142 |
$template->param(branchloop => $branchloop, |
142 |
locations_loop=>$locations_loop, |
143 |
locations_loop=>$locations_loop, |
143 |
); |
144 |
); |
|
|
145 |
|
146 |
|
147 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
148 |
for my $field ( @$additional_fields ) { |
149 |
if ( $field->{authorised_value_category} ) { |
150 |
$field->{authorised_value_choices} = GetAuthorisedValues( $field->{authorised_value_category} ); |
151 |
} |
152 |
} |
153 |
$template->param( additional_fields_for_subscription => $additional_fields ); |
154 |
|
144 |
# prepare template variables common to all $op conditions: |
155 |
# prepare template variables common to all $op conditions: |
145 |
if ($op!~/^mod/) { |
156 |
if ($op!~/^mod/) { |
146 |
letter_loop(q{}, $template); |
157 |
letter_loop(q{}, $template); |
Lines 256-261
sub redirect_add_subscription {
Link Here
|
256 |
my $missinglist = $query->param('missinglist'); |
267 |
my $missinglist = $query->param('missinglist'); |
257 |
my $opacnote = $query->param('opacnote'); |
268 |
my $opacnote = $query->param('opacnote'); |
258 |
my $librariannote = $query->param('librariannote'); |
269 |
my $librariannote = $query->param('librariannote'); |
|
|
270 |
|
259 |
my $subscriptionid = NewSubscription($auser,$branchcode,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber, |
271 |
my $subscriptionid = NewSubscription($auser,$branchcode,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber, |
260 |
$startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength, |
272 |
$startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength, |
261 |
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1, |
273 |
$add1,$every1,$whenmorethan1,$setto1,$lastvalue1,$innerloop1, |
Lines 267-272
sub redirect_add_subscription {
Link Here
|
267 |
); |
279 |
); |
268 |
ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote); |
280 |
ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote); |
269 |
|
281 |
|
|
|
282 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
283 |
my @additional_field_values; |
284 |
for my $field ( @$additional_fields ) { |
285 |
my $af = Koha::AdditionalField->new({ id => $field->{id} }); |
286 |
$af->{values} = { |
287 |
$subscriptionid => $query->param('additional_fields_' . $field->{name}) |
288 |
}; |
289 |
$af->insert_values; |
290 |
} |
291 |
|
270 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
292 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
271 |
return; |
293 |
return; |
272 |
} |
294 |
} |
Lines 352-357
sub redirect_mod_subscription {
Link Here
|
352 |
$serialsadditems, $staffdisplaycount,$opacdisplaycount,$graceperiod,$location,$enddate,$subscriptionid |
374 |
$serialsadditems, $staffdisplaycount,$opacdisplaycount,$graceperiod,$location,$enddate,$subscriptionid |
353 |
); |
375 |
); |
354 |
ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote); |
376 |
ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote); |
|
|
377 |
|
378 |
|
379 |
my $additional_fields = Koha::AdditionalField->all( { table => 'subscription' } ); |
380 |
my @additional_field_values; |
381 |
for my $field ( @$additional_fields ) { |
382 |
my $af = Koha::AdditionalField->new({ id => $field->{id} })->fetch; |
383 |
if ( $af->{marcfield} ) { |
384 |
my $record = GetMarcBiblio( $biblionumber, 1 ); |
385 |
my ( $field, $subfield ) = split /\$/, $af->{marcfield}; |
386 |
next unless $field and $subfield; |
387 |
my $value = $record->subfield( $field, $subfield ); |
388 |
$af->{values} = { |
389 |
$subscriptionid => $value |
390 |
}; |
391 |
} else { |
392 |
$af->{values} = { |
393 |
$subscriptionid => $query->param('additional_fields_' . $field->{name}) |
394 |
}; |
395 |
} |
396 |
$af->insert_values; |
397 |
} |
398 |
|
355 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
399 |
print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); |
356 |
return; |
400 |
return; |
357 |
} |
401 |
} |