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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt (-5 / +35 lines)
Lines 220-233 Link Here
220
                <td>Item type</td>
220
                <td>Item type</td>
221
				<td><input type="radio" name="Line" value="biblioitems.itemtype" /></td>
221
				<td><input type="radio" name="Line" value="biblioitems.itemtype" /></td>
222
				<td><input type="radio" name="Column" value="biblioitems.itemtype" /></td>
222
				<td><input type="radio" name="Column" value="biblioitems.itemtype" /></td>
223
				<td>[% CGIItemType %]</td>
223
                <td>
224
                    <select name="Filter" size="1" id="itemtypes">
225
                        <option value="">All item types</option>
226
                        [% FOREACH value IN ItemTypes.values %]
227
                        <option value="[% value %]">[% ItemTypes.labels.$value %]</option>
228
                        [% END %]
229
                    </select>
230
                </td>
224
			</tr>
231
			</tr>
225
232
226
			<tr>
233
			<tr>
227
				<td>Fund</td>
234
				<td>Fund</td>
228
				<td><input type="radio" name="Line" value="aqbudgets.budget_code" /></td>
235
				<td><input type="radio" name="Line" value="aqbudgets.budget_code" /></td>
229
				<td><input type="radio" name="Column" value="aqbudgets.budget_code" /></td>
236
				<td><input type="radio" name="Column" value="aqbudgets.budget_code" /></td>
230
				<td>[% CGIBudget %]</td>
237
                <td>
238
                    <select name="Filter" size="1" id="budget">
239
                        <option value="">All funds</option>
240
                        [% FOREACH value IN Budgets.values %]
241
                        <option value="[% value %]">[% Budgets.labels.$value %]</option>
242
                        [% END %]
243
                    </select>
244
                </td>
231
			</tr>
245
			</tr>
232
246
233
			[% IF ( hassort1 ) %]
247
			[% IF ( hassort1 ) %]
Lines 235-241 Link Here
235
					<td>Sort1</td>
249
					<td>Sort1</td>
236
					<td><input type="radio" name="Line" value="aqorders.sort1" /></td>
250
					<td><input type="radio" name="Line" value="aqorders.sort1" /></td>
237
					<td><input type="radio" name="Column" value="aqorders.sort1" /></td>
251
					<td><input type="radio" name="Column" value="aqorders.sort1" /></td>
238
					<td>[% CGISort1 %] </td>
252
                    <td>
253
                        <select name="Filter" size="1" id="sort1">
254
                            <option value="">All</option>
255
                            [% FOREACH value IN Sort1.values %]
256
                            <option value="[% value %]">[% Sort1.labels.$value %]</option>
257
                            [% END %]
258
                        </select>
259
                    </td>
239
				</tr>
260
				</tr>
240
			[% END %]
261
			[% END %]
241
			[% IF ( hassort2 ) %]
262
			[% IF ( hassort2 ) %]
Lines 243-249 Link Here
243
					<td>Sort2</td>
264
					<td>Sort2</td>
244
					<td><input type="radio" name="Line" value="aqorders.sort2" /></td>
265
					<td><input type="radio" name="Line" value="aqorders.sort2" /></td>
245
					<td><input type="radio" name="Column" value="aqorders.sort2" /></td>
266
					<td><input type="radio" name="Column" value="aqorders.sort2" /></td>
246
					<td>[% CGISort2 %] </td>
267
                    <td>
268
                        <select name="Filter" size="1" id="sort2">
269
                            <option value="">All</option>
270
                            [% FOREACH value IN Sort2.values %]
271
                            <option value="[% value %]">[% Sort2.labels.$value %]</option>
272
                            [% END %]
273
                        </select>
274
                    </td>
247
				</tr>
275
				</tr>
248
			[% END %]
276
			[% END %]
249
		</tbody>
277
		</tbody>
Lines 281-287 Link Here
281
            <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
309
            <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
282
            <label class="inline" for="basename">Named: </label> <input type="text" name="basename" id="basename" value="Export" />
310
            <label class="inline" for="basename">Named: </label> <input type="text" name="basename" id="basename" value="Export" />
283
            <label class="inline" for="MIME">Into an application</label>
311
            <label class="inline" for="MIME">Into an application</label>
284
            [% CGIextChoice %]
312
            <select name="MIME" id="MIME" size="1">
313
                <option value="CSV">CSV</option>
314
            </select>
285
            <select name="sep" id="sep" size="1">
315
            <select name="sep" id="sep" size="1">
286
            [% FOREACH value IN CGIsepChoice.values.sort() %]
316
            [% FOREACH value IN CGIsepChoice.values.sort() %]
287
              [% IF ( value == CGIsepChoice.default ) %]
317
              [% IF ( value == CGIsepChoice.default ) %]
(-)a/reports/acquisitions_stats.pl (-70 / +36 lines)
Lines 122-199 else { Link Here
122
122
123
    $req = $dbh->prepare("SELECT DISTINCTROW itemtype,description FROM itemtypes ORDER BY description");
123
    $req = $dbh->prepare("SELECT DISTINCTROW itemtype,description FROM itemtypes ORDER BY description");
124
    $req->execute;
124
    $req->execute;
125
    my @select;
125
    my @iselect;
126
    my %select;
126
    my %iselect;
127
    push @select, "";
128
    $select{''} = "All item types";
129
    while ( my ( $value, $desc ) = $req->fetchrow ) {
127
    while ( my ( $value, $desc ) = $req->fetchrow ) {
130
        push @select, $value;
128
        push @iselect, $value;
131
        $select{$value} = $desc;
129
        $iselect{$value} = $desc;
132
    }
130
    }
133
    my $CGIItemTypes = CGI::scrolling_list(
131
    my $ItemTypes = {
134
        -name     => 'Filter',
132
        values  => \@iselect,
135
        -id       => 'itemtypes',
133
        labels  => \%iselect,
136
        -values   => \@select,
134
   };
137
        -labels   => \%select,
138
        -size     => 1,
139
        -multiple => 0
140
    );
141
135
142
    $req = $dbh->prepare("SELECT DISTINCTROW budget_code, budget_name FROM aqbudgets ORDER BY budget_name");
136
    $req = $dbh->prepare("SELECT DISTINCTROW budget_code, budget_name FROM aqbudgets ORDER BY budget_name");
143
    $req->execute;
137
    $req->execute;
144
    undef @select;
138
    my @bselect;
145
    undef %select;
139
    my %bselect;
146
    push @select, "";
147
    $select{''} = "All funds";
148
140
149
    while ( my ( $value, $desc ) = $req->fetchrow ) {
141
    while ( my ( $value, $desc ) = $req->fetchrow ) {
150
        push @select, $value;
142
        push @bselect, $value;
151
        $select{$value} = $desc;
143
        $bselect{$value} = $desc;
152
    }
144
    }
153
    my $CGIBudget = CGI::scrolling_list(
145
    my $Budgets = {
154
        -name     => 'Filter',
146
        values   => \@bselect,
155
        -id       => 'budget',
147
        labels   => \%bselect,
156
        -values   => \@select,
148
    };
157
        -labels   => \%select,
158
        -size     => 1,
159
        -multiple => 0
160
    );
161
149
162
    $req =
150
    $req =
163
      $dbh->prepare(
151
      $dbh->prepare(
164
"SELECT DISTINCTROW sort1 FROM aqorders WHERE sort1 IS NOT NULL ORDER BY sort1"
152
"SELECT DISTINCTROW sort1 FROM aqorders WHERE sort1 IS NOT NULL ORDER BY sort1"
165
      );
153
      );
166
    $req->execute;
154
    $req->execute;
167
    undef @select;
155
    my @s1select;
168
    undef %select;
156
    my %s1select;
169
    push @select, "";
170
    $select{''} = "All";
171
    my $hassort1;
157
    my $hassort1;
172
    while ( my ($value) = $req->fetchrow ) {
158
    while ( my ($value) = $req->fetchrow ) {
173
        if ($value) {
159
        if ($value) {
174
            $hassort1 = 1;
160
            $hassort1 = 1;
175
            push @select, $value;
161
            push @s1select, $value;
176
            $select{$value} = $value;
162
            $s1select{$value} = $value;
177
        }
163
        }
178
    }
164
    }
179
    my $CGISort1 = CGI::scrolling_list(
165
    my $Sort1 = {
180
        -name     => 'Filter',
166
        values   => \@s1select,
181
        -id       => 'sort1',
167
        labels   => \%s1select,
182
        -values   => \@select,
168
    };
183
        -labels   => \%select,
184
        -size     => 1,
185
        -multiple => 0
186
    );
187
169
188
    $req =
170
    $req =
189
      $dbh->prepare(
171
      $dbh->prepare(
190
"SELECT DISTINCTROW sort2 FROM aqorders WHERE sort2 IS NOT NULL ORDER BY sort2"
172
"SELECT DISTINCTROW sort2 FROM aqorders WHERE sort2 IS NOT NULL ORDER BY sort2"
191
      );
173
      );
192
    $req->execute;
174
    $req->execute;
193
    undef @select;
175
    my @s2select;
194
    undef %select;
176
    my %s2select;
195
    push @select, "";
196
    $select{''} = "All";
197
    my $hassort2;
177
    my $hassort2;
198
    my $hglghtsort2;
178
    my $hglghtsort2;
199
179
Lines 201-226 else { Link Here
201
        if ($value) {
181
        if ($value) {
202
            $hassort2    = 1;
182
            $hassort2    = 1;
203
            $hglghtsort2 = !($hassort1);
183
            $hglghtsort2 = !($hassort1);
204
            push @select, $value;
184
            push @s2select, $value;
205
            $select{$value} = $value;
185
            $s2select{$value} = $value;
206
        }
186
        }
207
    }
187
    }
208
    my $CGISort2 = CGI::scrolling_list(
188
    my $Sort2 = {
209
        -name     => 'Filter',
189
        values   => \@s2select,
210
        -id       => 'sort2',
190
        labels   => \%s2select,
211
        -values   => \@select,
191
    };
212
        -labels   => \%select,
213
        -size     => 1,
214
        -multiple => 0
215
    );
216
217
    my $CGIextChoice = CGI::scrolling_list(
218
        -name     => 'MIME',
219
        -id       => 'MIME',
220
        -values   => ['CSV'], # FIXME translation
221
        -size     => 1,
222
        -multiple => 0
223
    );
224
192
225
    my $CGIsepChoice = GetDelimiterChoices;
193
    my $CGIsepChoice = GetDelimiterChoices;
226
194
Lines 240-252 else { Link Here
240
208
241
    $template->param(
209
    $template->param(
242
        booksellers   => $booksellers,
210
        booksellers   => $booksellers,
243
        CGIItemType   => $CGIItemTypes,
211
        ItemTypes     => $ItemTypes,
244
        CGIBudget     => $CGIBudget,
212
        Budgets       => $Budgets,
245
        hassort1      => $hassort1,
213
        hassort1      => $hassort1,
246
        hassort2      => $hassort2,
214
        hassort2      => $hassort2,
247
        CGISort1      => $CGISort1,
215
        Sort1         => $Sort1,
248
        CGISort2      => $CGISort2,
216
        Sort2         => $Sort2,
249
        CGIextChoice  => $CGIextChoice,
250
        CGIsepChoice  => $CGIsepChoice,
217
        CGIsepChoice  => $CGIsepChoice,
251
        branches      => \@branches,
218
        branches      => \@branches,
252
        ccode_label   => $ccode_label,
219
        ccode_label   => $ccode_label,
253
- 

Return to bug 13748