Lines 648-717
foreach my $biblionumber (@biblionumbers) {
Link Here
|
648 |
|
648 |
|
649 |
# existingreserves building |
649 |
# existingreserves building |
650 |
my @reserveloop; |
650 |
my @reserveloop; |
651 |
my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } ); |
651 |
my $always_show_holds = $input->cookie('always_show_holds'); |
652 |
foreach my $res ( |
652 |
$template->param( always_show_holds => $always_show_holds ); |
653 |
sort { |
653 |
my $show_holds_now = $input->param('show_holds_now'); |
654 |
my $a_found = $a->found() || ''; |
654 |
unless( (defined $always_show_holds && $always_show_holds eq 'DONT') && !$show_holds_now ){ |
655 |
my $b_found = $a->found() || ''; |
655 |
my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } ); |
656 |
$a_found cmp $b_found; |
656 |
foreach my $res ( |
657 |
} @reserves |
657 |
sort { |
658 |
) |
658 |
my $a_found = $a->found() || ''; |
659 |
{ |
659 |
my $b_found = $a->found() || ''; |
660 |
my $priority = $res->priority(); |
660 |
$a_found cmp $b_found; |
661 |
my %reserve; |
661 |
} @reserves |
662 |
my @optionloop; |
662 |
) |
663 |
for ( my $i = 1 ; $i <= $totalcount ; $i++ ) { |
663 |
{ |
664 |
push( |
664 |
my $priority = $res->priority(); |
665 |
@optionloop, |
665 |
my %reserve; |
666 |
{ |
666 |
my @optionloop; |
667 |
num => $i, |
667 |
for ( my $i = 1 ; $i <= $totalcount ; $i++ ) { |
668 |
selected => ( $i == $priority ), |
668 |
push( |
669 |
} |
669 |
@optionloop, |
670 |
); |
670 |
{ |
671 |
} |
671 |
num => $i, |
|
|
672 |
selected => ( $i == $priority ), |
673 |
} |
674 |
); |
675 |
} |
672 |
|
676 |
|
673 |
if ( $res->is_found() ) { |
677 |
if ( $res->is_found() ) { |
674 |
$reserve{'holdingbranch'} = $res->item()->holdingbranch(); |
678 |
$reserve{'holdingbranch'} = $res->item()->holdingbranch(); |
675 |
$reserve{'biblionumber'} = $res->item()->biblionumber(); |
679 |
$reserve{'biblionumber'} = $res->item()->biblionumber(); |
676 |
$reserve{'barcodenumber'} = $res->item()->barcode(); |
680 |
$reserve{'barcodenumber'} = $res->item()->barcode(); |
677 |
$reserve{'wbrcode'} = $res->branchcode(); |
681 |
$reserve{'wbrcode'} = $res->branchcode(); |
678 |
$reserve{'itemnumber'} = $res->itemnumber(); |
682 |
$reserve{'itemnumber'} = $res->itemnumber(); |
679 |
$reserve{'wbrname'} = $res->branch()->branchname(); |
683 |
$reserve{'wbrname'} = $res->branch()->branchname(); |
680 |
$reserve{'atdestination'} = $res->is_at_destination(); |
684 |
$reserve{'atdestination'} = $res->is_at_destination(); |
681 |
$reserve{'desk_name'} = ( $res->desk() ) ? $res->desk()->desk_name() : '' ; |
685 |
$reserve{'desk_name'} = ( $res->desk() ) ? $res->desk()->desk_name() : '' ; |
682 |
$reserve{'found'} = $res->is_found(); |
686 |
$reserve{'found'} = $res->is_found(); |
683 |
$reserve{'inprocessing'} = $res->is_in_processing(); |
687 |
$reserve{'inprocessing'} = $res->is_in_processing(); |
684 |
$reserve{'intransit'} = $res->is_in_transit(); |
688 |
$reserve{'intransit'} = $res->is_in_transit(); |
685 |
} |
689 |
} |
686 |
elsif ( $res->priority() > 0 ) { |
690 |
elsif ( $res->priority() > 0 ) { |
687 |
if ( my $item = $res->item() ) { |
691 |
if ( my $item = $res->item() ) { |
688 |
$reserve{'itemnumber'} = $item->id(); |
692 |
$reserve{'itemnumber'} = $item->id(); |
689 |
$reserve{'barcodenumber'} = $item->barcode(); |
693 |
$reserve{'barcodenumber'} = $item->barcode(); |
690 |
$reserve{'item_level_hold'} = 1; |
694 |
$reserve{'item_level_hold'} = 1; |
|
|
695 |
} |
691 |
} |
696 |
} |
692 |
} |
|
|
693 |
|
697 |
|
694 |
$reserve{'expirationdate'} = $res->expirationdate; |
698 |
$reserve{'expirationdate'} = $res->expirationdate; |
695 |
$reserve{'date'} = $res->reservedate; |
699 |
$reserve{'date'} = $res->reservedate; |
696 |
$reserve{'borrowernumber'} = $res->borrowernumber(); |
700 |
$reserve{'borrowernumber'} = $res->borrowernumber(); |
697 |
$reserve{'biblionumber'} = $res->biblionumber(); |
701 |
$reserve{'biblionumber'} = $res->biblionumber(); |
698 |
$reserve{'patron'} = $res->borrower; |
702 |
$reserve{'patron'} = $res->borrower; |
699 |
$reserve{'notes'} = $res->reservenotes(); |
703 |
$reserve{'notes'} = $res->reservenotes(); |
700 |
$reserve{'waiting_date'} = $res->waitingdate(); |
704 |
$reserve{'waiting_date'} = $res->waitingdate(); |
701 |
$reserve{'ccode'} = $res->item() ? $res->item()->ccode() : undef; |
705 |
$reserve{'ccode'} = $res->item() ? $res->item()->ccode() : undef; |
702 |
$reserve{'barcode'} = $res->item() ? $res->item()->barcode() : undef; |
706 |
$reserve{'barcode'} = $res->item() ? $res->item()->barcode() : undef; |
703 |
$reserve{'priority'} = $res->priority(); |
707 |
$reserve{'priority'} = $res->priority(); |
704 |
$reserve{'lowestPriority'} = $res->lowestPriority(); |
708 |
$reserve{'lowestPriority'} = $res->lowestPriority(); |
705 |
$reserve{'optionloop'} = \@optionloop; |
709 |
$reserve{'optionloop'} = \@optionloop; |
706 |
$reserve{'suspend'} = $res->suspend(); |
710 |
$reserve{'suspend'} = $res->suspend(); |
707 |
$reserve{'suspend_until'} = $res->suspend_until(); |
711 |
$reserve{'suspend_until'} = $res->suspend_until(); |
708 |
$reserve{'reserve_id'} = $res->reserve_id(); |
712 |
$reserve{'reserve_id'} = $res->reserve_id(); |
709 |
$reserve{itemtype} = $res->itemtype(); |
713 |
$reserve{itemtype} = $res->itemtype(); |
710 |
$reserve{branchcode} = $res->branchcode(); |
714 |
$reserve{branchcode} = $res->branchcode(); |
711 |
$reserve{non_priority} = $res->non_priority(); |
715 |
$reserve{non_priority} = $res->non_priority(); |
712 |
$reserve{object} = $res; |
716 |
$reserve{object} = $res; |
713 |
|
717 |
|
714 |
push( @reserveloop, \%reserve ); |
718 |
push( @reserveloop, \%reserve ); |
|
|
719 |
} |
715 |
} |
720 |
} |
716 |
|
721 |
|
717 |
# get the time for the form name... |
722 |
# get the time for the form name... |
718 |
- |
|
|