From ea2b7cc3627f08ed7da03abdd45c7d4cdd8da14d 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 --- 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 35f8e173f3a..02ee66317eb 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 033a4cff694..5ac68c2ea2d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt @@ -650,8 +650,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> @@ -690,8 +690,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 75ea7399dad..3ed6fc12cf9 100755 --- a/t/db_dependent/ILSDI_Services.t +++ b/t/db_dependent/ILSDI_Services.t @@ -179,8 +179,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 @@ -188,8 +188,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; @@ -204,16 +204,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.30.2