$template->param( OVERDUES => \@overdues );
$template->param( overdues_count => $overdues_count );
+# load the branches
my $branches = GetBranches();
+my @branch_loop;
+for my $branch_hash ( keys %$branches ) {
+ my $selected=(C4::Context->userenv && ($branch_hash eq C4::Context->userenv->{branch})) if (C4::Context->preference('SearchMyLibraryFirst'));
+ push @branch_loop,
+ {
+ value => "branch: $branch_hash",
+ branchname => $branches->{$branch_hash}->{'branchname'},
+ selected => $selected
+ };
+}
+$template->param( branchloop => \@branch_loop, "mylibraryfirst"=>C4::Context->preference("SearchMyLibraryFirst"));
# now the reserved items....
-my ( $rcount, $reserves ) = GetReservesFromBorrowernumber( $borrowernumber );
-foreach my $res (@$reserves) {
+my @reserves = GetReservesFromBorrowernumber( $borrowernumber );
+foreach my $res (@reserves) {
$res->{'reservedate'} = format_date( $res->{'reservedate'} );
my $publictype = $res->{'publictype'};
$res->{$publictype} = 1;
$res->{'reserves_title'} = $biblioData->{'title'};
}
-$template->param( RESERVES => $reserves );
-$template->param( reserves_count => $rcount );
+# use Data::Dumper;
+# warn Dumper(@reserves);
+
+$template->param( RESERVES => \@reserves );
+$template->param( reserves_count => $#reserves+1 );
my @waiting;
my $wcount = 0;
-foreach my $res (@$reserves) {
+foreach my $res (@reserves) {
if ( $res->{'itemnumber'} ) {
my $item = GetItem( $res->{'itemnumber'});
$res->{'holdingbranch'} =