From b66a684c2f28aaac20db52c19ec83fc685e0e6a2 Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Tue, 5 Aug 2025 12:31:11 +0000 Subject: [PATCH] Bug 9762: (follow-up) Add branchcode to Log circulation and add some override confirmations in action logs, fix typos --- C4/Circulation.pm | 3 ++- circ/circulation.pl | 3 ++- .../prog/en/includes/action-logs.inc | 20 +++++++++++++++++-- .../prog/en/modules/tools/viewlog.tt | 6 +++--- svc/renew | 5 ++++- tools/viewlog.pl | 1 + 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 8f7b19600d2..50e529efe64 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1987,6 +1987,7 @@ sub AddIssue { $info = to_json( { issue => $issue->issue_id, + branchcode => $issue->branchcode, itemnumber => $item_object->itemnumber, confirmations => $confirmations, forced => $forced @@ -3644,7 +3645,7 @@ sub AddRenewal { }, { pretty => 1, - cononical => 1 + canonical => 1 } ); } diff --git a/circ/circulation.pl b/circ/circulation.pl index 7692d953c4b..f2413d27665 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -444,7 +444,7 @@ if ( @$barcodes && $op eq 'cud-checkout' ) { } } - delete $needsconfirmation->{'DEBT'} if ($debt_confirmed); + my $needsconfirmationDEBT = delete $needsconfirmation->{'DEBT'} if ($debt_confirmed); if ( $item && C4::Context->preference('ClaimReturnedLostValue') ) { my $autoClaimReturnCheckout = C4::Context->preference('AutoClaimReturnStatusOnCheckout'); @@ -547,6 +547,7 @@ if ( @$barcodes && $op eq 'cud-checkout' ) { if ( my $booked = $needsconfirmation->{BOOKED_EARLY} // $alerts->{BOOKED} ) { $datedue = $booked->end_date; } + $needsconfirmation->{'DEBT'} = $needsconfirmationDEBT if ($debt_confirmed); my $issue = AddIssue( $patron, $barcode, $datedue, $cancelreserve, diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc index 17d1dfc4b3a..a1f62a8dd46 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/action-logs.inc @@ -196,7 +196,7 @@ [% CASE 'PATRON_CANT' %] Max renewals reached [% CASE 'TOO_MANY' %] - Max renewals reached + Too many checkout [% CASE 'PREVISSUE' %] Patron was notified of previous issues [% CASE 'NOT_FOR_LOAN' %] @@ -224,11 +224,27 @@ [% CASE 'BOOKED_TO_ANOTHER' %] Item was booked to another patron [% CASE 'AGE_RESTRICTION' %] - Item has an eage restriction + Item has an age restriction [% CASE 'HIGHHOLDS' %] Item had high holds [% CASE 'BIBLIO_ALREADY_ISSUED' %] Biblio was already issued + [% CASE 'DEBARRED' %] + Patron is restricted + [% CASE 'RENEWAL_LIMIT' %] + Renewal limit override + [% CASE 'UNSEEN_LIMIT' %] + Override unseen item restriction + [% CASE 'AUTO_TOO_SOON' %] + Override auto-renew too soon restriction + [% CASE 'AUTO_TOO_LATE' %] + Override auto-renew too late restriction + [% CASE 'ACCOUNT_EXPIRED' %] + Account expired overrideOverride Renew hold for another + [% CASE 'TOO_MUCH' %] + Override auto-renew too much owing restriction [% CASE %] [% override | html %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt index dad15809ff9..6cf551f4e45 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -339,11 +339,11 @@ Item [% loopro.json.barcode | html %]Item [% loopro.json.barcode | html %] [% loopro.json.branchcode | html %] - [% FOREACH force IN loopro.json.forces %] -
[% PROCESS translare_log_override override=force %]
+ [% FOREACH force IN loopro.json.forced %] +
[% PROCESS translate_log_override override=force %]
[% END %] [% FOREACH confirmation IN loopro.json.confirmations %]
[% PROCESS translate_log_override override=confirmation %]
diff --git a/svc/renew b/svc/renew index 9f0543268dd..a2877d5f7fa 100755 --- a/svc/renew +++ b/svc/renew @@ -67,6 +67,7 @@ $data->{branchcode} = $branchcode; my $patron = Koha::Patrons->find($borrowernumber); my $item = Koha::Items->find($itemnumber); +my $confirmations; ( $data->{renew_okay}, $data->{error} ) = CanBookBeRenewed( $patron, $item->checkout, $override_limit ); @@ -75,6 +76,7 @@ if ( $data->{error} && $data->{error} eq 'on_reserve' && C4::Context->preference $data->{renew_okay} = 1; $data->{error} = undef; + push @{$confirmations}, 'ON_RESERVE' if $override_limit; $message = "Override Renew hold for another"; @message = ("Override Renew hold for another"); @@ -133,7 +135,8 @@ if ( $data->{renew_okay} || ( $seen && $data->{error} eq 'too_unseen' ) ) { itemnumber => $itemnumber, branch => $branchcode, datedue => $date_due, - seen => $seen + seen => $seen, + confirmations => $confirmations } ); $data->{date_due} = output_pref( { dt => $date_due, as_due_date => 1 } ); diff --git a/tools/viewlog.pl b/tools/viewlog.pl index 5d5341168f4..2655b2e8fbb 100755 --- a/tools/viewlog.pl +++ b/tools/viewlog.pl @@ -181,6 +181,7 @@ if ($do_it) { $decoded->{biblionumber} = $item->biblionumber; $decoded->{biblioitemnumber} = $item->biblionumber; $decoded->{barcode} = $item->barcode; + $decoded->{branchcode} = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; } $result->{'json'} = $decoded; } else { -- 2.34.1