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

(-)a/Koha/Holds.pm (+7 lines)
Lines 48-53 sub waiting { Link Here
48
    return $self->search( { found => 'W' } );
48
    return $self->search( { found => 'W' } );
49
}
49
}
50
50
51
52
sub processing {
53
    my ( $self ) = @_;
54
55
    return $self->search( { found => 'P' } );
56
}
57
51
=head3 unfilled
58
=head3 unfilled
52
59
53
returns a set of holds that are unfilled from an existing set
60
returns a set of holds that are unfilled from an existing set
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc (-1 / +1 lines)
Lines 61-67 Link Here
61
    to [% Branches.GetName( transfertto ) | html %] since [% transfertwhen | $KohaDates %]</span>
61
    to [% Branches.GetName( transfertto ) | html %] since [% transfertwhen | $KohaDates %]</span>
62
[% END %]
62
[% END %]
63
63
64
[% IF (item.isa('Koha::Item') AND item.holds.waiting.count) OR (NOT item.isa('Koha::Item') AND item.waiting) %]
64
[% IF (item.isa('Koha::Item') AND item.holds.waiting.count) OR (item.isa('Koha::Item') AND item.holds.processing.count) OR (NOT item.isa('Koha::Item') AND item.waiting) OR (NOT item.isa('Koha::Item') AND item.processing) %]
65
    [% SET itemavailable = 0 %]
65
    [% SET itemavailable = 0 %]
66
    <span class="item-status onhold">On hold</span>
66
    <span class="item-status onhold">On hold</span>
67
[% END %]
67
[% END %]
(-)a/opac/opac-basket.pl (+1 lines)
Lines 98-103 foreach my $biblionumber ( @bibs ) { Link Here
98
    foreach my $item (@$items) {
98
    foreach my $item (@$items) {
99
        my $reserve_status = C4::Reserves::GetReserveStatus($item->{itemnumber});
99
        my $reserve_status = C4::Reserves::GetReserveStatus($item->{itemnumber});
100
        if( $reserve_status eq "Waiting"){ $item->{'waiting'} = 1; }
100
        if( $reserve_status eq "Waiting"){ $item->{'waiting'} = 1; }
101
        if( $reserve_status eq "Processing"){ $item->{'processing'} = 1; }
101
    }
102
    }
102
103
103
    my $hasauthors = 0;
104
    my $hasauthors = 0;
(-)a/t/db_dependent/Koha/Holds.t (-2 / +51 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 8;
22
use Test::More tests => 9;
23
use Test::Warn;
23
use Test::Warn;
24
24
25
use C4::Circulation qw( AddIssue );
25
use C4::Circulation qw( AddIssue );
Lines 717-719 subtest 'filter_by_has_cancellation_requests() and filter_out_has_cancellation_r Link Here
717
717
718
    $schema->storage->txn_rollback;
718
    $schema->storage->txn_rollback;
719
};
719
};
720
- 
720
721
subtest 'get holds in processing' => sub {
722
723
    plan tests => 1;
724
725
    $schema->storage->txn_begin;
726
727
    my $patron = $builder->build_object( { class => 'Koha::Patrons' } );
728
729
    my $item = $builder->build_sample_item;
730
731
    my $hold_1 = $builder->build_object(
732
        {
733
            class => 'Koha::Holds',
734
            value => {
735
                found          => 'P',
736
                itemnumber     => $item->id,
737
                biblionumber   => $item->biblionumber,
738
                borrowernumber => $patron->id
739
            }
740
        }
741
    );
742
    my $hold_2 = $builder->build_object(
743
        {
744
            class => 'Koha::Holds',
745
            value => {
746
                found          => undef,
747
                itemnumber     => $item->id,
748
                biblionumber   => $item->biblionumber,
749
                borrowernumber => $patron->id
750
            }
751
        }
752
    );
753
    my $hold_3 = $builder->build_object(
754
        {
755
            class => 'Koha::Holds',
756
            value => {
757
                found          => undef,
758
                itemnumber     => $item->id,
759
                biblionumber   => $item->biblionumber,
760
                borrowernumber => $patron->id
761
            }
762
        }
763
    );
764
765
    my $processing_holds = $item->holds->processing;
766
    is( $processing_holds->count, 1 );
767
768
    $schema->storage->txn_rollback;
769
};

Return to bug 31907