From a3c922c2a1b8f24f0348480869904eccb2160079 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Fri, 12 Jan 2018 09:51:45 +0000 Subject: [PATCH] Bug 4319: (QA follow-up) Rename hasItemswaitingOrInTransit to has_items_waiting_or_intransit and udate pod Signed-off-by: Jonathan Druart --- Koha/Biblio.pm | 8 ++++++-- opac/opac-ISBDdetail.pl | 2 +- opac/opac-MARCdetail.pl | 2 +- opac/opac-detail.pl | 2 +- t/db_dependent/Koha/Biblios.t | 8 ++++---- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 9a4937da49..a35048d21b 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -318,11 +318,15 @@ sub subscriptions { return $self->{_subscriptions}; } -=head3 hasItemswaitingOrInTransit +=head3 has_items_waiting_or_intransit + +my $itemsWaitingOrInTransit = $biblio->has_items_waiting_or_intransit + +Tells if this bibliographic record has items waiting or in transit. =cut -sub hasItemswaitingOrInTransit { +sub has_items_waiting_or_intransit { my ( $self ) = @_; if ( Koha::Holds->search({ biblionumber => $self->id, diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index d9447cc72e..b4353ba6ff 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -181,7 +181,7 @@ for my $itm (@items) { unless $allow_onshelf_holds; } -if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->hasItemswaitingOrInTransit ) { +if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { $template->param( ReservableItems => 1 ); } diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index 90b2974914..609d9d964e 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -136,7 +136,7 @@ for my $itm (@all_items) { last if $allow_onshelf_holds; } -if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->hasItemswaitingOrInTransit ) { +if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { $template->param( ReservableItems => 1 ); } diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 9a1177e32e..ea7d04594b 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -719,7 +719,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { } } -if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->hasItemswaitingOrInTransit ) { +if( $allow_onshelf_holds || CountItemsIssued($biblionumber) || $biblio->has_items_waiting_or_intransit ) { $template->param( ReservableItems => 1 ); } diff --git a/t/db_dependent/Koha/Biblios.t b/t/db_dependent/Koha/Biblios.t index 9d4153138b..2f807b1254 100644 --- a/t/db_dependent/Koha/Biblios.t +++ b/t/db_dependent/Koha/Biblios.t @@ -100,13 +100,13 @@ subtest 'waiting_or_in_transit' => sub { $reserve = Koha::Holds->find($reserve->{reserve_id}); $biblio = Koha::Biblios->find($biblio->{biblionumber}); - is($biblio->hasItemswaitingOrInTransit, 0, 'Item is neither waiting nor in transit'); + is($biblio->has_items_waiting_or_intransit, 0, 'Item is neither waiting nor in transit'); $reserve->found('W')->store; - is($biblio->hasItemswaitingOrInTransit, 1, 'Item is waiting'); + is($biblio->has_items_waiting_or_intransit, 1, 'Item is waiting'); $reserve->found('T')->store; - is($biblio->hasItemswaitingOrInTransit, 1, 'Item is in transit'); + is($biblio->has_items_waiting_or_intransit, 1, 'Item is in transit'); my $transfer = $builder->build({ source => 'Branchtransfer', @@ -117,7 +117,7 @@ subtest 'waiting_or_in_transit' => sub { }); my $t = Koha::Database->new()->schema()->resultset( 'Branchtransfer' )->find($transfer->{branchtransfer_id}); $reserve->found(undef)->store; - is($biblio->hasItemswaitingOrInTransit, 1, 'Item has transfer'); + is($biblio->has_items_waiting_or_intransit, 1, 'Item has transfer'); }; $schema->storage->txn_rollback; -- 2.39.5