Lines 678-734
if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold )
Link Here
|
678 |
|
678 |
|
679 |
# existingreserves building |
679 |
# existingreserves building |
680 |
my @reserveloop; |
680 |
my @reserveloop; |
681 |
my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } ); |
681 |
my $always_show_holds = $input->cookie('always_show_holds'); |
682 |
foreach my $res ( |
682 |
$template->param( always_show_holds => $always_show_holds ); |
683 |
sort { |
683 |
my $show_holds_now = $input->param('show_holds_now'); |
684 |
my $a_found = $a->found() || ''; |
684 |
unless( (defined $always_show_holds && $always_show_holds eq 'DONT') && !$show_holds_now ){ |
685 |
my $b_found = $a->found() || ''; |
685 |
my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } ); |
686 |
$a_found cmp $b_found; |
686 |
foreach my $res ( |
687 |
} @reserves |
687 |
sort { |
688 |
) |
688 |
my $a_found = $a->found() || ''; |
689 |
{ |
689 |
my $b_found = $a->found() || ''; |
690 |
my %reserve; |
690 |
$a_found cmp $b_found; |
691 |
if ( $res->is_found() ) { |
691 |
} @reserves |
692 |
$reserve{'holdingbranch'} = $res->item()->holdingbranch(); |
692 |
) |
693 |
$reserve{'biblionumber'} = $res->item()->biblionumber(); |
693 |
{ |
694 |
$reserve{'barcodenumber'} = $res->item()->barcode(); |
694 |
my %reserve; |
695 |
$reserve{'wbrcode'} = $res->branchcode(); |
695 |
if ( $res->is_found() ) { |
696 |
$reserve{'itemnumber'} = $res->itemnumber(); |
696 |
$reserve{'holdingbranch'} = $res->item()->holdingbranch(); |
697 |
$reserve{'wbrname'} = $res->branch()->branchname(); |
697 |
$reserve{'biblionumber'} = $res->item()->biblionumber(); |
698 |
$reserve{'atdestination'} = $res->is_at_destination(); |
698 |
$reserve{'barcodenumber'} = $res->item()->barcode(); |
699 |
$reserve{'desk_name'} = ( $res->desk() ) ? $res->desk()->desk_name() : '' ; |
699 |
$reserve{'wbrcode'} = $res->branchcode(); |
700 |
$reserve{'found'} = $res->is_found(); |
700 |
$reserve{'itemnumber'} = $res->itemnumber(); |
701 |
$reserve{'inprocessing'} = $res->is_in_processing(); |
701 |
$reserve{'wbrname'} = $res->branch()->branchname(); |
702 |
$reserve{'intransit'} = $res->is_in_transit(); |
702 |
$reserve{'atdestination'} = $res->is_at_destination(); |
703 |
} |
703 |
$reserve{'desk_name'} = ( $res->desk() ) ? $res->desk()->desk_name() : '' ; |
704 |
elsif ( $res->priority() > 0 ) { |
704 |
$reserve{'found'} = $res->is_found(); |
705 |
if ( my $item = $res->item() ) { |
705 |
$reserve{'inprocessing'} = $res->is_in_processing(); |
706 |
$reserve{'itemnumber'} = $item->id(); |
706 |
$reserve{'intransit'} = $res->is_in_transit(); |
707 |
$reserve{'barcodenumber'} = $item->barcode(); |
707 |
} |
708 |
$reserve{'item_level_hold'} = 1; |
708 |
elsif ( $res->priority() > 0 ) { |
|
|
709 |
if ( my $item = $res->item() ) { |
710 |
$reserve{'itemnumber'} = $item->id(); |
711 |
$reserve{'barcodenumber'} = $item->barcode(); |
712 |
$reserve{'item_level_hold'} = 1; |
713 |
} |
709 |
} |
714 |
} |
710 |
} |
|
|
711 |
|
715 |
|
712 |
$reserve{'expirationdate'} = $res->expirationdate; |
716 |
$reserve{'expirationdate'} = $res->expirationdate; |
713 |
$reserve{'date'} = $res->reservedate; |
717 |
$reserve{'date'} = $res->reservedate; |
714 |
$reserve{'borrowernumber'} = $res->borrowernumber(); |
718 |
$reserve{'borrowernumber'} = $res->borrowernumber(); |
715 |
$reserve{'biblionumber'} = $res->biblionumber(); |
719 |
$reserve{'biblionumber'} = $res->biblionumber(); |
716 |
$reserve{'patron'} = $res->borrower; |
720 |
$reserve{'patron'} = $res->borrower; |
717 |
$reserve{'notes'} = $res->reservenotes(); |
721 |
$reserve{'notes'} = $res->reservenotes(); |
718 |
$reserve{'waiting_date'} = $res->waitingdate(); |
722 |
$reserve{'waiting_date'} = $res->waitingdate(); |
719 |
$reserve{'ccode'} = $res->item() ? $res->item()->ccode() : undef; |
723 |
$reserve{'ccode'} = $res->item() ? $res->item()->ccode() : undef; |
720 |
$reserve{'barcode'} = $res->item() ? $res->item()->barcode() : undef; |
724 |
$reserve{'barcode'} = $res->item() ? $res->item()->barcode() : undef; |
721 |
$reserve{'priority'} = $res->priority(); |
725 |
$reserve{'priority'} = $res->priority(); |
722 |
$reserve{'lowestPriority'} = $res->lowestPriority(); |
726 |
$reserve{'lowestPriority'} = $res->lowestPriority(); |
723 |
$reserve{'suspend'} = $res->suspend(); |
727 |
$reserve{'suspend'} = $res->suspend(); |
724 |
$reserve{'suspend_until'} = $res->suspend_until(); |
728 |
$reserve{'suspend_until'} = $res->suspend_until(); |
725 |
$reserve{'reserve_id'} = $res->reserve_id(); |
729 |
$reserve{'reserve_id'} = $res->reserve_id(); |
726 |
$reserve{itemtype} = $res->itemtype(); |
730 |
$reserve{itemtype} = $res->itemtype(); |
727 |
$reserve{branchcode} = $res->branchcode(); |
731 |
$reserve{branchcode} = $res->branchcode(); |
728 |
$reserve{non_priority} = $res->non_priority(); |
732 |
$reserve{non_priority} = $res->non_priority(); |
729 |
$reserve{object} = $res; |
733 |
$reserve{object} = $res; |
730 |
|
734 |
|
731 |
push( @reserveloop, \%reserve ); |
735 |
push( @reserveloop, \%reserve ); |
|
|
736 |
} |
732 |
} |
737 |
} |
733 |
|
738 |
|
734 |
# get the time for the form name... |
739 |
# get the time for the form name... |
735 |
- |
|
|