Lines 593-598
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
593 |
$template->param( always_show_holds => $always_show_holds ); |
593 |
$template->param( always_show_holds => $always_show_holds ); |
594 |
my $show_holds_now = $input->param('show_holds_now'); |
594 |
my $show_holds_now = $input->param('show_holds_now'); |
595 |
unless( (defined $always_show_holds && $always_show_holds eq 'DONT') && !$show_holds_now ){ |
595 |
unless( (defined $always_show_holds && $always_show_holds eq 'DONT') && !$show_holds_now ){ |
|
|
596 |
my $holds_count_per_patron = { map { $_->{borrowernumber} => $_->{hold_count} } |
597 |
@{ Koha::Holds->search( { biblionumber=> $biblionumber }, { |
598 |
select => [ "borrowernumber", { count => { distinct => "reserve_id" } } ], |
599 |
as => [ qw( borrowernumber hold_count ) ], |
600 |
group_by => [ qw( borrowernumber ) ] } |
601 |
)->unblessed |
602 |
} }; |
596 |
my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } )->as_list; |
603 |
my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } )->as_list; |
597 |
foreach my $res ( |
604 |
foreach my $res ( |
598 |
sort { |
605 |
sort { |
Lines 643-648
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
643 |
$reserve{non_priority} = $res->non_priority(); |
650 |
$reserve{non_priority} = $res->non_priority(); |
644 |
$reserve{object} = $res; |
651 |
$reserve{object} = $res; |
645 |
|
652 |
|
|
|
653 |
if ( $holds_count_per_patron->{ $reserve{'borrowernumber'} } == 1 ) { |
654 |
$reserve{'change_hold_type_allowed'} = 1; |
655 |
} |
656 |
|
646 |
push( @reserveloop, \%reserve ); |
657 |
push( @reserveloop, \%reserve ); |
647 |
} |
658 |
} |
648 |
} |
659 |
} |
649 |
- |
|
|