From a63fd09475e7c4b299e1f87ccba812d0fe017047 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 3 Nov 2023 16:43:47 +0000 Subject: [PATCH] Bug 21284: (QA follow-up) Rename itemonhold and recordonhold Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 37c8cf6e34de8db5a3147ffed9cfa96e075080f1) Signed-off-by: Fridolin Somers --- C4/ILSDI/Services.pm | 4 ++-- .../opac-tmpl/bootstrap/en/modules/ilsdi.tt | 8 ++++---- t/db_dependent/ILSDI_Services.t | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 8ed86b61b5..2fcfcafdbb 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -531,10 +531,10 @@ sub GetPatronInfo { delete $issue->{'more_subfields_xml'}; # Is the item already on hold by another user? - $issue->{'itemonhold'} = Koha::Holds->search({ itemnumber => $issue->{'itemnumber'} })->count; + $issue->{'holds_on_item'} = Koha::Holds->search({ itemnumber => $issue->{'itemnumber'} })->count; # Is the record (next available item) on hold by another user? - $issue->{'recordonhold'} = Koha::Holds->search({ biblionumber => $issue->{'biblionumber'} })->count; + $issue->{'holds_on_record'} = Koha::Holds->search({ biblionumber => $issue->{'biblionumber'} })->count; push @checkouts, $issue } diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt index 551fda9a37..6c1cca0077 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt @@ -602,8 +602,8 @@ <location>Salle de lecture</location> <itemlost>0</itemlost> <publicationyear>1985</publicationyear> - <recordonhold>0</recordonhold> - <itemonhold>0</itemonhold> + <holds_on_record>0</holds_on_record> + <holds_on_item>0</holds_on_item> <issues>1</issues> <homebranch>BIB</homebranch> <holdingbranch>BIB</holdingbranch> @@ -642,8 +642,8 @@ <location>Salle de lecture</location> <itemlost>0</itemlost> <publicationyear>2007</publicationyear> - <recordonhold>1</recordonhold> - <itemonhold>1</itemonhold> + <holds_on_record>1</holds_on_record> + <holds_on_item>1</holds_on_item> <issues>1</issues> <homebranch>BIB</homebranch> <holdingbranch>BIB</holdingbranch> diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t index 0b2003c17b..52b80558fd 100755 --- a/t/db_dependent/ILSDI_Services.t +++ b/t/db_dependent/ILSDI_Services.t @@ -178,8 +178,8 @@ subtest 'GetPatronInfo test for holds' => sub { my $reply = C4::ILSDI::Services::GetPatronInfo( $query ); # Check that this loan is not on hold - is ( $reply->{loans}->{loan}[0]->{recordonhold}, "0", "Record is not on hold"); - is ( $reply->{loans}->{loan}[0]->{itemonhold}, "0", "Item is not on hold"); + is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "0", "Record is not on hold"); + is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "0", "Item is not on hold"); # Place a loan # Add a hold on the biblio @@ -187,8 +187,8 @@ subtest 'GetPatronInfo test for holds' => sub { # Check that it is on hold on biblio level $reply = C4::ILSDI::Services::GetPatronInfo( $query ); - is ( $reply->{loans}->{loan}[0]->{recordonhold}, "1", "Record is on hold"); - is ( $reply->{loans}->{loan}[0]->{itemonhold}, "0", "Item is on hold"); + is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "1", "Record is on hold"); + is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "0", "Item is on hold"); # Delete holds $schema->resultset( 'Reserve' )->delete_all; @@ -203,16 +203,16 @@ subtest 'GetPatronInfo test for holds' => sub { # When a specific item has a reserve, the item is on hold as well as the record $reply = C4::ILSDI::Services::GetPatronInfo( $query ); - is ( $reply->{loans}->{loan}[0]->{recordonhold}, "1", "Record is on hold"); - is ( $reply->{loans}->{loan}[0]->{itemonhold}, "1", "Item is on hold"); + is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "1", "Record is on hold"); + is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "1", "Item is on hold"); # Add another hold on the biblio $biblioreserve = AddReserve({ branchcode => $library->branchcode, borrowernumber => $brwr3->borrowernumber, biblionumber => $biblio->biblionumber }); # Check that there are 2 holds on the biblio and 1 on this specific item $reply = C4::ILSDI::Services::GetPatronInfo( $query ); - is ( $reply->{loans}->{loan}[0]->{recordonhold}, "2", "Record is on hold twice"); - is ( $reply->{loans}->{loan}[0]->{itemonhold}, "1", "Item is on hold"); + is ( $reply->{loans}->{loan}[0]->{holds_on_record}, "2", "Record is on hold twice"); + is ( $reply->{loans}->{loan}[0]->{holds_on_item}, "1", "Item is on hold"); # Cleanup $schema->storage->txn_rollback; -- 2.39.5