Portuguese updates
[koha.git] / circ / pendingreserves.pl
index 0a6fa2f..7fc02a1 100755 (executable)
@@ -45,7 +45,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         query           => $input,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { circulate => 1 },
+        flagsrequired   => { circulate => "circulate_remaining_permissions" },
         debug           => 1,
     }
 );
@@ -66,9 +66,9 @@ my $author;
 my ( $year, $month, $day ) = Today();
 my $todaysdate     = sprintf("%-04.4d-%-02.2d-%02.2d", $year, $month, $day);
 my $yesterdaysdate = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day,   0, 0, -1));
-# Find 10 years ago for the default shelf pull start and end dates
-#    A default of the prior day's holds is a reasonable way to pull holds 
-my $pastdate       = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, -10, 0,  0));
+#changed from delivered range of 10 years-yesterday to 2 days ago-today
+# Find two days ago for the default shelf pull start and end dates
+my $pastdate       = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, -2));
 
 #              Predefine the start and end dates if they are not already defined
 $startdate =~ s/^\s+//;
@@ -80,7 +80,7 @@ if (!defined($startdate) or $startdate eq "") {
        $startdate = format_date($pastdate);
 }
 if (!defined($enddate) or $enddate eq "") {
-       $enddate = format_date($yesterdaysdate);
+       $enddate = format_date($todaysdate);
 }
 
 
@@ -149,7 +149,6 @@ reserves.found IS NULL
 AND items.itemnumber NOT IN (SELECT itemnumber FROM branchtransfers where datearrived IS NULL)
 AND items.itemnumber NOT IN (SELECT itemnumber FROM issues)
 AND reserves.priority <> 0 
-AND reserves.itemnumber is NULL
 AND notforloan = 0 AND damaged = 0 AND itemlost = 0 AND wthdrawn = 0
 ";
 # GROUP BY reserves.biblionumber allows only items that are not checked out, else multiples occur when 
@@ -259,6 +258,7 @@ $template->param(
     reserveloop        => \@reservedata,
     "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
     DHTMLcalendar_dateformat =>  C4::Dates->DHTMLcalendar(),
+       dateformat    => C4::Context->preference("dateformat"),
 );
 
 output_html_with_http_headers $input, $cookie, $template->output;