View | Details | Raw Unified | Return to bug 8074
Collapse All | Expand All

(-)a/circ/pendingreserves.pl (+25 lines)
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;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-20 / +35 lines)
Lines 158-182 $(document).ready(function() { Link Here
158
<div class="yui-b">
158
<div class="yui-b">
159
<div id="filters">
159
<div id="filters">
160
160
161
<form action="/cgi-bin/koha/circ/pendingreserves.pl" method="post" >
161
<form action="/cgi-bin/koha/circ/pendingreserves.pl" method="get">
162
<fieldset class="brief">
162
  <fieldset class="brief">
163
<h4>Refine results</h4>
163
    <h4>Refine results</h4>
164
<ol>
164
    <ol>
165
<li>
165
      <li>
166
<label for="from">
166
        <label for="from">
167
    Start date:
167
            Start date:
168
</label>
168
        </label>
169
<input type="text" size="10" id="from" name="from" value="[% from %]" class="datepickerfrom" />
169
        <input type="text" size="10" id="from" name="from" value="[% from %]" class="datepickerfrom" />
170
</li>
170
      </li>
171
<li><label for="to">
171
      <li><label for="to">
172
    End date:
172
          End date:
173
</label>
173
      </label>
174
<input type="text" size="10" id="to" name="to" value="[% to %]" class="datepickerto" />
174
      <input type="text" size="10" id="to" name="to" value="[% to %]" class="datepickerto" />
175
</li>
175
      </li>
176
</ol>
176
    </ol>
177
<p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to [% IF ( HoldsToPullEndDate ) %][% HoldsToPullEndDate %] days ahead[% ELSE %]today[% END %], set other date ranges as needed. )</i></p>
177
    <p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to [% IF ( HoldsToPullEndDate ) %][% HoldsToPullEndDate %] days ahead[% ELSE %]today[% END %], set other date ranges as needed. )</i></p>
178
<fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
178
    
179
</fieldset>
179
    <label for="branchLimiter">Limit displaying pull requests to the requests we have items for in this branch:</label>
180
    <select name="branchLimiter" size="1" id="branchLimiter">
181
    [%- FOREACH branchloo IN branchloop %]
182
      [% IF ( branchloo.selected ) -%]
183
        <option value="[% branchloo.branchcode %]" selected="selected">
184
      [%- ELSE -%]
185
        <option value="[% branchloo.branchcode %]">
186
      [%- END -%]
187
      [% IF ( branchloo.branchcode ) == '_ShowAll' -%]
188
        Show all requests</option>
189
      [%- ELSE -%]
190
        [% branchloo.branchname %]</option>
191
      [%- END -%]
192
    [%- END %]
193
    
194
    <fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
195
  </fieldset>
180
</form>
196
</form>
181
197
182
</div>
198
</div>
183
- 

Return to bug 8074