@@ -, +, @@ --- 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(-) --- a/Koha/Hold.pm +++ a/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(); --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ a/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 ) %]
--- a/t/db_dependent/Hold.t +++ a/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); --