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