View | Details | Raw Unified | Return to bug 18856
Collapse All | Expand All

(-)a/Koha/Hold.pm (-3 / +3 lines)
Lines 223-239 sub is_in_transit { Link Here
223
    return $self->found() eq 'T';
223
    return $self->found() eq 'T';
224
}
224
}
225
225
226
=head3 is_cancelable
226
=head3 is_cancelable_from_opac
227
227
228
Returns true if hold is a cancelable hold
228
Returns true if hold is a cancelable hold
229
229
230
Holds may be only canceled if they are found.
230
Holds may be only canceled if they are not found.
231
231
232
This is used from the OPAC.
232
This is used from the OPAC.
233
233
234
=cut
234
=cut
235
235
236
sub is_cancelable {
236
sub is_cancelable_from_opac {
237
    my ($self) = @_;
237
    my ($self) = @_;
238
238
239
    return 1 unless $self->is_found();
239
    return 1 unless $self->is_found();
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-3 / +3 lines)
Lines 685-691 Link Here
685
                                            </td>
685
                                            </td>
686
                                            [% IF SuspendHoldsOpac %]
686
                                            [% IF SuspendHoldsOpac %]
687
                                                <td>
687
                                                <td>
688
                                                    [% IF ( RESERVE.is_cancelable ) %]
688
                                                    [% IF ( RESERVE.is_cancelable_from_opac ) %]
689
                                                        [% IF RESERVE.suspend %]
689
                                                        [% IF RESERVE.suspend %]
690
                                                            <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
690
                                                            <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
691
                                                                <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
691
                                                                <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
Lines 726-736 Link Here
726
                                                                </form>
726
                                                                </form>
727
                                                            [% END # / IF AutoResumeSuspendedHolds %]
727
                                                            [% END # / IF AutoResumeSuspendedHolds %]
728
                                                        [% END # / IF RESERVE.suspend %]
728
                                                        [% END # / IF RESERVE.suspend %]
729
                                                    [% END # / IF ( RESERVE.is_cancelable )%]
729
                                                    [% END # / IF ( RESERVE.is_cancelable_from_opac )%]
730
                                                </td>
730
                                                </td>
731
                                            [% END # / IF SuspendHoldsOpac %]
731
                                            [% END # / IF SuspendHoldsOpac %]
732
                                            <td class="modify">
732
                                            <td class="modify">
733
                                                [% IF ( RESERVE.is_cancelable ) %]
733
                                                [% IF ( RESERVE.is_cancelable_from_opac ) %]
734
                                                    <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
734
                                                    <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
735
                                                    <input type="hidden" name="biblionumber" value="[% RESERVE.biblionumber %]" />
735
                                                    <input type="hidden" name="biblionumber" value="[% RESERVE.biblionumber %]" />
736
                                                    <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
736
                                                    <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
(-)a/t/db_dependent/Hold.t (-5 / +4 lines)
Lines 124-136 isnt( $hold->is_waiting, 1, 'The hold is not waiting (W)' ); Link Here
124
is( $hold->is_found, 0, 'The hold is not found' );
124
is( $hold->is_found, 0, 'The hold is not found' );
125
ok( !$hold->is_in_transit, 'The hold is not in transit' );
125
ok( !$hold->is_in_transit, 'The hold is not in transit' );
126
126
127
# Test method is_cancelable
127
# Test method is_cancelable_from_opac
128
$hold->found(undef);
128
$hold->found(undef);
129
is( $hold->is_cancelable, 1, "Unfound hold is cancelable" );
129
is( $hold->is_cancelable_from_opac, 1, "Unfound hold is cancelable" );
130
$hold->found('W');
130
$hold->found('W');
131
is( $hold->is_cancelable, 0, "Waiting hold is not cancelable" );
131
is( $hold->is_cancelable_from_opac, 0, "Waiting hold is not cancelable" );
132
$hold->found('T');
132
$hold->found('T');
133
is( $hold->is_cancelable, 0, "In transit hold is not cancelable" );
133
is( $hold->is_cancelable_from_opac, 0, "In transit hold is not cancelable" );
134
134
135
# Test method is_at_destination
135
# Test method is_at_destination
136
$hold->found(undef);
136
$hold->found(undef);
137
- 

Return to bug 18856