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

(-)a/circ/overdue.pl (-11 / +19 lines)
Lines 39-54 my $borflagsfilter = $input->param('borflag') || ''; Link Here
39
my $branchfilter    = $input->param('branch') || '';
39
my $branchfilter    = $input->param('branch') || '';
40
my $homebranchfilter    = $input->param('homebranch') || '';
40
my $homebranchfilter    = $input->param('homebranch') || '';
41
my $holdingbranchfilter = $input->param('holdingbranch') || '';
41
my $holdingbranchfilter = $input->param('holdingbranch') || '';
42
my $dateduefrom     = $input->param('dateduefrom');
43
my $datedueto       = $input->param('datedueto');
42
my $op              = $input->param('op') || '';
44
my $op              = $input->param('op') || '';
43
45
44
my ($dateduefrom, $datedueto);
46
if ( $dateduefrom ) {
45
if ( $dateduefrom = $input->param('dateduefrom') ) {
46
    $dateduefrom = dt_from_string( $dateduefrom );
47
    $dateduefrom = dt_from_string( $dateduefrom );
47
}
48
}
48
if ( $datedueto = $input->param('datedueto') ) {
49
if ( $datedueto ) {
49
    $datedueto = dt_from_string( $datedueto )->set_hour(23)->set_minute(59);
50
    $datedueto = dt_from_string( $datedueto )->set_hour(23)->set_minute(59);
50
}
51
}
51
52
53
my $filters = {
54
    itemtype      => $itemtypefilter,
55
    borname       => $bornamefilter,
56
    borcat        => $borcatfilter,
57
    itemtype      => $itemtypefilter,
58
    borflag       => $borflagsfilter,
59
    branch        => $branchfilter,
60
    homebranch    => $homebranchfilter,
61
    holdingbranch => $holdingbranchfilter,
62
    dateduefrom   => $dateduefrom,
63
    datedueto     => $datedueto,
64
};
65
52
my $isfiltered      = $op =~ /apply/i && $op =~ /filter/i;
66
my $isfiltered      = $op =~ /apply/i && $op =~ /filter/i;
53
my $noreport        = C4::Context->preference('FilterBeforeOverdueReport') && ! $isfiltered && $op ne "csv";
67
my $noreport        = C4::Context->preference('FilterBeforeOverdueReport') && ! $isfiltered && $op ne "csv";
54
68
Lines 179-196 if (@patron_attr_filter_loop) { Link Here
179
}
193
}
180
194
181
195
196
use Data::Printer colored => 1; warn p $filters;
182
$template->param(
197
$template->param(
183
    patron_attr_header_loop => [ map { { header => $_->{description} } } grep { ! $_->{isclone} } @patron_attr_filter_loop ],
198
    patron_attr_header_loop => [ map { { header => $_->{description} } } grep { ! $_->{isclone} } @patron_attr_filter_loop ],
184
    branchfilter => $branchfilter,
199
    filters => $filters,
185
    homebranchfilter => $homebranchfilter,
186
    holdingbranchfilter => $holdingbranchfilter,
187
    borcatloop=> \@borcatloop,
200
    borcatloop=> \@borcatloop,
188
    itemtypeloop => \@itemtypeloop,
201
    itemtypeloop => \@itemtypeloop,
189
    patron_attr_filter_loop => \@patron_attr_filter_loop,
202
    patron_attr_filter_loop => \@patron_attr_filter_loop,
190
    borname => $bornamefilter,
191
    showall => $showall,
203
    showall => $showall,
192
    dateduefrom => $dateduefrom,
193
    datedueto   => $datedueto,
194
);
204
);
195
205
196
if ($noreport) {
206
if ($noreport) {
Lines 346-355 if ($noreport) { Link Here
346
    # generate parameter list for CSV download link
356
    # generate parameter list for CSV download link
347
    my $new_cgi = CGI->new($input);
357
    my $new_cgi = CGI->new($input);
348
    $new_cgi->delete('op');
358
    $new_cgi->delete('op');
349
    my $csv_param_string = $new_cgi->query_string();
350
359
351
    $template->param(
360
    $template->param(
352
        csv_param_string        => $csv_param_string,
353
        todaysdate              => output_pref($today_dt),
361
        todaysdate              => output_pref($today_dt),
354
        overdueloop             => \@overduedata,
362
        overdueloop             => \@overduedata,
355
        nnoverdue               => scalar(@overduedata),
363
        nnoverdue               => scalar(@overduedata),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt (-8 / +11 lines)
Lines 34-40 Link Here
34
34
35
  <p>
35
  <p>
36
    [% IF ( isfiltered ) %]
36
    [% IF ( isfiltered ) %]
37
      <a href="overdue.pl?op=csv&amp;[% csv_param_string | uri %]">Download file of displayed overdues</a>
37
        [% SET url_params = '' %]
38
        [% FOR var IN filters.keys %]
39
            [% url_params = BLOCK %][% url_params %]&amp;[% var | uri %]=[% filters.$var | uri %][% END %]
40
        [% END %]
41
      <a href="overdue.pl?op=csv[% url_params | $raw %]">Download file of displayed overdues</a>
38
    [% ELSE %]
42
    [% ELSE %]
39
      <a href="overdue.pl?op=csv">Download file of all overdues</a>
43
      <a href="overdue.pl?op=csv">Download file of all overdues</a>
40
    [% END %]
44
    [% END %]
Lines 102-116 Link Here
102
	<fieldset><legend>Date due:</legend>
106
	<fieldset><legend>Date due:</legend>
103
	<ol>
107
	<ol>
104
    <li><label for="from">From:</label>
108
    <li><label for="from">From:</label>
105
    <input type="text" id="from" name="dateduefrom" size="10" value="[% dateduefrom | $KohaDates %]" class="datepickerfrom" />
109
    <input type="text" id="from" name="dateduefrom" size="10" value="[% filters.dateduefrom | $KohaDates %]" class="datepickerfrom" />
106
	</li>
110
	</li>
107
	<li>
111
	<li>
108
    <label for="to">To:</label>
112
    <label for="to">To:</label>
109
    <input type="text" id="to" name="datedueto" size="10" value="[% datedueto | $KohaDates %]" class="datepickerto" />
113
    <input type="text" id="to" name="datedueto" size="10" value="[% filters.datedueto | $KohaDates %]" class="datepickerto" />
110
    </li>
114
    </li>
111
    </ol></fieldset>
115
    </ol></fieldset>
112
    <ol>
116
    <ol>
113
    <li><label>Name or cardnumber:</label><input type="text" name="borname" value="[% borname | html %]" /></li>
117
    <li><label>Name or cardnumber:</label><input type="text" name="borname" value="[% filters.borname | html %]" /></li>
114
    <li><label>Patron category:</label><select name="borcat" id="borcat"><option value="">Any</option>
118
    <li><label>Patron category:</label><select name="borcat" id="borcat"><option value="">Any</option>
115
      [% FOREACH borcatloo IN borcatloop %]
119
      [% FOREACH borcatloo IN borcatloop %]
116
        [% IF ( borcatloo.selected ) %]<option value="[% borcatloo.value | html %]" selected="selected">[% borcatloo.catname | html %]</option>[% ELSE %]<option value="[% borcatloo.value | html %]">[% borcatloo.catname | html %]</option>[% END %]
120
        [% IF ( borcatloo.selected ) %]<option value="[% borcatloo.value | html %]" selected="selected">[% borcatloo.catname | html %]</option>[% ELSE %]<option value="[% borcatloo.value | html %]">[% borcatloo.catname | html %]</option>[% END %]
Lines 167-173 Link Here
167
        <label>Item home library:</label>
171
        <label>Item home library:</label>
168
        <select name="homebranch" id="homebranch">
172
        <select name="homebranch" id="homebranch">
169
            <option value="">Any</option>
173
            <option value="">Any</option>
170
            [% PROCESS options_for_libraries libraries => Branches.all( selected => homebranchfilter ) %]
174
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.homebranch ) %]
171
        </select>
175
        </select>
172
    </li>
176
    </li>
173
177
Lines 175-181 Link Here
175
        <label>Item holding library:</label>
179
        <label>Item holding library:</label>
176
        <select name="holdingbranch" id="holdingbranch">
180
        <select name="holdingbranch" id="holdingbranch">
177
            <option value="">Any</option>
181
            <option value="">Any</option>
178
            [% PROCESS options_for_libraries libraries => Branches.all( selected => holdingbranchfilter ) %]
182
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.holdingbranch ) %]
179
        </select>
183
        </select>
180
    </li>
184
    </li>
181
185
Lines 183-189 Link Here
183
        <label>Library of the patron:</label>
187
        <label>Library of the patron:</label>
184
        <select name="branch" id="branch">
188
        <select name="branch" id="branch">
185
            <option value="">Any</option>
189
            <option value="">Any</option>
186
            [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter, only_from_group => 1 ) %]
190
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.branch, only_from_group => 1 ) %]
187
        </select>
191
        </select>
188
    </li>
192
    </li>
189
193
190
- 

Return to bug 23273