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

(-)a/Koha/Hold.pm (-3 / +3 lines)
Lines 224-240 sub is_in_transit { Link Here
224
    return $self->found() eq 'T';
224
    return $self->found() eq 'T';
225
}
225
}
226
226
227
=head3 is_cancelable
227
=head3 is_cancelable_from_opac
228
228
229
Returns true if hold is a cancelable hold
229
Returns true if hold is a cancelable hold
230
230
231
Holds may be only canceled if they are found.
231
Holds may be only canceled if they are not found.
232
232
233
This is used from the OPAC.
233
This is used from the OPAC.
234
234
235
=cut
235
=cut
236
236
237
sub is_cancelable {
237
sub is_cancelable_from_opac {
238
    my ($self) = @_;
238
    my ($self) = @_;
239
239
240
    return 1 unless $self->is_found();
240
    return 1 unless $self->is_found();
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-3 / +3 lines)
Lines 695-701 Using this account is not recommended because some parts of Koha will not functi Link Here
695
                                            </td>
695
                                            </td>
696
                                            [% IF SuspendHoldsOpac %]
696
                                            [% IF SuspendHoldsOpac %]
697
                                                <td>
697
                                                <td>
698
                                                    [% IF ( RESERVE.is_cancelable ) %]
698
                                                    [% IF ( RESERVE.is_cancelable_from_opac ) %]
699
                                                        [% IF RESERVE.suspend %]
699
                                                        [% IF RESERVE.suspend %]
700
                                                            <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
700
                                                            <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
701
                                                                <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
701
                                                                <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
Lines 736-746 Using this account is not recommended because some parts of Koha will not functi Link Here
736
                                                                </form>
736
                                                                </form>
737
                                                            [% END # / IF AutoResumeSuspendedHolds %]
737
                                                            [% END # / IF AutoResumeSuspendedHolds %]
738
                                                        [% END # / IF RESERVE.suspend %]
738
                                                        [% END # / IF RESERVE.suspend %]
739
                                                    [% END # / IF ( RESERVE.is_cancelable )%]
739
                                                    [% END # / IF ( RESERVE.is_cancelable_from_opac )%]
740
                                                </td>
740
                                                </td>
741
                                            [% END # / IF SuspendHoldsOpac %]
741
                                            [% END # / IF SuspendHoldsOpac %]
742
                                            <td class="modify">
742
                                            <td class="modify">
743
                                                [% IF ( RESERVE.is_cancelable ) %]
743
                                                [% IF ( RESERVE.is_cancelable_from_opac ) %]
744
                                                    <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
744
                                                    <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
745
                                                    <input type="hidden" name="biblionumber" value="[% RESERVE.biblionumber %]" />
745
                                                    <input type="hidden" name="biblionumber" value="[% RESERVE.biblionumber %]" />
746
                                                    <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
746
                                                    <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
(-)a/t/db_dependent/Hold.t (-5 / +4 lines)
Lines 121-133 isnt( $hold->is_waiting, 1, 'The hold is not waiting (W)' ); Link Here
121
is( $hold->is_found, 0, 'The hold is not found' );
121
is( $hold->is_found, 0, 'The hold is not found' );
122
ok( !$hold->is_in_transit, 'The hold is not in transit' );
122
ok( !$hold->is_in_transit, 'The hold is not in transit' );
123
123
124
# Test method is_cancelable
124
# Test method is_cancelable_from_opac
125
$hold->found(undef);
125
$hold->found(undef);
126
is( $hold->is_cancelable, 1, "Unfound hold is cancelable" );
126
is( $hold->is_cancelable_from_opac, 1, "Unfound hold is cancelable" );
127
$hold->found('W');
127
$hold->found('W');
128
is( $hold->is_cancelable, 0, "Waiting hold is not cancelable" );
128
is( $hold->is_cancelable_from_opac, 0, "Waiting hold is not cancelable" );
129
$hold->found('T');
129
$hold->found('T');
130
is( $hold->is_cancelable, 0, "In transit hold is not cancelable" );
130
is( $hold->is_cancelable_from_opac, 0, "In transit hold is not cancelable" );
131
131
132
# Test method is_at_destination
132
# Test method is_at_destination
133
$hold->found(undef);
133
$hold->found(undef);
134
- 

Return to bug 18856