Lines 26-32
use CGI qw(-oldstyle_urls);
Link Here
|
26 |
use C4::Auth; |
26 |
use C4::Auth; |
27 |
use C4::Branch; |
27 |
use C4::Branch; |
28 |
use C4::Debug; |
28 |
use C4::Debug; |
29 |
use C4::Dates qw/format_date/; |
29 |
use C4::Dates qw/format_date format_date_in_iso/; |
30 |
use Date::Calc qw/Today/; |
30 |
use Date::Calc qw/Today/; |
31 |
use Text::CSV_XS; |
31 |
use Text::CSV_XS; |
32 |
|
32 |
|
Lines 39-44
my $itemtypefilter = $input->param('itemtype') || '';
Link Here
|
39 |
my $borflagsfilter = $input->param('borflag') || ''; |
39 |
my $borflagsfilter = $input->param('borflag') || ''; |
40 |
my $branchfilter = $input->param('branch') || ''; |
40 |
my $branchfilter = $input->param('branch') || ''; |
41 |
my $op = $input->param('op') || ''; |
41 |
my $op = $input->param('op') || ''; |
|
|
42 |
my $dateduefrom = format_date_in_iso($input->param( 'dateduefrom' )) || ''; |
43 |
my $datedueto = format_date_in_iso($input->param( 'datedueto' )) || ''; |
42 |
my $isfiltered = $op =~ /apply/i && $op =~ /filter/i; |
44 |
my $isfiltered = $op =~ /apply/i && $op =~ /filter/i; |
43 |
my $noreport = C4::Context->preference('FilterBeforeOverdueReport') && ! $isfiltered && $op ne "csv"; |
45 |
my $noreport = C4::Context->preference('FilterBeforeOverdueReport') && ! $isfiltered && $op ne "csv"; |
44 |
|
46 |
|
Lines 48-54
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
48 |
query => $input, |
50 |
query => $input, |
49 |
type => "intranet", |
51 |
type => "intranet", |
50 |
authnotrequired => 0, |
52 |
authnotrequired => 0, |
51 |
flagsrequired => { reports => 1, circulate => "circulate_remaining_permissions" }, |
53 |
flagsrequired => { reports => 'execute_reports', circulate => "circulate_remaining_permissions" }, |
52 |
debug => 1, |
54 |
debug => 1, |
53 |
} |
55 |
} |
54 |
); |
56 |
); |
Lines 206-211
$template->param(
Link Here
|
206 |
borcatloop=> \@borcatloop, |
208 |
borcatloop=> \@borcatloop, |
207 |
itemtypeloop => \@itemtypeloop, |
209 |
itemtypeloop => \@itemtypeloop, |
208 |
patron_attr_filter_loop => \@patron_attr_filter_loop, |
210 |
patron_attr_filter_loop => \@patron_attr_filter_loop, |
|
|
211 |
dateduefrom => $input->param( 'dateduefrom' ) || '', |
212 |
datedueto => $input->param( 'datedueto' ) || '', |
213 |
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), |
209 |
borname => $bornamefilter, |
214 |
borname => $bornamefilter, |
210 |
order => $order, |
215 |
order => $order, |
211 |
showall => $showall); |
216 |
showall => $showall); |
Lines 253-258
if ($noreport) {
Link Here
|
253 |
$strsth.=" AND biblioitems.itemtype = '" . $itemtypefilter . "' " if $itemtypefilter; |
258 |
$strsth.=" AND biblioitems.itemtype = '" . $itemtypefilter . "' " if $itemtypefilter; |
254 |
$strsth.=" AND borrowers.flags = '" . $borflagsfilter . "' " if $borflagsfilter; |
259 |
$strsth.=" AND borrowers.flags = '" . $borflagsfilter . "' " if $borflagsfilter; |
255 |
$strsth.=" AND borrowers.branchcode = '" . $branchfilter . "' " if $branchfilter; |
260 |
$strsth.=" AND borrowers.branchcode = '" . $branchfilter . "' " if $branchfilter; |
|
|
261 |
$strsth .= " AND date_due < '" . $datedueto . "' " if $datedueto; |
262 |
$strsth .= " AND date_due > '" . $dateduefrom . "' " if $dateduefrom; |
256 |
# restrict patrons (borrowers) to those matching the patron attribute filter(s), if any |
263 |
# restrict patrons (borrowers) to those matching the patron attribute filter(s), if any |
257 |
my $bnlist = $have_pattr_filter_data ? join(',',keys %borrowernumber_to_attributes) : ''; |
264 |
my $bnlist = $have_pattr_filter_data ? join(',',keys %borrowernumber_to_attributes) : ''; |
258 |
$strsth =~ s/WHERE 1=1/WHERE 1=1 AND borrowers.borrowernumber IN ($bnlist)/ if $bnlist; |
265 |
$strsth =~ s/WHERE 1=1/WHERE 1=1 AND borrowers.borrowernumber IN ($bnlist)/ if $bnlist; |
Lines 284-289
if ($noreport) {
Link Here
|
284 |
push @patron_attr_value_loop, { value => join(', ', sort { lc $a cmp lc $b } @displayvalues) }; |
291 |
push @patron_attr_value_loop, { value => join(', ', sort { lc $a cmp lc $b } @displayvalues) }; |
285 |
} |
292 |
} |
286 |
|
293 |
|
|
|
294 |
$data->{email}=C4::Members::GetFirstValidEmailAddress($data->{borrowernumber}); |
287 |
push @overduedata, { |
295 |
push @overduedata, { |
288 |
duedate => format_date($data->{date_due}), |
296 |
duedate => format_date($data->{date_due}), |
289 |
borrowernumber => $data->{borrowernumber}, |
297 |
borrowernumber => $data->{borrowernumber}, |