synch'ing 2.2 and head
[koha.git] / request.pl
index 568f221..f575402 100755 (executable)
 use strict;
 use C4::Search;
 use C4::Output;
+use C4::Interface::CGI::Output;
 use C4::Auth;
 use C4::Reserves2;
 use C4::Biblio;
 use C4::Koha;
 use C4::Circulation::Circ2;
 use HTML::Template;
-use C4::Catalogue;
+use C4::Acquisition;
 use CGI;
 use C4::Date;
 
@@ -132,12 +133,17 @@ foreach my $res (sort {$a->{'found'} cmp $b->{'found'}} @$reserves){
                my %env;
                my $item = $res->{'itemnumber'};
                $item = getiteminformation(\%env,$item);
+               $reserve{'holdingbranch'}=$item->{'holdingbranch'};
                $reserve{'barcode'}=$item->{'barcode'};
                $reserve{'biblionumber'}=$item->{'biblionumber'};
                $reserve{'wbrcode'} = $res->{'branchcode'};
                $reserve{'wbrname'} = $branches->{$res->{'branchcode'}}->{'branchname'};
+               if($reserve{'holdingbranch'} eq $reserve{'wbrcode'}){
+                       $reserve{'atdestination'} = 1;
+               }
     }
-    $reserve{'date'} = format_date($res->{'reservedate'});
+       
+   $reserve{'date'} = format_date($res->{'reservedate'});
        $reserve{'borrowernumber'}=$res->{'borrowernumber'};
        $reserve{'biblionumber'}=$res->{'biblionumber'};
        $reserve{'bornum'}=$res->{'borrowernumber'};
@@ -189,4 +195,7 @@ $template->param(   optionloop =>\@optionloop,
                                                                bib => $bib,
                                                                title =>$dat->{title});
 # printout the page
-print $input->header(-expires=>'now'), $template->output;
+print $input->header(
+       -type => C4::Interface::CGI::Output::guesstype($template->output),
+       -expires=>'now'
+), $template->output;