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

(-)a/Koha/Holds.pm (-5 / +8 lines)
Lines 62-68 This method will return 'item' if the patron has Link Here
62
at least one item level hold. It will return 'record'
62
at least one item level hold. It will return 'record'
63
if the patron has holds but none are item level,
63
if the patron has holds but none are item level,
64
Finally, if the patron has no holds, it will return
64
Finally, if the patron has no holds, it will return
65
undef which indicateds the patron may select either
65
undef which indicates the patron may select either
66
record or item level holds, barring any other rules
66
record or item level holds, barring any other rules
67
that would prevent one or the other.
67
that would prevent one or the other.
68
68
Lines 71-79 that would prevent one or the other. Link Here
71
sub forced_hold_level {
71
sub forced_hold_level {
72
    my ($self) = @_;
72
    my ($self) = @_;
73
73
74
    return $self->search( { itemnumber => { '!=' => undef } } )->count()
74
    my $item_level_count = $self->search( { itemnumber => { '!=' => undef } } )->count();
75
      ? 'item'
75
    return 'item' if $item_level_count > 0;
76
      : 'record';
76
77
    my $record_level_count = $self->search( { itemnumber => undef } )->count();
78
    return 'record' if $record_level_count > 0;
79
80
    return undef;
77
}
81
}
78
82
79
=head3 type
83
=head3 type
80
- 

Return to bug 17327