Bug 17755: Introduce Koha::Object::Limit::Library
[srvgit] / circ / overdue.pl
index 4fb046f..ab723e1 100755 (executable)
@@ -24,11 +24,11 @@ use C4::Context;
 use C4::Output;
 use CGI qw(-oldstyle_urls -utf8);
 use C4::Auth;
-use C4::Branch;
 use C4::Debug;
 use Text::CSV_XS;
 use Koha::DateUtils;
 use DateTime;
+use DateTime::Format::MySQL;
 
 my $input = new CGI;
 my $order           = $input->param('order') || '';
@@ -88,13 +88,6 @@ while (my ($itemtype, $description) =$req->fetchrow) {
         itemtypename => $description,
     };
 }
-my $onlymine =
-     C4::Context->preference('IndependentBranches')
-  && C4::Context->userenv
-  && !C4::Context->IsSuperLibrarian()
-  && C4::Context->userenv->{branch};
-
-$branchfilter = C4::Context->userenv->{'branch'} if ($onlymine && !$branchfilter);
 
 # Filtering by Patron Attributes
 #  @patron_attr_filter_loop        is non empty if there are any patron attribute filters
@@ -102,8 +95,8 @@ $branchfilter = C4::Context->userenv->{'branch'} if ($onlymine && !$branchfilter
 #  %borrowernumber_to_attributes   is populated by those borrowernumbers matching the patron attribute filters
 
 my %cgi_attrcode_to_attrvalues;     # ( patron_attribute_code => [ zero or more attribute filter values from the CGI ] )
-for my $attrcode (grep { /^patron_attr_filter_/ } $input->param) {
-    if (my @attrvalues = grep { length($_) > 0 } $input->param($attrcode)) {
+for my $attrcode (grep { /^patron_attr_filter_/ } $input->multi_param) {
+    if (my @attrvalues = grep { length($_) > 0 } $input->multi_param($attrcode)) {
         $attrcode =~ s/^patron_attr_filter_//;
         $cgi_attrcode_to_attrvalues{$attrcode} = \@attrvalues;
         print STDERR ">>>param($attrcode)[@{[scalar @attrvalues]}] = '@attrvalues'\n" if $debug;
@@ -213,9 +206,6 @@ if (@patron_attr_filter_loop) {
 
 $template->param(
     patron_attr_header_loop => [ map { { header => $_->{description} } } grep { ! $_->{isclone} } @patron_attr_filter_loop ],
-    branchloop   => GetBranchesLoop($branchfilter, $onlymine),
-    homebranchloop => GetBranchesLoop( $homebranchfilter, $onlymine ),
-    holdingbranchloop => GetBranchesLoop( $holdingbranchfilter, $onlymine ),
     branchfilter => $branchfilter,
     homebranchfilter => $homebranchfilter,
     holdingbranchfilter => $homebranchfilter,
@@ -321,8 +311,8 @@ if ($noreport) {
     $template->param(sql=>$strsth);
     my $sth=$dbh->prepare($strsth);
     $sth->execute(
-        ($dateduefrom ? output_pref({ dt => $dateduefrom, dateformat => 'iso' }) : ()),
-        ($datedueto ? output_pref({ dt => $datedueto, dateformat => 'iso' }) : ()),
+        ($dateduefrom ? DateTime::Format::MySQL->format_datetime($dateduefrom) : ()),
+        ($datedueto ? DateTime::Format::MySQL->format_datetime($datedueto) : ()),
     );
 
     my @overduedata;