From f728b9599d3abec88ab63982d6dd2d9e0eca3fce Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Tue, 17 Oct 2023 15:48:16 +0000
Subject: [PATCH] Bug 22632: (follow-up) Use PATRON_MERGE as log action

Signed-off-by: David Nind <david@davidnind.com>
---
 Koha/Patron.pm                                           | 2 +-
 koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt | 4 ++--
 t/db_dependent/Koha/Patron/Log.t                         | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Koha/Patron.pm b/Koha/Patron.pm
index 1c3233c3e2..9988fb8cde 100644
--- a/Koha/Patron.pm
+++ b/Koha/Patron.pm
@@ -679,7 +679,7 @@ sub merge_with {
 
             if (C4::Context->preference("BorrowersLog")){
                 my $info = $patron->firstname. " " . $patron->surname . " (".$patron->cardnumber . ")". " has been merged into " . $self->firstname . " " . $self->surname . " (".$self->cardnumber . ")" ;
-                logaction("MEMBERS", "Merge", $self->id, $info );
+                logaction("MEMBERS", "PATRON_MERGE", $self->id, $info );
             }
         }
     });
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 cf8dd816ac..2034fdcf34 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
@@ -146,7 +146,7 @@
 [%        CASE 'DELETE_FUND' %]<span>Delete a fund</span>
 [%        CASE 'Run'    %]<span>Run</span>
 [%        CASE 'End'    %]<span>End</span>
-[%        CASE 'Merge'    %]<span>Merge</span>
+[%        CASE 'PATRON_MERGE'    %]<span>Merge</span>
 [%        CASE 'EDIT_MAPPINGS' %]<span>Edit mappings</span>
 [%        CASE 'RESET_MAPPINGS' %]<span>Reset mappings</span>
 [%        CASE 'SERIAL CLAIM' %]<span>Serial claim</span>
@@ -239,7 +239,7 @@
                                         <label for="actionALL" class="viewlog"><input type="checkbox" id="actionALL" name="actions" value=""> All</label>
                                     [% END %]
 
-                                    [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'FILL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'MODCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'PATRON_NOTICE' 'CHANGE PASS' 'Run' 'End' 'Merge' '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' 'ACQUISITION CLAIM' 'ACQUISITION ORDER' 'OVERDUE' 'EXPIRE' ] %]
+                                    [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'FILL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'MODCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'PATRON_NOTICE' 'CHANGE PASS' 'Run' 'End' 'PATRON_MERGE' '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' 'ACQUISITION CLAIM' 'ACQUISITION ORDER' 'OVERDUE' 'EXPIRE' ] %]
                                         [% IF actions.grep(actx).size %]
                                             <label for="action[% actx| replace('\s+', '_') | html %]" class="viewlog"><input type="checkbox" id="action[% actx | replace('\s+', '_') | html %]" name="actions" value="[% actx | html %]" checked="checked"> [% PROCESS translate_log_action action=actx %]</label>
                                         [% ELSE %]
diff --git a/t/db_dependent/Koha/Patron/Log.t b/t/db_dependent/Koha/Patron/Log.t
index 5ffb02d84f..02ff9602ee 100644
--- a/t/db_dependent/Koha/Patron/Log.t
+++ b/t/db_dependent/Koha/Patron/Log.t
@@ -41,7 +41,7 @@ subtest 'Test Koha::Patrons::merge' => sub {
 
     my $results = $keeper->merge_with([ $borrower1->{borrowernumber}, $borrower2->{borrowernumber} ]);
 
-    my $log=GetLogs("","","",["MEMBERS"],["Merge"],$keeper->id,"");
+    my $log=GetLogs("","","",["MEMBERS"],["PATRON_MERGE"],$keeper->id,"");
 
     my $info_borrower1 = $borrower1->{firstname} . " " . $borrower1->{surname} . " (" . $borrower1->{cardnumber} . ") has been merged into " .
     $keeper->firstname . " " . $keeper->surname . " (" . $keeper->cardnumber . ")";
@@ -63,7 +63,7 @@ subtest 'Test Koha::Patrons::merge' => sub {
 
     $results = $keeper->merge_with([ $borrower3->{borrowernumber}, $borrower4->{borrowernumber} ]);
 
-    $log=GetLogs("","","",["MEMBERS"],["Merge"],$keeper->id,"");
+    $log=GetLogs("","","",["MEMBERS"],["PATRON_MERGE"],$keeper->id,"");
     $info_log = $log->[0]{info};
 
     is($info_log,undef,"GetLogs didn't returns results in the log viewer for the merge of " . $borrower3->{borrowernumber});
@@ -73,4 +73,4 @@ subtest 'Test Koha::Patrons::merge' => sub {
     is($info_log,undef,"GetLogs didn't returns results in the log viewer for the merge of " . $borrower4->{borrowernumber});
 };
 
-$schema->storage->txn_rollback;
\ No newline at end of file
+$schema->storage->txn_rollback;
-- 
2.30.2