Lines 635-691
foreach my $biblionumber (@biblionumbers) {
Link Here
|
635 |
|
635 |
|
636 |
# existingreserves building |
636 |
# existingreserves building |
637 |
my @reserveloop; |
637 |
my @reserveloop; |
638 |
my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } ); |
638 |
my $always_show_holds = $input->cookie('always_show_holds'); |
639 |
foreach my $res ( |
639 |
$template->param( always_show_holds => $always_show_holds ); |
640 |
sort { |
640 |
my $show_holds_now = $input->param('show_holds_now'); |
641 |
my $a_found = $a->found() || ''; |
641 |
unless( (defined $always_show_holds && $always_show_holds eq 'DONT') && !$show_holds_now ){ |
642 |
my $b_found = $a->found() || ''; |
642 |
my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } ); |
643 |
$a_found cmp $b_found; |
643 |
foreach my $res ( |
644 |
} @reserves |
644 |
sort { |
645 |
) |
645 |
my $a_found = $a->found() || ''; |
646 |
{ |
646 |
my $b_found = $a->found() || ''; |
647 |
my %reserve; |
647 |
$a_found cmp $b_found; |
648 |
if ( $res->is_found() ) { |
648 |
} @reserves |
649 |
$reserve{'holdingbranch'} = $res->item()->holdingbranch(); |
649 |
) |
650 |
$reserve{'biblionumber'} = $res->item()->biblionumber(); |
650 |
{ |
651 |
$reserve{'barcodenumber'} = $res->item()->barcode(); |
651 |
my %reserve; |
652 |
$reserve{'wbrcode'} = $res->branchcode(); |
652 |
if ( $res->is_found() ) { |
653 |
$reserve{'itemnumber'} = $res->itemnumber(); |
653 |
$reserve{'holdingbranch'} = $res->item()->holdingbranch(); |
654 |
$reserve{'wbrname'} = $res->branch()->branchname(); |
654 |
$reserve{'biblionumber'} = $res->item()->biblionumber(); |
655 |
$reserve{'atdestination'} = $res->is_at_destination(); |
655 |
$reserve{'barcodenumber'} = $res->item()->barcode(); |
656 |
$reserve{'desk_name'} = ( $res->desk() ) ? $res->desk()->desk_name() : '' ; |
656 |
$reserve{'wbrcode'} = $res->branchcode(); |
657 |
$reserve{'found'} = $res->is_found(); |
657 |
$reserve{'itemnumber'} = $res->itemnumber(); |
658 |
$reserve{'inprocessing'} = $res->is_in_processing(); |
658 |
$reserve{'wbrname'} = $res->branch()->branchname(); |
659 |
$reserve{'intransit'} = $res->is_in_transit(); |
659 |
$reserve{'atdestination'} = $res->is_at_destination(); |
660 |
} |
660 |
$reserve{'desk_name'} = ( $res->desk() ) ? $res->desk()->desk_name() : '' ; |
661 |
elsif ( $res->priority() > 0 ) { |
661 |
$reserve{'found'} = $res->is_found(); |
662 |
if ( my $item = $res->item() ) { |
662 |
$reserve{'inprocessing'} = $res->is_in_processing(); |
663 |
$reserve{'itemnumber'} = $item->id(); |
663 |
$reserve{'intransit'} = $res->is_in_transit(); |
664 |
$reserve{'barcodenumber'} = $item->barcode(); |
664 |
} |
665 |
$reserve{'item_level_hold'} = 1; |
665 |
elsif ( $res->priority() > 0 ) { |
|
|
666 |
if ( my $item = $res->item() ) { |
667 |
$reserve{'itemnumber'} = $item->id(); |
668 |
$reserve{'barcodenumber'} = $item->barcode(); |
669 |
$reserve{'item_level_hold'} = 1; |
670 |
} |
666 |
} |
671 |
} |
667 |
} |
|
|
668 |
|
672 |
|
669 |
$reserve{'expirationdate'} = $res->expirationdate; |
673 |
$reserve{'expirationdate'} = $res->expirationdate; |
670 |
$reserve{'date'} = $res->reservedate; |
674 |
$reserve{'date'} = $res->reservedate; |
671 |
$reserve{'borrowernumber'} = $res->borrowernumber(); |
675 |
$reserve{'borrowernumber'} = $res->borrowernumber(); |
672 |
$reserve{'biblionumber'} = $res->biblionumber(); |
676 |
$reserve{'biblionumber'} = $res->biblionumber(); |
673 |
$reserve{'patron'} = $res->borrower; |
677 |
$reserve{'patron'} = $res->borrower; |
674 |
$reserve{'notes'} = $res->reservenotes(); |
678 |
$reserve{'notes'} = $res->reservenotes(); |
675 |
$reserve{'waiting_date'} = $res->waitingdate(); |
679 |
$reserve{'waiting_date'} = $res->waitingdate(); |
676 |
$reserve{'ccode'} = $res->item() ? $res->item()->ccode() : undef; |
680 |
$reserve{'ccode'} = $res->item() ? $res->item()->ccode() : undef; |
677 |
$reserve{'barcode'} = $res->item() ? $res->item()->barcode() : undef; |
681 |
$reserve{'barcode'} = $res->item() ? $res->item()->barcode() : undef; |
678 |
$reserve{'priority'} = $res->priority(); |
682 |
$reserve{'priority'} = $res->priority(); |
679 |
$reserve{'lowestPriority'} = $res->lowestPriority(); |
683 |
$reserve{'lowestPriority'} = $res->lowestPriority(); |
680 |
$reserve{'suspend'} = $res->suspend(); |
684 |
$reserve{'suspend'} = $res->suspend(); |
681 |
$reserve{'suspend_until'} = $res->suspend_until(); |
685 |
$reserve{'suspend_until'} = $res->suspend_until(); |
682 |
$reserve{'reserve_id'} = $res->reserve_id(); |
686 |
$reserve{'reserve_id'} = $res->reserve_id(); |
683 |
$reserve{itemtype} = $res->itemtype(); |
687 |
$reserve{itemtype} = $res->itemtype(); |
684 |
$reserve{branchcode} = $res->branchcode(); |
688 |
$reserve{branchcode} = $res->branchcode(); |
685 |
$reserve{non_priority} = $res->non_priority(); |
689 |
$reserve{non_priority} = $res->non_priority(); |
686 |
$reserve{object} = $res; |
690 |
$reserve{object} = $res; |
687 |
|
691 |
|
688 |
push( @reserveloop, \%reserve ); |
692 |
push( @reserveloop, \%reserve ); |
|
|
693 |
} |
689 |
} |
694 |
} |
690 |
|
695 |
|
691 |
# get the time for the form name... |
696 |
# get the time for the form name... |
692 |
- |
|
|