|
Lines 323-329
sub GetFullSubscription {
Link Here
|
| 323 |
my $sth = $dbh->prepare($query); |
323 |
my $sth = $dbh->prepare($query); |
| 324 |
$sth->execute($subscriptionid); |
324 |
$sth->execute($subscriptionid); |
| 325 |
my $subscriptions = $sth->fetchall_arrayref( {} ); |
325 |
my $subscriptions = $sth->fetchall_arrayref( {} ); |
| 326 |
my $cannotedit = not can_edit_subscription( $subscriptions->[0] ) if scalar @$subscriptions; |
326 |
my $cannotedit; |
|
|
327 |
$cannotedit = not can_edit_subscription( $subscriptions->[0] ) if scalar @$subscriptions; |
| 327 |
for my $subscription ( @$subscriptions ) { |
328 |
for my $subscription ( @$subscriptions ) { |
| 328 |
$subscription->{cannotedit} = $cannotedit; |
329 |
$subscription->{cannotedit} = $cannotedit; |
| 329 |
} |
330 |
} |
|
Lines 346-354
sub PrepareSerialsData {
Link Here
|
| 346 |
my $year; |
347 |
my $year; |
| 347 |
my @res; |
348 |
my @res; |
| 348 |
my $startdate; |
349 |
my $startdate; |
| 349 |
my $aqbooksellername; |
|
|
| 350 |
my $bibliotitle; |
| 351 |
my @loopissues; |
| 352 |
my $first; |
350 |
my $first; |
| 353 |
my $previousnote = ""; |
351 |
my $previousnote = ""; |
| 354 |
|
352 |
|
|
Lines 481-487
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
| 481 |
my $sth = $dbh->prepare($query); |
479 |
my $sth = $dbh->prepare($query); |
| 482 |
$sth->execute($biblionumber); |
480 |
$sth->execute($biblionumber); |
| 483 |
my $subscriptions = $sth->fetchall_arrayref( {} ); |
481 |
my $subscriptions = $sth->fetchall_arrayref( {} ); |
| 484 |
my $cannotedit = not can_edit_subscription( $subscriptions->[0] ) if scalar @$subscriptions; |
482 |
my $cannotedit; |
|
|
483 |
$cannotedit = not can_edit_subscription( $subscriptions->[0] ) if scalar @$subscriptions; |
| 485 |
for my $subscription ( @$subscriptions ) { |
484 |
for my $subscription ( @$subscriptions ) { |
| 486 |
$subscription->{cannotedit} = $cannotedit; |
485 |
$subscription->{cannotedit} = $cannotedit; |
| 487 |
} |
486 |
} |
|
Lines 1301-1309
sub ModSubscription {
Link Here
|
| 1301 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1300 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
| 1302 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1301 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
| 1303 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, |
1302 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, |
| 1304 |
$itemtype, $previousitemtype, $mana_id |
1303 |
$itemtype, $previousitemtype, $mana_id, $auto_claim_enabled |
| 1305 |
) = @_; |
1304 |
) = @_; |
| 1306 |
|
1305 |
|
|
|
1306 |
$auto_claim_enabled //= 0; |
| 1307 |
|
| 1307 |
my $dbh = C4::Context->dbh; |
1308 |
my $dbh = C4::Context->dbh; |
| 1308 |
my $query = "UPDATE subscription |
1309 |
my $query = "UPDATE subscription |
| 1309 |
SET librarian=?, branchcode=?, aqbooksellerid=?, cost=?, aqbudgetid=?, |
1310 |
SET librarian=?, branchcode=?, aqbooksellerid=?, cost=?, aqbudgetid=?, |
|
Lines 1314-1320
sub ModSubscription {
Link Here
|
| 1314 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
1315 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
| 1315 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
1316 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
| 1316 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
1317 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
| 1317 |
skip_serialseq=?, itemtype=?, previousitemtype=?, mana_id=? |
1318 |
skip_serialseq=?, itemtype=?, previousitemtype=?, mana_id=?, |
|
|
1319 |
auto_claim_enabled=? |
| 1318 |
WHERE subscriptionid = ?"; |
1320 |
WHERE subscriptionid = ?"; |
| 1319 |
|
1321 |
|
| 1320 |
my $sth = $dbh->prepare($query); |
1322 |
my $sth = $dbh->prepare($query); |
|
Lines 1328-1334
sub ModSubscription {
Link Here
|
| 1328 |
$letter, ($manualhistory ? $manualhistory : 0), |
1330 |
$letter, ($manualhistory ? $manualhistory : 0), |
| 1329 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1331 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
| 1330 |
$graceperiod, $location, $enddate, $skip_serialseq, |
1332 |
$graceperiod, $location, $enddate, $skip_serialseq, |
| 1331 |
$itemtype, $previousitemtype, $mana_id, |
1333 |
$itemtype, $previousitemtype, $mana_id, $auto_claim_enabled, |
| 1332 |
$subscriptionid |
1334 |
$subscriptionid |
| 1333 |
); |
1335 |
); |
| 1334 |
my $rows = $sth->rows; |
1336 |
my $rows = $sth->rows; |
|
Lines 1362-1369
sub NewSubscription {
Link Here
|
| 1362 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1364 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
| 1363 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1365 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
| 1364 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1366 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
| 1365 |
$location, $enddate, $skip_serialseq, $itemtype, $previousitemtype, $mana_id |
1367 |
$location, $enddate, $skip_serialseq, $itemtype, $previousitemtype, $mana_id, |
|
|
1368 |
$auto_claim_enabled |
| 1366 |
) = @_; |
1369 |
) = @_; |
|
|
1370 |
|
| 1371 |
$auto_claim_enabled //= 0; |
| 1372 |
|
| 1367 |
my $dbh = C4::Context->dbh; |
1373 |
my $dbh = C4::Context->dbh; |
| 1368 |
|
1374 |
|
| 1369 |
my $subscription = Koha::Subscription->new( |
1375 |
my $subscription = Koha::Subscription->new( |
|
Lines 1405-1410
sub NewSubscription {
Link Here
|
| 1405 |
itemtype => $itemtype, |
1411 |
itemtype => $itemtype, |
| 1406 |
previousitemtype => $previousitemtype, |
1412 |
previousitemtype => $previousitemtype, |
| 1407 |
mana_id => $mana_id, |
1413 |
mana_id => $mana_id, |
|
|
1414 |
auto_claim_enabled => $auto_claim_enabled, |
| 1408 |
} |
1415 |
} |
| 1409 |
)->store; |
1416 |
)->store; |
| 1410 |
$subscription->discard_changes; |
1417 |
$subscription->discard_changes; |