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

(-)a/Koha/Hold.pm (-14 lines)
Lines 371-390 sub is_cancelable_from_opac { Link Here
371
    return 0; # if ->is_in_transit or if ->is_waiting or ->is_in_processing
371
    return 0; # if ->is_in_transit or if ->is_waiting or ->is_in_processing
372
}
372
}
373
373
374
=head3 is_at_destination
375
376
Returns true if hold is waiting
377
and the hold's pickup branch matches
378
the hold item's holding branch
379
380
=cut
381
382
sub is_at_destination {
383
    my ($self) = @_;
384
385
    return $self->is_waiting() && ( $self->branchcode() eq $self->item()->holdingbranch() );
386
}
387
388
=head3 biblio
374
=head3 biblio
389
375
390
Returns the related Koha::Biblio object for this hold
376
Returns the related Koha::Biblio object for this hold
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc (-5 / +1 lines)
Lines 38-44 Link Here
38
                    [% UNLESS ( HOLD.is_waiting || HOLD.is_in_transit || HOLD.is_in_processing) %]
38
                    [% UNLESS ( HOLD.is_waiting || HOLD.is_in_transit || HOLD.is_in_processing) %]
39
                        [% SET all_holds_waiting = 0 %]
39
                        [% SET all_holds_waiting = 0 %]
40
                    [% END %]
40
                    [% END %]
41
                    [% IF ( HOLD.is_at_destination ) %]
41
                    [% IF ( HOLD.is_waiting ) %]
42
                        <tr class="reserved">
42
                        <tr class="reserved">
43
                    [% ELSIF HOLD.is_in_transit %]
43
                    [% ELSIF HOLD.is_in_transit %]
44
                        <tr class="transfered">
44
                        <tr class="transfered">
Lines 101-107 Link Here
101
                            <span class="tdlabel">Status:</span>
101
                            <span class="tdlabel">Status:</span>
102
                            [% IF ( HOLD.is_waiting ) %]
102
                            [% IF ( HOLD.is_waiting ) %]
103
                                <i class="fa fa-exclamation-circle text-warning" aria-hidden="true"></i>
103
                                <i class="fa fa-exclamation-circle text-warning" aria-hidden="true"></i>
104
                                [% IF ( HOLD.is_at_destination ) %]
105
                                    Item waiting at <strong> [% HOLD.branch.branchname | html %]</strong>
104
                                    Item waiting at <strong> [% HOLD.branch.branchname | html %]</strong>
106
                                    [% IF ( HOLD.desk_id ) %], [% HOLD.desk.desk_name | html %],[% END %]
105
                                    [% IF ( HOLD.desk_id ) %], [% HOLD.desk.desk_name | html %],[% END %]
107
                                    [% IF ( HOLD.waitingdate ) %]
106
                                    [% IF ( HOLD.waitingdate ) %]
Lines 111-119 Link Here
111
                                        [% END %]
110
                                        [% END %]
112
                                    [% END %]
111
                                    [% END %]
113
                                    <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
112
                                    <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
114
                                [% ELSE %]
115
                                    Item in transit to <strong> [% Branches.GetName( HOLD.branchcode ) | html %]</strong> <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
116
                                [% END %]
117
                            [% ELSE %]
113
                            [% ELSE %]
118
                                [% IF ( HOLD.is_in_transit ) %]
114
                                [% IF ( HOLD.is_in_transit ) %]
119
                                    [% SET transfer = HOLD.item.get_transfer %]
115
                                    [% SET transfer = HOLD.item.get_transfer %]
(-)a/reserve/request.pl (-1 / +1 lines)
Lines 658-664 foreach my $biblionumber (@biblionumbers) { Link Here
658
            $reserve{'wbrcode'}       = $res->branchcode();
658
            $reserve{'wbrcode'}       = $res->branchcode();
659
            $reserve{'itemnumber'}    = $res->itemnumber();
659
            $reserve{'itemnumber'}    = $res->itemnumber();
660
            $reserve{'wbrname'}       = $res->branch()->branchname();
660
            $reserve{'wbrname'}       = $res->branch()->branchname();
661
            $reserve{'atdestination'} = $res->is_at_destination();
661
            $reserve{'atdestination'} = $res->is_waiting();
662
            $reserve{'desk_name'}     = ( $res->desk() ) ? $res->desk()->desk_name() : '' ;
662
            $reserve{'desk_name'}     = ( $res->desk() ) ? $res->desk()->desk_name() : '' ;
663
            $reserve{'found'}     = $res->is_found();
663
            $reserve{'found'}     = $res->is_found();
664
            $reserve{'inprocessing'} = $res->is_in_processing();
664
            $reserve{'inprocessing'} = $res->is_in_processing();
(-)a/t/db_dependent/Hold.t (-11 lines)
Lines 132-147 is( $hold->is_cancelable_from_opac, 0, "In transit hold is not cancelable" ); Link Here
132
$hold->found('P');
132
$hold->found('P');
133
is( $hold->is_cancelable_from_opac, 0, "In processing hold is not cancelable" );
133
is( $hold->is_cancelable_from_opac, 0, "In processing hold is not cancelable" );
134
134
135
# Test method is_at_destination
136
$hold->found(undef);
137
ok( !$hold->is_at_destination(), "Unfound hold cannot be at destination" );
138
$hold->found('T');
139
ok( !$hold->is_at_destination(), "In transit hold cannot be at destination" );
140
$hold->found('W');
141
ok( !$hold->is_at_destination(), "Waiting hold where hold branchcode is not the same as the item's holdingbranch is not at destination" );
142
$item->holdingbranch( $branches[1]->{branchcode} );
143
ok( $hold->is_at_destination(), "Waiting hold where hold branchcode is the same as the item's holdingbranch is at destination" );
144
145
$schema->storage->txn_rollback();
135
$schema->storage->txn_rollback();
146
136
147
subtest "delete() tests" => sub {
137
subtest "delete() tests" => sub {
148
- 

Return to bug 27879