From 28652a8ce4cda1ad6f2c5bfb3752e752d8102feb Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 6 Jun 2022 23:52:59 +0000 Subject: [PATCH] Bug 30823: Filling recalls uses 'FILL' action in action logs This enhancement changes recall fulfillment actions to log with the FILL action. It will also update existing recalls FULFILL actions in the database to use the FILL action. To test: 1) Enable the UseRecalls system preference and set up your recalls-related circulation rules. Confirm RecallsLog is enabled. 2) Check out an item to Patron B. 3) Log into the OPAC as Patron A and search for the item. 4) Place a recall on that item. 5) Go back to the staff client and check the item in. Confirm the recall as waiting for Patron A. 6) Check out the item for Patron A to fill the recall. 7) Go to Tools -> Log Viewer. Confirm there is a FULFILL action. Choose the following search params to browse system logs: - modules: recalls - actions: fill 8) Submit the search and confirm the recall DOES NOT show. 9) Apply the patch, update database, restart services. 10) Refresh the log viewer and repeat step 7. Submit the search and confirm the recall DOES show. Confirm there is no longer a FULFILL action as both holds and recalls will use FILL. 11) Check in the item. 12) Repeat steps 2-6. We are ensuring that future recalls are logged using the FILL action. 13) Repeat step 7. Confirm all test recalls are now showing in search results. Sponsored-by: Catalyst IT --- Koha/Recall.pm | 2 +- .../bug_30823_-_update_recalls_FULFILL_actions.pl | 12 ++++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt | 3 +-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_30823_-_update_recalls_FULFILL_actions.pl diff --git a/Koha/Recall.pm b/Koha/Recall.pm index a97e741b64..c993bb7fda 100644 --- a/Koha/Recall.pm +++ b/Koha/Recall.pm @@ -457,7 +457,7 @@ Set a recall as finished. This should only be called when the item allocated to sub set_fulfilled { my ( $self ) = @_; $self->update({ status => 'fulfilled', completed => 1, completed_date => dt_from_string }); - C4::Log::logaction( 'RECALLS', 'FULFILL', $self->id, "Recall fulfilled", 'INTRANET' ) if ( C4::Context->preference('RecallsLog') ); + C4::Log::logaction( 'RECALLS', 'FILL', $self->id, "Recall fulfilled", 'INTRANET' ) if ( C4::Context->preference('RecallsLog') ); return $self; } diff --git a/installer/data/mysql/atomicupdate/bug_30823_-_update_recalls_FULFILL_actions.pl b/installer/data/mysql/atomicupdate/bug_30823_-_update_recalls_FULFILL_actions.pl new file mode 100644 index 0000000000..71cc07a352 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30823_-_update_recalls_FULFILL_actions.pl @@ -0,0 +1,12 @@ +use Modern::Perl; + +return { + bug_number => "30823", + description => "Replace recalls FULFILL actions with FILL in action logs", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{ UPDATE action_logs SET action = 'FILL' WHERE action = 'FULFILL' AND module = 'RECALLS' }); + }, +}; 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 a5881d04a5..f9dbea05cd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -145,7 +145,6 @@ [% CASE 'SERIAL CLAIM' %]Serial claim [% CASE 'ACQUISITION CLAIM' %]Acquisition claim [% CASE 'ACQUISITION ORDER' %]Acquisition order -[% CASE 'FULFILL' %]Fulfill [% CASE 'OVERDUE' %]Overdue [% CASE 'EXPIRE' %]Expire [% CASE %][% action | html %] @@ -240,7 +239,7 @@ [% END %] - [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'FILL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'PATRON_NOTICE' 'CHANGE PASS' 'Run' 'EDIT_MAPPINGS' 'RESET_MAPPINGS' 'ADD_BASKET' 'MODIFY_BASKET' 'MODIFY_BASKET_HEADER' 'MODIFY_BASKET_USERS' 'CLOSE_BASKET' 'APPROVE_BASKET' 'REOPEN_BASKET' 'CANCEL_ORDER' 'CREATE_ORDER' 'MODIFY_ORDER' 'CREATE_INVOICE_ADJUSTMENT' 'UPDATE_INVOICE_ADJUSTMENT' 'DELETE_INVOICE_ADJUSTMENT' 'RECEIVE_ORDER' 'MODIFY_BUDGET' 'MODIFY_FUND' 'CREATE_FUND' 'DELETE_FUND' 'OVERDUE' 'EXPIRE' 'FULFILL' ] %] + [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'FILL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'PATRON_NOTICE' 'CHANGE PASS' 'Run' 'EDIT_MAPPINGS' 'RESET_MAPPINGS' 'ADD_BASKET' 'MODIFY_BASKET' 'MODIFY_BASKET_HEADER' 'MODIFY_BASKET_USERS' 'CLOSE_BASKET' 'APPROVE_BASKET' 'REOPEN_BASKET' 'CANCEL_ORDER' 'CREATE_ORDER' 'MODIFY_ORDER' 'CREATE_INVOICE_ADJUSTMENT' 'UPDATE_INVOICE_ADJUSTMENT' 'DELETE_INVOICE_ADJUSTMENT' 'RECEIVE_ORDER' 'MODIFY_BUDGET' 'MODIFY_FUND' 'CREATE_FUND' 'DELETE_FUND' 'OVERDUE' 'EXPIRE' ] %] [% IF actions.grep(actx).size %] [% ELSE %] -- 2.11.0