|
Lines 40-45
use Date::Calc qw/Today Add_Delta_YMD/;
Link Here
|
| 40 |
my $input = new CGI; |
40 |
my $input = new CGI; |
| 41 |
my $startdate=$input->param('from'); |
41 |
my $startdate=$input->param('from'); |
| 42 |
my $enddate=$input->param('to'); |
42 |
my $enddate=$input->param('to'); |
|
|
43 |
my $branchLimiter = $input->param('branchLimiter'); |
| 43 |
my $run_report = ( not defined $input->param('run_report') ) ? 1 : $input->param('run_report'); |
44 |
my $run_report = ( not defined $input->param('run_report') ) ? 1 : $input->param('run_report'); |
| 44 |
|
45 |
|
| 45 |
my $theme = $input->param('theme'); # only used if allowthemeoverride is set |
46 |
my $theme = $input->param('theme'); # only used if allowthemeoverride is set |
|
Lines 88-93
if (!defined($enddate) or $enddate eq "") {
Link Here
|
| 88 |
$enddate = format_date($d); |
89 |
$enddate = format_date($d); |
| 89 |
} |
90 |
} |
| 90 |
|
91 |
|
|
|
92 |
if (! defined $branchLimiter) { |
| 93 |
$branchLimiter = C4::Context->userenv->{branch}; |
| 94 |
} |
| 95 |
|
| 96 |
|
| 91 |
my @reservedata; |
97 |
my @reservedata; |
| 92 |
if ( $run_report ) { |
98 |
if ( $run_report ) { |
| 93 |
my $dbh = C4::Context->dbh; |
99 |
my $dbh = C4::Context->dbh; |
|
Lines 152-157
if ( $run_report ) {
Link Here
|
| 152 |
# GROUP BY reserves.biblionumber allows only items that are not checked out, else multiples occur when |
158 |
# GROUP BY reserves.biblionumber allows only items that are not checked out, else multiples occur when |
| 153 |
# multiple patrons have a hold on an item |
159 |
# multiple patrons have a hold on an item |
| 154 |
|
160 |
|
|
|
161 |
#Always show just the requests that can be fulfilled from userenv or the desired branch. |
| 162 |
if ($branchLimiter ne '_ShowAll') { |
| 163 |
$strsth .= " AND items.holdingbranch=? "; |
| 164 |
push @query_params, $branchLimiter; |
| 165 |
} |
| 166 |
else { |
| 167 |
#Show all requests if $branchLimiter eq '_ShowAll' |
| 168 |
} |
| 155 |
|
169 |
|
| 156 |
if (C4::Context->preference('IndependentBranches')){ |
170 |
if (C4::Context->preference('IndependentBranches')){ |
| 157 |
$strsth .= " AND items.holdingbranch=? "; |
171 |
$strsth .= " AND items.holdingbranch=? "; |
|
Lines 196-201
if ( $run_report ) {
Link Here
|
| 196 |
} |
210 |
} |
| 197 |
$sth->finish; |
211 |
$sth->finish; |
| 198 |
} |
212 |
} |
|
|
213 |
##Prepare the custom branches loop containing the _ShowAll entry to show all requests. |
| 214 |
my $branchloop; |
| 215 |
if ($branchLimiter eq '_ShowAll') { |
| 216 |
$branchloop = C4::Branch::GetBranchesLoop(); |
| 217 |
unshift @$branchloop, { branchcode => '_ShowAll', branchname => 'Show all requests', selected => '1', value => '_ShowAll'}; |
| 218 |
} |
| 219 |
else { |
| 220 |
$branchloop = C4::Branch::GetBranchesLoop($branchLimiter); |
| 221 |
unshift @$branchloop, { branchcode => '_ShowAll', branchname => 'Show all requests', selected => '0', value => '_ShowAll'}; |
| 222 |
} |
| 199 |
|
223 |
|
| 200 |
$template->param( |
224 |
$template->param( |
| 201 |
todaysdate => format_date($todaysdate), |
225 |
todaysdate => format_date($todaysdate), |
|
Lines 206-211
$template->param(
Link Here
|
| 206 |
"BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, |
230 |
"BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, |
| 207 |
HoldsToPullStartDate=> C4::Context->preference('HoldsToPullStartDate')||TWO_DAYS, |
231 |
HoldsToPullStartDate=> C4::Context->preference('HoldsToPullStartDate')||TWO_DAYS, |
| 208 |
HoldsToPullEndDate => C4::Context->preference('ConfirmFutureHolds')||0, |
232 |
HoldsToPullEndDate => C4::Context->preference('ConfirmFutureHolds')||0, |
|
|
233 |
branchloop => $branchloop, |
| 209 |
); |
234 |
); |
| 210 |
|
235 |
|
| 211 |
output_html_with_http_headers $input, $cookie, $template->output; |
236 |
output_html_with_http_headers $input, $cookie, $template->output; |