From 1cb0147affce54f19004173456ff2f8027767b30 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 11 Jan 2018 09:44:08 -0500 Subject: [PATCH] Bug 18856: (QA follow-up) Rename method to avoid confusion Signed-off-by: Kyle M Hall Signed-off-by: Marcel de Rooy Hmm. I would have liked the opac parameter even better ;) Signed-off-by: Jonathan Druart --- Koha/Hold.pm | 6 +++--- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 6 +++--- t/db_dependent/Hold.t | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Koha/Hold.pm b/Koha/Hold.pm index 4ddd8be76d..23d5d447a5 100644 --- a/Koha/Hold.pm +++ b/Koha/Hold.pm @@ -223,17 +223,17 @@ sub is_in_transit { return $self->found() eq 'T'; } -=head3 is_cancelable +=head3 is_cancelable_from_opac Returns true if hold is a cancelable hold -Holds may be only canceled if they are found. +Holds may be only canceled if they are not found. This is used from the OPAC. =cut -sub is_cancelable { +sub is_cancelable_from_opac { my ($self) = @_; return 1 unless $self->is_found(); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 6604cb65ea..ad048d0915 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -685,7 +685,7 @@ [% IF SuspendHoldsOpac %] - [% IF ( RESERVE.is_cancelable ) %] + [% IF ( RESERVE.is_cancelable_from_opac ) %] [% IF RESERVE.suspend %]
@@ -726,11 +726,11 @@
[% END # / IF AutoResumeSuspendedHolds %] [% END # / IF RESERVE.suspend %] - [% END # / IF ( RESERVE.is_cancelable )%] + [% END # / IF ( RESERVE.is_cancelable_from_opac )%] [% END # / IF SuspendHoldsOpac %] - [% IF ( RESERVE.is_cancelable ) %] + [% IF ( RESERVE.is_cancelable_from_opac ) %]
diff --git a/t/db_dependent/Hold.t b/t/db_dependent/Hold.t index 635b9b5bd7..4258ba392e 100755 --- a/t/db_dependent/Hold.t +++ b/t/db_dependent/Hold.t @@ -124,13 +124,13 @@ isnt( $hold->is_waiting, 1, 'The hold is not waiting (W)' ); is( $hold->is_found, 0, 'The hold is not found' ); ok( !$hold->is_in_transit, 'The hold is not in transit' ); -# Test method is_cancelable +# Test method is_cancelable_from_opac $hold->found(undef); -is( $hold->is_cancelable, 1, "Unfound hold is cancelable" ); +is( $hold->is_cancelable_from_opac, 1, "Unfound hold is cancelable" ); $hold->found('W'); -is( $hold->is_cancelable, 0, "Waiting hold is not cancelable" ); +is( $hold->is_cancelable_from_opac, 0, "Waiting hold is not cancelable" ); $hold->found('T'); -is( $hold->is_cancelable, 0, "In transit hold is not cancelable" ); +is( $hold->is_cancelable_from_opac, 0, "In transit hold is not cancelable" ); # Test method is_at_destination $hold->found(undef); -- 2.39.5