Bug 7961 - Local cover images should support CSV link files
[koha_gimpoz] / opac / opac-reserve.pl
index 2713cf3..4e4d440 100755 (executable)
@@ -29,7 +29,9 @@ use C4::Dates qw/format_date/;
 use C4::Context;
 use C4::Members;
 use C4::Branch; # GetBranches
+use C4::Overdues;
 use C4::Debug;
+use Koha::DateUtils;
 # use Data::Dumper;
 
 my $MAXIMUM_NUMBER_OF_RESERVES = C4::Context->preference("maxreserves");
@@ -197,7 +199,7 @@ if ( $query->param('place_reserve') ) {
         my $itemNum   = shift(@selectedItems);
         my $branch    = shift(@selectedItems); # i.e., branch code, not name
 
-        my $singleBranchMode = $template->param('singleBranchMode');
+        my $singleBranchMode = C4::Context->preference("singleBranchMode");
         if ($singleBranchMode || ! $OPACChooseBranch) { # single branch mode or disabled user choosing
             $branch = $borr->{'branchcode'};
         }
@@ -278,7 +280,7 @@ if ( $borr->{lost} && ($borr->{lost} eq 1) ) {
                      lost    => 1
                     );
 }
-if ( $borr->{debarred} && ($borr->{debarred} eq 1) ) {
+if ( CheckBorrowerDebarred($borrowernumber) ) {
     $noreserves = 1;
     $template->param(
                      message  => 1,
@@ -396,7 +398,7 @@ foreach my $biblioNum (@biblionumbers) {
         # change the background color.
         my $issues= GetItemIssue($itemNum);
         if ( $issues->{'date_due'} ) {
-            $itemLoopIter->{dateDue} = format_date($issues->{'date_due'});
+            $itemLoopIter->{dateDue} = format_sqlduedatetime($issues->{date_due});
             $itemLoopIter->{backgroundcolor} = 'onloan';
         }