From cc1f4427f30045c928799a4ecda67c8a58f99435 Mon Sep 17 00:00:00 2001 From: emilyrose Date: Tue, 26 Sep 2023 08:44:24 -0400 Subject: [PATCH] Bug 9762: Log circulation overrides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch allows you to save commands that have been overridden by someone. The patch has been updated but is not yet completed. Tests 10, 13, 14, and 17 are still not functional. Tests 15 and 16 need to be fixed as they do not display the barcode. All other tests should be functional. To test: --After each step, a message will be displayed in the action_logs table and in Tools > Log viewer -- Circulation -- Checking out 1) Check out an item that is age-restricted (AgeRestrictionOverride syspref) 2) Check out an item that has a “not for loan” status (AllowNotForLoanOverride syspref) 3) Check out an item that has a “lost” status (IssueLostItem syspref) 4) Check out an item to a patron who has reached the checkout limit (AllowTooManyOverride syspref) 5) Check out an item to a patron who is not allowed to borrow this item type 6) Check out an item to a patron who has unpaid fines (AllFinesNeedOverride and/or AllowFineOverride + noissuescharge sysprefs) 7) Check out an item on hold for someone else 8) Check out an item on hold ready for pickup by someone else 9) Check out an item already checked out to someone else (AutoReturnCheckedOutItems syspref) 10) Check out to a patron who has restrictions Circulation -- Checking in 11) Ignore a hold upon check in 12) Ignore a hold and transfer upon check in Circulation – Renewing 13) Renew an item on hold for someone else (AllowRenewalOnHoldOverride syspref) 14) Renew an item that has reached the maximum number of renewals (AllowRenewalLimitOverride syspref) Holds 15) Place a hold for a patron who is not allowed to place this item type on hold (AllowHoldPolicyOverride syspref) 16) Place a hold for a patron who has reached the maximum number of holds 17) Place an item-level hold when rules dictate that this is not allowed (In circulation rules put "On shelf holds allowed" to "If any unavailable") --- C4/Circulation.pm | 132 ++++++++++++++++++++------------------------ circ/circulation.pl | 50 +++++++++++++++-- circ/renew.pl | 58 ++++++++++++++++++- circ/returns.pl | 47 ++++++++++++++-- reserve/request.pl | 31 ++++++++++- svc/renew | 54 ++++++++++++++++++ 6 files changed, 284 insertions(+), 88 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 466d0583bf..bef524858f 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -22,6 +22,7 @@ use Modern::Perl; use DateTime; use POSIX qw( floor ); use Encode; +use JSON; use C4::Context; use C4::Stats qw( UpdateStats ); @@ -319,6 +320,21 @@ A recall for this item was found, and the item needs to be transferred to the re =cut +my $query = CGI->new; + +my $stickyduedate = $query->param('stickyduedate'); +my $duedatespec = $query->param('duedatespec'); +my $restoreduedatespec = $query->param('restoreduedatespec') || $duedatespec; +if ( $restoreduedatespec && $restoreduedatespec eq "highholds_empty" ) { + undef $restoreduedatespec; +} +my $issueconfirmed = $query->param('issueconfirmed'); +my $cancelreserve = $query->param('cancelreserve'); +my $cancel_recall = $query->param('cancel_recall'); +my $recall_id = $query->param('recall_id'); +my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice +my $charges = $query->param('charges') || q{}; + sub transferbook { my $params = shift; my $tbr = $params->{to_branch}; @@ -815,9 +831,10 @@ sub CanBookBeIssued { my $now = dt_from_string(); my $message; - my @message_log; + my @message; $duedate ||= CalcDateDue( $now, $effective_itemtype, $circ_library->branchcode, $patron ); + if (DateTime->compare($duedate,$now) == -1 ) { # duedate cannot be before now $needsconfirmation{INVALID_DATE} = $duedate; if ($issueconfirmed) { @@ -826,7 +843,7 @@ sub CanBookBeIssued { } else { $message = "sticky due date is invalid or due date in the past"; } - push( @message_log, "sticky due date is invalid or due date in the past" ); + push( @message, "sticky due date is invalid or due date in the past" ); } } @@ -880,7 +897,7 @@ sub CanBookBeIssued { } else { $message = "borrower is restricted"; } - push( @message_log, "borrower is restricted" ); + push( @message, "borrower is restricted" ); } } @@ -960,7 +977,7 @@ sub CanBookBeIssued { } else { $message = "borrower had amend"; } - push( @message_log, "borrower had amend" ); + push( @message, "borrower had amend" ); } } elsif ( $patron_borrowing_status->{noissuescharge}->{overlimit} && !$allowfineoverride ) { $issuingimpossible{DEBT} = $patron_borrowing_status->{noissuescharge}->{charge}; @@ -972,7 +989,7 @@ sub CanBookBeIssued { } else { $message = "borrower had amend"; } - push( @message_log, "borrower had amend" ); + push( @message, "borrower had amend" ); } } } @@ -1049,10 +1066,10 @@ sub CanBookBeIssued { if ( C4::Context->preference('AutoReturnCheckedOutItems') ) { $alerts{RETURNED_FROM_ANOTHER} = { patron => $patron }; } else { - $needsconfirmation{ISSUED_TO_ANOTHER} = 1; - $needsconfirmation{issued_firstname} = $patron->firstname; - $needsconfirmation{issued_surname} = $patron->surname; - $needsconfirmation{issued_cardnumber} = $patron->cardnumber; + $needsconfirmation{ISSUED_TO_ANOTHER} = 1; + $needsconfirmation{issued_firstname} = $patron->firstname; + $needsconfirmation{issued_surname} = $patron->surname; + $needsconfirmation{issued_cardnumber} = $patron->cardnumber; $needsconfirmation{issued_borrowernumber} = $patron->borrowernumber; if ($issueconfirmed) { if ($message) { @@ -1060,7 +1077,7 @@ sub CanBookBeIssued { } else { $message = "item is checked out for someone else"; } - push( @message_log, "item is checked out for someone else" ); + push( @message, "item is checked out for someone else" ); } } } @@ -1095,7 +1112,7 @@ sub CanBookBeIssued { } else { $message = "too many checkout"; } - push( @message_log, "too many checkout" ); + push( @message, "too many checkout" ); } } else { $issuingimpossible{TOO_MANY} = $toomany->{reason}; @@ -1130,7 +1147,7 @@ sub CanBookBeIssued { } else { $message = "item not for loan"; } - push( @message_log, "item not for loan" ); + push( @message, "item not for loan" ); } } } else { @@ -1183,7 +1200,7 @@ sub CanBookBeIssued { } else { $message = "item lost"; } - push( @message_log, "item lost" ); + push( @message, "item lost" ); } } if ( C4::Context->preference("IndependentBranches") ) { @@ -1292,10 +1309,7 @@ sub CanBookBeIssued { } else { $message = "item is on reserve and waiting, but has been reserved by some other patron."; } - push( - @message_log, - "item is on reserve and waiting, but has been reserved by some other patron" - ); + push( @message, "item is on reserve and waiting, but has been reserved by some other patron" ); } } elsif ( $restype eq "Reserved" ) { @@ -1314,7 +1328,7 @@ sub CanBookBeIssued { } else { $message = "item is on reserve for someone else"; } - push( @message_log, "item is on reserve for someone else" ); + push( @message, "item is on reserve for someone else" ); } } elsif ( $restype eq "Transferred" ) { @@ -1333,7 +1347,7 @@ sub CanBookBeIssued { } else { $message = "item is determined hold being transferred for someone else"; } - push( @message_log, "item is determined hold being transferred for someone else" ); + push( @message, "item is determined hold being transferred for someone else" ); } } elsif ( $restype eq "Processing" ) { @@ -1352,7 +1366,7 @@ sub CanBookBeIssued { } else { $message = "item is determined hold being processed for someone else"; } - push( @message_log, "item is determined hold being processed for someone else" ); + push( @message, "item is determined hold being processed for someone else" ); } } } @@ -1402,7 +1416,7 @@ sub CanBookBeIssued { } else { $message = "age restriction"; } - push( @message_log, "age restriction" ); + push( @message, "age restriction" ); } else { $issuingimpossible{AGE_RESTRICTION} = "$agerestriction"; @@ -1473,7 +1487,7 @@ sub CanBookBeIssued { my $infos = ( { - message => \@message_log, + message => \@message, borrowernumber => $borrower->borrowernumber, barcode => $barcode, manager_id => $user, @@ -1492,7 +1506,7 @@ sub CanBookBeIssued { } - return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, \@message_log ); + return ( \%issuingimpossible, \%needsconfirmation, \%alerts, \%messages, ); } =head2 CanBookBeReturned @@ -2552,9 +2566,9 @@ sub AddReturn { $messages->{'TransferArrived'} = $transfer->frombranch; # validTransfer=1 allows us returning the item back if the reserve is cancelled - $validTransfer = 1 - if defined $transfer->reason && $transfer->reason eq 'Reserve'; - } else { + $validTransfer = 1 if $transfer->reason eq 'Reserve'; + } + else { $messages->{'WrongTransfer'} = $transfer->tobranch; $messages->{'WrongTransferItem'} = $item->itemnumber; $messages->{'TransferTrigger'} = $transfer->reason; @@ -3309,7 +3323,24 @@ sub CanBookBeRenewed { # There is an item level hold on this item, no other item can fill the hold return ( 0, "on_reserve" ) - if ( $item->current_holds->search( { non_priority => 0 } )->count ); + if ( $item->current_holds->search( { non_priority => 0 } )->count ); + + my $issuing_rule = Koha::CirculationRules->get_effective_rules( + { + categorycode => $patron->categorycode, + itemtype => $item->effective_itemtype, + branchcode => $branchcode, + rules => [ + 'renewalsallowed', + 'lengthunit', + 'unseen_renewals_allowed' + ] + } + ); + + return ( 0, "too_many" ) + if not $issuing_rule->{renewalsallowed} + or $issuing_rule->{renewalsallowed} <= $issue->renewals_count; my ( $status, $matched_reserve, $possible_holds ) = C4::Reserves::CheckReserves($item); my @fillable_holds = (); @@ -3446,8 +3477,7 @@ fallback to a true value C<$automatic> is a boolean flag indicating the renewal was triggered automatically and not by a person ( librarian or patron ) -C<$skip_record_index> is an optional boolean flag to indicate whether queuing the search indexing -should be skipped for this renewal. +C<$skip_record_index> is an optional boolean flag to indicate whether queuing the search indexing should be skipped for this renewal. =cut @@ -3618,50 +3648,6 @@ sub AddRenewal { DelUniqueDebarment( { borrowernumber => $borrowernumber, type => 'OVERDUES' } ); } - # Add renewal record - my $renewal = Koha::Checkouts::Renewal->new( - { - checkout_id => $issue->issue_id, - interface => C4::Context->interface, - renewal_type => $renewal_type, - renewer_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, - seen => $seen, - } - )->store(); - - # Add the renewal to stats - C4::Stats::UpdateStats( - { - branch => $item_object->renewal_branchcode( { branch => $branch } ), - type => 'renew', - amount => $charge, - itemnumber => $itemnumber, - itemtype => $itemtype, - location => $item_object->location, - borrowernumber => $borrowernumber, - ccode => $item_object->ccode, - categorycode => $patron->categorycode, - interface => C4::Context->interface, - } - ); - - #Update borrowers.lastseen - $patron->update_lastseen('renewal'); - - #Log the renewal - logaction( "CIRCULATION", "RENEWAL", $borrowernumber, $itemnumber ) - if C4::Context->preference("RenewalLog"); - - Koha::Plugins->call( - 'after_circ_action', - { - action => 'renewal', - payload => { checkout => $issue->get_from_storage } - } - ); - } - ); - unless ($skip_record_index) { # We index now, after the transaction is committed diff --git a/circ/circulation.pl b/circ/circulation.pl index c0cc3be951..b7c3ce0810 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -36,9 +36,10 @@ use C4::Auth qw( get_session get_template_and_user ); use C4::Koha; use C4::Circulation qw( barcodedecode CanBookBeIssued AddIssue AddReturn ); use C4::Members; -use C4::Biblio qw( TransformMarcToKoha ); -use C4::Search qw( new_record_from_zebra ); -use C4::Reserves qw( ModReserveAffect ); +use C4::Biblio qw( TransformMarcToKoha ); +use C4::Search qw( new_record_from_zebra ); +use C4::Reserves; +use C4::Log qw( logaction ); use Koha::Holds; use C4::Context; use CGI::Session; @@ -239,7 +240,7 @@ if ( @$barcodes == 0 && $charges eq 'yes' ) { # STEP 2 : FIND BORROWER # if there is a list of find borrowers.... # -my $message; + if ($findborrower) { Koha::Plugins->call( 'patron_barcode_transform', \$findborrower ); my $patron = Koha::Patrons->find( { cardnumber => $findborrower } ); @@ -325,7 +326,10 @@ if ($patron) { # STEP 3 : ISSUING # # -if ( @$barcodes && $op eq 'cud-checkout' ) { +my $message; +my @message; + +if (@$barcodes && $op eq 'cud-checkout') { my $checkout_infos; for my $barcode (@$barcodes) { @@ -518,6 +522,7 @@ if ( @$barcodes && $op eq 'cud-checkout' ) { push( @{ $template_params->{sessionConfirmationKeys} }, $needsconfirmation_key ); } } + unless ($confirm_required) { my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}; if ( C4::Context->preference('UseRecalls') && !$recall_id ) { @@ -531,6 +536,7 @@ if ( @$barcodes && $op eq 'cud-checkout' ) { } ); $recall_id = ( $recall and $recall->id ) ? $recall->id : undef; + } # If booked (alerts or confirmation) update datedue to end of booking @@ -551,8 +557,8 @@ if ( @$barcodes && $op eq 'cud-checkout' ) { $session->clear('auto_renew'); $inprocess = 1; } - } + } if ( $needsconfirmation->{RESERVE_WAITING} or $needsconfirmation->{RESERVED} or $needsconfirmation->{TRANSFERRED} @@ -564,6 +570,38 @@ if ( @$barcodes && $op eq 'cud-checkout' ) { ); } + my $borrower = $patron; + my $borrowernumber = $patron->borrowernumber; + my $user = C4::Context->userenv->{number}; + my $branchcode = C4::Context->userenv->{branch}; + $message = "Restriction overridden temporarily"; + @message = ("Restriction overridden temporarily"); + + if ($issueconfirmed) { + my $infos = ( + { + message => \@message, + borrowernumber => $borrowernumber, + barcode => $barcode, + manager_id => $user, + branchcode => $branchcode, + } + ); + + my $json_infos = JSON->new->utf8->pretty->encode($infos); + $json_infos =~ s/"/'/g; + + logaction( + "CIRCULATION", "ISSUE", + $borrower->{'borrowernumber'}, + $json_infos, + ) if C4::Context->preference("IssueLog"); + } + $session->clear('auto_renew'); + $inprocess = 1; + + + # FIXME If the issue is confirmed, we launch another time checkouts->count, now display the issue count after issue $patron = Koha::Patrons->find($borrowernumber); $template_params->{issuecount} = $patron->checkouts->count; diff --git a/circ/renew.pl b/circ/renew.pl index c27881a494..67bff4bc5a 100755 --- a/circ/renew.pl +++ b/circ/renew.pl @@ -24,6 +24,7 @@ use C4::Context; use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); use C4::Circulation qw( barcodedecode CanBookBeRenewed GetLatestAutoRenewDate AddRenewal ); +use C4::Log qw( logaction ); use Koha::DateUtils qw( dt_from_string ); use Koha::Database; use Koha::BiblioFrameworks; @@ -64,8 +65,14 @@ if ( $op eq 'cud-renew' && $barcode ) { if ($checkout) { $patron = $checkout->patron; - - if ( ( $patron->is_debarred || q{} ) lt dt_from_string()->ymd() ) { + my $borrower = $patron; + my $borrowernumber = $borrower->borrowernumber; + my $user = C4::Context->userenv->{number}; + my $branchcode = C4::Context->userenv->{branch}; + my $message; + my @message; + + if ( ( $borrower->debarred() || q{} ) lt dt_from_string()->ymd() ) { my $can_renew; my $info; ( $can_renew, $error, $info ) = CanBookBeRenewed( $patron, $checkout, $override_limit ); @@ -74,7 +81,30 @@ if ( $op eq 'cud-renew' && $barcode ) { if ($override_holds) { $can_renew = 1; $error = undef; - } else { + + $message = "Override Renew hold for another"; + @message = ("Override Renew hold for another"); + + my $infos = ( + { + message => \@message, + borrowernumber => $borrowernumber, + barcode => $barcode, + manager_id => $user, + branchcode => $branchcode, + } + ); + + my $json_infos = JSON->new->utf8->pretty->encode($infos); + $json_infos =~ s/"/'/g; + + logaction( + "CIRCULATION", "RENEWAL", + $borrower->{'borrowernumber'}, + $json_infos, + ) if C4::Context->preference("RenewalLog"); + } + else { $can_renew = 0; } } @@ -104,6 +134,28 @@ if ( $op eq 'cud-renew' && $barcode ) { } ); $template->param( date_due => $date_due ); + + $message = "Override limit Renew"; + @message = ("Override limit Renew"); + + my $infos = ( + { + message => \@message, + borrowernumber => $borrowernumber, + barcode => $barcode, + manager_id => $user, + branchcode => $branchcode, + } + ); + + my $json_infos = JSON->new->utf8->pretty->encode($infos); + $json_infos =~ s/"/'/g; + + logaction( + "CIRCULATION", "RENEWAL", + $borrower->{'borrowernumber'}, + $json_infos, + ) if C4::Context->preference("RenewalLog"); } } else { $error = "patron_restricted"; diff --git a/circ/returns.pl b/circ/returns.pl index 11b0795ad7..fc5aa91e72 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -42,6 +42,7 @@ use C4::Members; use C4::Output qw( output_html_with_http_headers ); use C4::Reserves qw( ModReserve ModReserveAffect CheckReserves ); use C4::RotatingCollections; +use C4::Log qw( logaction ); use Koha::AuthorisedValues; use Koha::BiblioFrameworks; use Koha::Calendar; @@ -187,6 +188,46 @@ if ( $query->param('reserve_id') && $op eq 'cud-affect_reserve' ) { $transfer->transit; } } + # check if we have other reserves for this document, if we have a result send the message of transfer + # FIXME do we need to do this if we didn't take the cancel_reserve branch above? + my ( undef, $nextreservinfo, undef ) = CheckReserves($item); + + if ( $userenv_branch ne $nextreservinfo->{'branchcode'} ) { + my $patron = Koha::Patrons->find( $nextreservinfo->{'borrowernumber'} ); + $template->param( + itemtitle => $biblio->title, + itembiblionumber => $biblio->biblionumber, + iteminfo => $biblio->author, + patron => $patron, + diffbranch => 1, + ); + } +} else { + my $message = "return an element that is reserved"; + my @message = ("return an element that is reserved"); + my $user = C4::Context->userenv->{number}; + my $branchcode = C4::Context->userenv->{branch}; + my $barcode = $query->param('barcode'); + + my $infos = ( + { + message => \@message, + + #'card number' => $cardnumber, + barcode => $barcode, + manager_id => $user, + branchcode => $branchcode, + } + ); + + my $json_infos = JSON->new->utf8->pretty->encode($infos); + $json_infos =~ s/"/'/g; + + logaction( + "CIRCULATION", "RETURN", + $session, + $json_infos, + ) if C4::Context->preference("ReturnLog"); } if ( $query->param('recall_id') && $op eq 'cud-affect_recall' ) { @@ -458,11 +499,7 @@ if ( $barcode && ( $op eq 'cud-checkin' || $op eq 'cud-affect_reserve' ) ) { } # Mark missing bundle items as lost and report unexpected items - if ( $item - && $item->is_bundle - && $query->param('confirm_items_bundle_return') - && !$query->param('do_not_verify_items_bundle_contents') ) - { + if ( $item && $item->is_bundle && $query->param('confirm_items_bundle_return') ) { my $BundleLostValue = C4::Context->preference('BundleLostValue'); my $barcodes = $query->param('verify-items-bundle-contents-barcodes'); my @barcodes = map { s/^\s+|\s+$//gr } ( split /\n/, $barcodes ); diff --git a/reserve/request.pl b/reserve/request.pl index c5e354aa7d..9d1a73fbd4 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -26,6 +26,7 @@ script to place reserves/requests =cut use Modern::Perl; +use Data::Dumper; use CGI qw ( -utf8 ); use List::MoreUtils qw( uniq ); @@ -39,7 +40,8 @@ use C4::Koha qw( getitemtypeimagelocation ); use C4::Serials qw( CountSubscriptionFromBiblionumber ); use C4::Circulation qw( _GetCircControlBranch GetBranchItemRule ); use Koha::DateUtils qw( dt_from_string ); -use C4::Search qw( enabled_staff_search_views ); +use C4::Search qw( enabled_staff_search_views ); +use C4::Log qw( logaction ); use Koha::Biblios; use Koha::Checkouts; @@ -561,6 +563,33 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) $num_alreadyheld++; } + my $borrower = $patron; + my $borrowernumber = $patron->borrowernumber; + my $user = C4::Context->userenv->{number}; + my $branchcode = C4::Context->userenv->{branch}; + my $message = "Override limitation of hold"; + my @message = ("Override limitation of hold"); + my $barcode = $item->{barcode}; + + my $infos = ( + { + message => \@message, + borrowernumber => $borrowernumber, + barcode => $barcode, + manager_id => $user, + branchcode => $branchcode, + } + ); + + my $json_infos = JSON->new->utf8->pretty->encode($infos); + $json_infos =~ s/"/'/g; + + logaction( + "HOLD", "ISSUE", + $borrower->{'borrowernumber'}, + $json_infos, + ) if C4::Context->preference("IssueLog"); + push( @available_itemtypes, $item->{itype} ); } else { diff --git a/svc/renew b/svc/renew index b995a6ef34..49625bb5b3 100755 --- a/svc/renew +++ b/svc/renew @@ -26,6 +26,7 @@ use Try::Tiny; use C4::Circulation qw( AddRenewal CanBookBeRenewed ); use C4::Context; use C4::Auth qw(check_cookie_auth); +use C4::Log qw( logaction ); use Koha::DateUtils qw(output_pref dt_from_string); @@ -53,6 +54,10 @@ my $date_due; if ( $input->param('date_due') ) { $date_due = dt_from_string( scalar $input->param('date_due') ); } +my $borrower = Koha::Patrons->find($borrowernumber); +my $user = C4::Context->userenv->{'number'}; +my $message; +my @message; my $data; $data->{itemnumber} = $itemnumber; @@ -69,6 +74,55 @@ my $item = Koha::Items->find($itemnumber); if ( $data->{error} && $data->{error} eq 'on_reserve' && C4::Context->preference('AllowRenewalOnHoldOverride') ) { $data->{renew_okay} = 1; $data->{error} = undef; + + $message = "Override Renew hold for another"; + @message = ("Override Renew hold for another"); + + my $infos = ( + { + message => \@message, + borrowernumber => $borrowernumber, + barcode => $item->barcode, + manager_id => $user, + branchcode => $branchcode, + } + ); + + my $json_infos = JSON->new->utf8->pretty->encode($infos); + $json_infos =~ s/"/'/g; + + logaction( + "CIRCULATION", "RENEWAL", + $borrower->{'borrowernumber'}, + $json_infos, + ) if C4::Context->preference("IssueLog"); +} + +if ( $data->{error} && $data->{error} eq 'too_many' && C4::Context->preference('AllowRenewalLimitOverride') ) { + $data->{renew_okay} = 1; + $data->{error} = undef; + + $message = "Override limit Renew"; + @message = ("Override limit Renew"); + + my $infos = ( + { + message => \@message, + borrowernumber => $borrowernumber, + barcode => $item->barcode, + manager_id => $user, + branchcode => $branchcode, + } + ); + + my $json_infos = JSON->new->utf8->pretty->encode($infos); + $json_infos =~ s/"/'/g; + + logaction( + "CIRCULATION", "RENEWAL", + $borrower->{'borrowernumber'}, + $json_infos, + ) if C4::Context->preference("IssueLog"); } if ( $data->{renew_okay} || ( $seen && $data->{error} eq 'too_unseen' ) ) { -- 2.43.0