View | Details | Raw Unified | Return to bug 9762
Collapse All | Expand All

(-)a/C4/Circulation.pm (-37 / +129 lines)
Lines 318-323 A recall for this item was found, and the item needs to be transferred to the re Link Here
318
318
319
=cut
319
=cut
320
320
321
my $query = CGI->new;
322
323
my $stickyduedate  = $query->param('stickyduedate');
324
my $duedatespec    = $query->param('duedatespec');
325
my $restoreduedatespec  = $query->param('restoreduedatespec') || $duedatespec;
326
if ( $restoreduedatespec && $restoreduedatespec eq "highholds_empty" ) {
327
    undef $restoreduedatespec;
328
}
329
my $issueconfirmed = $query->param('issueconfirmed');
330
my $cancelreserve  = $query->param('cancelreserve');
331
my $cancel_recall  = $query->param('cancel_recall');
332
my $recall_id      = $query->param('recall_id');
333
my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice
334
my $charges        = $query->param('charges') || q{};
335
321
sub transferbook {
336
sub transferbook {
322
    my $params = shift;
337
    my $params = shift;
323
    my $tbr      = $params->{to_branch};
338
    my $tbr      = $params->{to_branch};
Lines 796-804 sub CanBookBeIssued { Link Here
796
    my $circ_library = Koha::Libraries->find( _GetCircControlBranch($item_unblessed, $patron_unblessed) );
811
    my $circ_library = Koha::Libraries->find( _GetCircControlBranch($item_unblessed, $patron_unblessed) );
797
812
798
    my $now = dt_from_string();
813
    my $now = dt_from_string();
814
    my $message;
815
799
    $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron_unblessed );
816
    $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron_unblessed );
800
    if (DateTime->compare($duedate,$now) == -1 ) { # duedate cannot be before now
817
    if (DateTime->compare($duedate,$now) == -1 ) { # duedate cannot be before now
801
         $needsconfirmation{INVALID_DATE} = $duedate;
818
         $needsconfirmation{INVALID_DATE} = $duedate;
819
        if ($issueconfirmed) {
820
            if ($message ) {
821
                $message = "$message + sticky due date is invalid or due date in the past";
822
            } else {
823
                $message = "sticky due date is invalid or due date in the past";
824
            }
825
        }
826
         
802
    }
827
    }
803
828
804
    my $fees = Koha::Charges::Fees->new(
829
    my $fees = Koha::Charges::Fees->new(
Lines 906-915 sub CanBookBeIssued { Link Here
906
    else {
931
    else {
907
        if ( $non_issues_charges > $amountlimit && $allowfineoverride ) {
932
        if ( $non_issues_charges > $amountlimit && $allowfineoverride ) {
908
            $needsconfirmation{DEBT} = $non_issues_charges;
933
            $needsconfirmation{DEBT} = $non_issues_charges;
934
            if ($issueconfirmed) {
935
                if ($message) {
936
                    $message = "$message + guarantees had amend";
937
                } else {
938
                    $message = "guarantees had amend";
939
                }
940
            }
909
        } elsif ( $non_issues_charges > $amountlimit && !$allowfineoverride) {
941
        } elsif ( $non_issues_charges > $amountlimit && !$allowfineoverride) {
910
            $issuingimpossible{DEBT} = $non_issues_charges;
942
            $issuingimpossible{DEBT} = $non_issues_charges;
911
        } elsif ( $non_issues_charges > 0 && $allfinesneedoverride ) {
943
        } elsif ( $non_issues_charges > 0 && $allfinesneedoverride ) {
912
            $needsconfirmation{DEBT} = $non_issues_charges;
944
            $needsconfirmation{DEBT} = $non_issues_charges;
945
            if ($issueconfirmed) {
946
                if ($message) {
947
                    $message = "$message + guarantees had amend";
948
                } else {
949
                    $message = "guarantees had amend";
950
                }
951
            }
913
        }
952
        }
914
    }
953
    }
915
954
Lines 989-994 sub CanBookBeIssued { Link Here
989
        } else {
1028
        } else {
990
            if ( C4::Context->preference('AutoReturnCheckedOutItems') ) {
1029
            if ( C4::Context->preference('AutoReturnCheckedOutItems') ) {
991
                $alerts{RETURNED_FROM_ANOTHER} = { patron => $patron };
1030
                $alerts{RETURNED_FROM_ANOTHER} = { patron => $patron };
1031
                if ($issueconfirmed) {
1032
                    if ($message) {
1033
                        $message = "$message + Auto Return Checked Out Items";
1034
                    } else {
1035
                        $message = "Auto Return Checked Out Items";
1036
                    }
1037
                }
992
            } else {
1038
            } else {
993
            $needsconfirmation{ISSUED_TO_ANOTHER} = 1;
1039
            $needsconfirmation{ISSUED_TO_ANOTHER} = 1;
994
            $needsconfirmation{issued_firstname} = $patron->firstname;
1040
            $needsconfirmation{issued_firstname} = $patron->firstname;
Lines 1016-1021 sub CanBookBeIssued { Link Here
1016
            $needsconfirmation{TOO_MANY} = $toomany->{reason};
1062
            $needsconfirmation{TOO_MANY} = $toomany->{reason};
1017
            $needsconfirmation{current_loan_count} = $toomany->{count};
1063
            $needsconfirmation{current_loan_count} = $toomany->{count};
1018
            $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed};
1064
            $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed};
1065
            if ($issueconfirmed) {
1066
                if ($message) {
1067
                    $message = "$message + too many items for the type";
1068
                } else {
1069
                    $message = "too many items for the type";
1070
                }
1071
                
1072
            }
1019
        } else {
1073
        } else {
1020
            $issuingimpossible{TOO_MANY} = $toomany->{reason};
1074
            $issuingimpossible{TOO_MANY} = $toomany->{reason};
1021
            $issuingimpossible{current_loan_count} = $toomany->{count};
1075
            $issuingimpossible{current_loan_count} = $toomany->{count};
Lines 1042-1047 sub CanBookBeIssued { Link Here
1042
        }else{
1096
        }else{
1043
            $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
1097
            $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
1044
            $needsconfirmation{item_notforloan} = $item_object->notforloan;
1098
            $needsconfirmation{item_notforloan} = $item_object->notforloan;
1099
            if ($issueconfirmed) {
1100
                if ($message) {
1101
                    $message = "$message + item not for loan";
1102
                } else {
1103
                    $message = "item not for loan";
1104
                }
1105
            }
1045
        }
1106
        }
1046
    }
1107
    }
1047
    else {
1108
    else {
Lines 1088-1093 sub CanBookBeIssued { Link Here
1088
        my $code = $av->count ? $av->next->lib : '';
1149
        my $code = $av->count ? $av->next->lib : '';
1089
        $needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' );
1150
        $needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' );
1090
        $alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' );
1151
        $alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' );
1152
        if ($issueconfirmed) {
1153
            if ($message) {
1154
                $message = "$message + Item lost";
1155
            } else {
1156
                $message = "Item lost";
1157
            }
1158
        }
1091
    }
1159
    }
1092
    if ( C4::Context->preference("IndependentBranches") ) {
1160
    if ( C4::Context->preference("IndependentBranches") ) {
1093
        my $userenv = C4::Context->userenv;
1161
        my $userenv = C4::Context->userenv;
Lines 1184-1189 sub CanBookBeIssued { Link Here
1184
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1252
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1185
                    $needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'};
1253
                    $needsconfirmation{'reswaitingdate'} = $res->{'waitingdate'};
1186
                    $needsconfirmation{'reserve_id'} = $res->{reserve_id};
1254
                    $needsconfirmation{'reserve_id'} = $res->{reserve_id};
1255
                    if ($issueconfirmed) {
1256
                        if($message) {
1257
                            $message = "$message + The item is on reserve and waiting, but has been reserved by some other patron.";
1258
                        } else {
1259
                            $message = "The item is on reserve and waiting, but has been reserved by some other patron.";
1260
                        }
1261
                    }
1187
                }
1262
                }
1188
                elsif ( $restype eq "Reserved" ) {
1263
                elsif ( $restype eq "Reserved" ) {
1189
                    # The item is on reserve for someone else.
1264
                    # The item is on reserve for someone else.
Lines 1195-1200 sub CanBookBeIssued { Link Here
1195
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1270
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1196
                    $needsconfirmation{'resreservedate'} = $res->{reservedate};
1271
                    $needsconfirmation{'resreservedate'} = $res->{reservedate};
1197
                    $needsconfirmation{'reserve_id'} = $res->{reserve_id};
1272
                    $needsconfirmation{'reserve_id'} = $res->{reserve_id};
1273
                    if ($issueconfirmed) {
1274
                        if($message) {
1275
                            $message = "$message + The item is on reserve for someone else";
1276
                        } else {
1277
                            $message = "The item is on reserve for someone else";
1278
                        }
1279
                    }
1198
                }
1280
                }
1199
                elsif ( $restype eq "Transferred" ) {
1281
                elsif ( $restype eq "Transferred" ) {
1200
                    # The item is determined hold being transferred for someone else.
1282
                    # The item is determined hold being transferred for someone else.
Lines 1206-1211 sub CanBookBeIssued { Link Here
1206
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1288
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1207
                    $needsconfirmation{'resreservedate'} = $res->{reservedate};
1289
                    $needsconfirmation{'resreservedate'} = $res->{reservedate};
1208
                    $needsconfirmation{'reserve_id'} = $res->{reserve_id};
1290
                    $needsconfirmation{'reserve_id'} = $res->{reserve_id};
1291
                    if ($issueconfirmed) {
1292
                        if($message) {
1293
                            $message = "$message + The item is determined hold being transferred for someone else";
1294
                        } else {
1295
                            $message = "The item is determined hold being transferred for someone else";
1296
                        }
1297
                    }
1209
                }
1298
                }
1210
                elsif ( $restype eq "Processing" ) {
1299
                elsif ( $restype eq "Processing" ) {
1211
                    # The item is determined hold being processed for someone else.
1300
                    # The item is determined hold being processed for someone else.
Lines 1217-1222 sub CanBookBeIssued { Link Here
1217
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1306
                    $needsconfirmation{'resbranchcode'} = $res->{branchcode};
1218
                    $needsconfirmation{'resreservedate'} = $res->{reservedate};
1307
                    $needsconfirmation{'resreservedate'} = $res->{reservedate};
1219
                    $needsconfirmation{'reserve_id'} = $res->{reserve_id};
1308
                    $needsconfirmation{'reserve_id'} = $res->{reserve_id};
1309
                    if ($issueconfirmed) {
1310
                        if($message) {
1311
                            $message = "$message + The item is determined hold being processed for someone else";
1312
                        } else {
1313
                            $message = "The item is determined hold being processed for someone else";
1314
                        }
1315
                    }
1220
                }
1316
                }
1221
            }
1317
            }
1222
        }
1318
        }
Lines 1228-1233 sub CanBookBeIssued { Link Here
1228
    if ( $daysToAgeRestriction && $daysToAgeRestriction > 0 ) {
1324
    if ( $daysToAgeRestriction && $daysToAgeRestriction > 0 ) {
1229
        if ( C4::Context->preference('AgeRestrictionOverride') ) {
1325
        if ( C4::Context->preference('AgeRestrictionOverride') ) {
1230
            $needsconfirmation{AGE_RESTRICTION} = "$agerestriction";
1326
            $needsconfirmation{AGE_RESTRICTION} = "$agerestriction";
1327
            if($message) {
1328
                $message = "$message + Age restriction";
1329
            } else {
1330
                $message = "Age restriction";
1331
            }
1231
        }
1332
        }
1232
        else {
1333
        else {
1233
            $issuingimpossible{AGE_RESTRICTION} = "$agerestriction";
1334
            $issuingimpossible{AGE_RESTRICTION} = "$agerestriction";
Lines 1284-1289 sub CanBookBeIssued { Link Here
1284
        }
1385
        }
1285
    }
1386
    }
1286
1387
1388
    my $borrower = $patron;
1389
    my $cardnumber = $patron->cardnumber;
1390
    my $datestring = localtime();
1391
    my $commis = C4::Context->userenv->{id};
1392
    my $branchcode = C4::Context->userenv->{branch};
1393
    my $item = Koha::Items->find( { barcode => $barcode } );
1394
    my $itemnumber = $item->itemnumber;
1395
1396
    # action, cardnumber, barcode, date, heure, commis, branche
1397
    if ($issueconfirmed) {
1398
        logaction(
1399
            "CIRCULATION", "ISSUE",
1400
            $borrower->{'borrowernumber'},
1401
            "$message - $cardnumber - $barcode - $datestring - $commis - $branchcode",
1402
        ) if C4::Context->preference("IssueLog");
1403
    } else {
1404
        $message = "Circulation";
1405
        logaction(
1406
            "CIRCULATION", "ISSUE",
1407
            $borrower->{'borrowernumber'},
1408
            "$itemnumber",
1409
        ) if C4::Context->preference("IssueLog");
1410
    }
1287
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, );
1411
    return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, );
1288
}
1412
}
1289
1413
Lines 1742-1766 sub AddIssue { Link Here
1742
                }
1866
                }
1743
            }
1867
            }
1744
1868
1745
            my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckout');
1746
            if ($yaml) {
1747
                $yaml = "$yaml\n\n";
1748
1749
                my $rules;
1750
                eval { $rules = YAML::XS::Load(Encode::encode_utf8($yaml)); };
1751
                if ($@) {
1752
                    warn "Unable to parse UpdateNotForLoanStatusOnCheckout syspref : $@";
1753
                }
1754
                else {
1755
                    foreach my $key ( keys %$rules ) {
1756
                        if ( $item_object->notforloan eq $key ) {
1757
                            $item_object->notforloan($rules->{$key})->store({ log_action => 0, skip_record_index => 1 });
1758
                            last;
1759
                        }
1760
                    }
1761
                }
1762
            }
1763
1764
            # Record the fact that this book was issued.
1869
            # Record the fact that this book was issued.
1765
            C4::Stats::UpdateStats(
1870
            C4::Stats::UpdateStats(
1766
                {
1871
                {
Lines 1795-1805 sub AddIssue { Link Here
1795
                    }
1900
                    }
1796
                );
1901
                );
1797
            }
1902
            }
1798
            logaction(
1799
                "CIRCULATION", "ISSUE",
1800
                $borrower->{'borrowernumber'},
1801
                $item_object->itemnumber,
1802
            ) if C4::Context->preference("IssueLog");
1803
1903
1804
            Koha::Plugins->call('after_circ_action', {
1904
            Koha::Plugins->call('after_circ_action', {
1805
                action  => 'checkout',
1905
                action  => 'checkout',
Lines 2296-2303 sub AddReturn { Link Here
2296
                $transfer->receive;
2396
                $transfer->receive;
2297
                $messages->{'TransferArrived'} = $transfer->frombranch;
2397
                $messages->{'TransferArrived'} = $transfer->frombranch;
2298
                # validTransfer=1 allows us returning the item back if the reserve is cancelled
2398
                # validTransfer=1 allows us returning the item back if the reserve is cancelled
2299
                $validTransfer = 1
2399
                $validTransfer = 1 if $transfer->reason eq 'Reserve';
2300
                  if defined $transfer->reason && $transfer->reason eq 'Reserve';
2301
            }
2400
            }
2302
            else {
2401
            else {
2303
                $messages->{'WrongTransfer'}     = $transfer->tobranch;
2402
                $messages->{'WrongTransfer'}     = $transfer->tobranch;
Lines 3083-3091 fallback to a true value Link Here
3083
3182
3084
C<$automatic> is a boolean flag indicating the renewal was triggered automatically and not by a person ( librarian or patron )
3183
C<$automatic> is a boolean flag indicating the renewal was triggered automatically and not by a person ( librarian or patron )
3085
3184
3086
C<$skip_record_index> is an optional boolean flag to indicate whether queuing the search indexing
3087
should be skipped for this renewal.
3088
3089
=cut
3185
=cut
3090
3186
3091
sub AddRenewal {
3187
sub AddRenewal {
Lines 3097-3103 sub AddRenewal { Link Here
3097
    my $skipfinecalc    = shift;
3193
    my $skipfinecalc    = shift;
3098
    my $seen            = shift;
3194
    my $seen            = shift;
3099
    my $automatic       = shift;
3195
    my $automatic       = shift;
3100
    my $skip_record_index = shift;
3101
3196
3102
    # Fallback on a 'seen' renewal
3197
    # Fallback on a 'seen' renewal
3103
    $seen = defined $seen && $seen == 0 ? 0 : 1;
3198
    $seen = defined $seen && $seen == 0 ? 0 : 1;
Lines 3192-3198 sub AddRenewal { Link Here
3192
        $renews = ( $item_object->renewals || 0 ) + 1;
3287
        $renews = ( $item_object->renewals || 0 ) + 1;
3193
        $item_object->renewals($renews);
3288
        $item_object->renewals($renews);
3194
        $item_object->onloan($datedue);
3289
        $item_object->onloan($datedue);
3195
        # Don't index as we are in a transaction, skip hardcoded here
3290
        # Don't index as we are in a transaction
3196
        $item_object->store({ log_action => 0, skip_record_index => 1 });
3291
        $item_object->store({ log_action => 0, skip_record_index => 1 });
3197
3292
3198
        # Charge a new rental fee, if applicable
3293
        # Charge a new rental fee, if applicable
Lines 3278-3289 sub AddRenewal { Link Here
3278
            }
3373
            }
3279
        });
3374
        });
3280
    });
3375
    });
3281
3376
    # We index now, after the transaction is committed
3282
    unless( $skip_record_index ){
3377
    my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
3283
        # We index now, after the transaction is committed
3378
    $indexer->index_records( $item_object->biblionumber, "specialUpdate", "biblioserver" );
3284
        my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
3285
        $indexer->index_records( $item_object->biblionumber, "specialUpdate", "biblioserver" );
3286
    }
3287
3379
3288
    return $datedue;
3380
    return $datedue;
3289
}
3381
}
(-)a/circ/circulation.pl (+17 lines)
Lines 38-43 use C4::Members; Link Here
38
use C4::Biblio qw( TransformMarcToKoha );
38
use C4::Biblio qw( TransformMarcToKoha );
39
use C4::Search qw( new_record_from_zebra );
39
use C4::Search qw( new_record_from_zebra );
40
use C4::Reserves;
40
use C4::Reserves;
41
use C4::Log qw( logaction );
41
use Koha::Holds;
42
use Koha::Holds;
42
use C4::Context;
43
use C4::Context;
43
use CGI::Session;
44
use CGI::Session;
Lines 400-408 if (@$barcodes) { Link Here
400
                    }
401
                    }
401
                );
402
                );
402
                $recall_id = ( $recall and $recall->id ) ? $recall->id : undef;
403
                $recall_id = ( $recall and $recall->id ) ? $recall->id : undef;
404
403
            }
405
            }
404
            my $issue = AddIssue( $patron->unblessed, $barcode, $datedue, $cancelreserve, undef, undef, { onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew'), switch_onsite_checkout => $switch_onsite_checkout, cancel_recall => $cancel_recall, recall_id => $recall_id, } );
406
            my $issue = AddIssue( $patron->unblessed, $barcode, $datedue, $cancelreserve, undef, undef, { onsite_checkout => $onsite_checkout, auto_renew => $session->param('auto_renew'), switch_onsite_checkout => $switch_onsite_checkout, cancel_recall => $cancel_recall, recall_id => $recall_id, } );
405
            $template_params->{issue} = $issue;
407
            $template_params->{issue} = $issue;
408
409
            my $borrower = $patron;
410
            my $cardnumber = $patron->cardnumber;
411
            my $datestring = localtime();
412
            my $commis = C4::Context->userenv->{id};
413
            my $branchcode = C4::Context->userenv->{branch};
414
            $message = "Restriction overridden temporarily";
415
416
            if ($issueconfirmed) {
417
                logaction(
418
                    "CIRCULATION", "ISSUE",
419
                    $borrower->{'borrowernumber'},
420
                    "$message - $cardnumber - $barcode - $datestring - $commis - $branchcode",
421
                ) if C4::Context->preference("IssueLog");
422
            }
406
            $session->clear('auto_renew');
423
            $session->clear('auto_renew');
407
            $inprocess = 1;
424
            $inprocess = 1;
408
        }
425
        }
(-)a/circ/renew.pl (-1 / +21 lines)
Lines 24-29 use C4::Context; Link Here
24
use C4::Auth qw( get_template_and_user );
24
use C4::Auth qw( get_template_and_user );
25
use C4::Output qw( output_html_with_http_headers );
25
use C4::Output qw( output_html_with_http_headers );
26
use C4::Circulation qw( barcodedecode CanBookBeRenewed GetLatestAutoRenewDate AddRenewal );
26
use C4::Circulation qw( barcodedecode CanBookBeRenewed GetLatestAutoRenewDate AddRenewal );
27
use C4::Log qw( logaction );
27
use Koha::DateUtils qw( dt_from_string );
28
use Koha::DateUtils qw( dt_from_string );
28
use Koha::Database;
29
use Koha::Database;
29
use Koha::BiblioFrameworks;
30
use Koha::BiblioFrameworks;
Lines 63-69 if ($barcode) { Link Here
63
        if ($issue) {
64
        if ($issue) {
64
65
65
            $borrower = $issue->patron();
66
            $borrower = $issue->patron();
66
            
67
            my $cardnumber = $borrower->cardnumber;
68
            my $datestring = localtime();
69
            my $commis = C4::Context->userenv->{id};
70
            my $branchcode = C4::Context->userenv->{branch};
71
            my $message;
72
67
            if ( ( $borrower->debarred() || q{} ) lt dt_from_string()->ymd() ) {
73
            if ( ( $borrower->debarred() || q{} ) lt dt_from_string()->ymd() ) {
68
                my $can_renew;
74
                my $can_renew;
69
                my $info;
75
                my $info;
Lines 75-80 if ($barcode) { Link Here
75
                    if ($override_holds) {
81
                    if ($override_holds) {
76
                        $can_renew = 1;
82
                        $can_renew = 1;
77
                        $error     = undef;
83
                        $error     = undef;
84
85
                        $message = "Override Renew hold for another";
86
                        logaction(
87
                            "CIRCULATION", "RENEWAL",
88
                            $borrower->{'borrowernumber'},
89
                            "$message - $cardnumber - $barcode - $datestring - $commis - $branchcode",
90
                        ) if C4::Context->preference("RenewalLog");
78
                    }
91
                    }
79
                    else {
92
                    else {
80
                        $can_renew = 0;
93
                        $can_renew = 0;
Lines 108-113 if ($barcode) { Link Here
108
                        !$unseen
121
                        !$unseen
109
                    );
122
                    );
110
                    $template->param( date_due => $date_due );
123
                    $template->param( date_due => $date_due );
124
125
                    $message = "Override limit Renew";
126
                    logaction(
127
                        "CIRCULATION", "RENEWAL",
128
                        $borrower->{'borrowernumber'},
129
                        "$message - $cardnumber - $barcode - $datestring - $commis - $branchcode",
130
                    ) if C4::Context->preference("RenewalLog");
111
                }
131
                }
112
            }
132
            }
113
            else {
133
            else {
(-)a/circ/returns.pl (-1 / +13 lines)
Lines 43-48 use C4::Members; Link Here
43
use C4::Output qw( output_html_with_http_headers );
43
use C4::Output qw( output_html_with_http_headers );
44
use C4::Reserves qw( ModReserve ModReserveAffect GetOtherReserves );
44
use C4::Reserves qw( ModReserve ModReserveAffect GetOtherReserves );
45
use C4::RotatingCollections;
45
use C4::RotatingCollections;
46
use C4::Log qw( logaction );
46
use Koha::AuthorisedValues;
47
use Koha::AuthorisedValues;
47
use Koha::BiblioFrameworks;
48
use Koha::BiblioFrameworks;
48
use Koha::Calendar;
49
use Koha::Calendar;
Lines 175-180 if ( $query->param('reserve_id') ) { Link Here
175
            diffbranch     => 1,
176
            diffbranch     => 1,
176
        );
177
        );
177
    }
178
    }
179
} else {
180
    my $message = "return an element that is reserved";
181
    my $datestring = localtime();
182
    my $commis = C4::Context->userenv->{id};
183
    my $branchcode = C4::Context->userenv->{branch};
184
185
    logaction(
186
        "CIRCULATION", "RETURN",
187
        $session,
188
        "$message - $datestring - $commis - $branchcode",
189
    ) if C4::Context->preference("ReturnLog");
178
}
190
}
179
191
180
if ( $query->param('recall_id') ) {
192
if ( $query->param('recall_id') ) {
Lines 419-425 if ($barcode) { Link Here
419
    }
431
    }
420
432
421
    # Mark missing bundle items as lost and report unexpected items
433
    # Mark missing bundle items as lost and report unexpected items
422
    if ( $item && $item->is_bundle && $query->param('confirm_items_bundle_return') && !$query->param('do_not_verify_items_bundle_contents') ) {
434
    if ( $item && $item->is_bundle && $query->param('confirm_items_bundle_return') ) {
423
        my $BundleLostValue = C4::Context->preference('BundleLostValue');
435
        my $BundleLostValue = C4::Context->preference('BundleLostValue');
424
        my $barcodes = $query->param('verify-items-bundle-contents-barcodes');
436
        my $barcodes = $query->param('verify-items-bundle-contents-barcodes');
425
        my @barcodes = map { s/^\s+|\s+$//gr } ( split /\n/, $barcodes );
437
        my @barcodes = map { s/^\s+|\s+$//gr } ( split /\n/, $barcodes );
(-)a/reserve/request.pl (-1 / +14 lines)
Lines 40-45 use C4::Serials qw( CountSubscriptionFromBiblionumber ); Link Here
40
use C4::Circulation qw( _GetCircControlBranch GetBranchItemRule );
40
use C4::Circulation qw( _GetCircControlBranch GetBranchItemRule );
41
use Koha::DateUtils qw( dt_from_string );
41
use Koha::DateUtils qw( dt_from_string );
42
use C4::Search qw( enabled_staff_search_views );
42
use C4::Search qw( enabled_staff_search_views );
43
use C4::Log qw( logaction );
43
44
44
use Koha::Biblios;
45
use Koha::Biblios;
45
use Koha::Checkouts;
46
use Koha::Checkouts;
Lines 553-558 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
553
                            }
554
                            }
554
                        } else { $num_alreadyheld++ }
555
                        } else { $num_alreadyheld++ }
555
556
557
                        my $borrower = $patron;
558
                        my $cardnumber = $patron->cardnumber;
559
                        my $datestring = localtime();
560
                        my $commis = C4::Context->userenv->{id};
561
                        my $branchcode = C4::Context->userenv->{branch};
562
                        my $message = "Override limitation of hold";
563
564
                        logaction(
565
                            "HOLD", "ISSUE",
566
                            $borrower->{'borrowernumber'},
567
                            "$message - $cardnumber - $datestring - $commis - $branchcode",
568
                        ) if C4::Context->preference("IssueLog");
569
556
                        push( @available_itemtypes, $item->{itype} );
570
                        push( @available_itemtypes, $item->{itype} );
557
                    } else {
571
                    } else {
558
                        # If none of the conditions hold true, then neither override nor available is set and the item cannot be checked
572
                        # If none of the conditions hold true, then neither override nor available is set and the item cannot be checked
559
- 

Return to bug 9762