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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt (-12 / +43 lines)
Lines 152-183 Link Here
152
				<td>Patron category</td>
152
				<td>Patron category</td>
153
				<td><input type="radio" name="Line" value="borrowers.categorycode" /></td>
153
				<td><input type="radio" name="Line" value="borrowers.categorycode" /></td>
154
				<td><input type="radio" name="Column" value="borrowers.categorycode" /></td>
154
				<td><input type="radio" name="Column" value="borrowers.categorycode" /></td>
155
				<td>[% CGIBorCat %]</td>
155
                <td>
156
                    <select name="Filter" size="1" id="borcat">
157
                        <option value=""></option>
158
                        [% FOREACH value IN BorCat.values %]
159
                        <option value="[%- value -%]">[%- BorCat.labels.$value -%]</option>
160
                        [% END %]
161
                    </select>
162
                </td>
156
			</tr>
163
			</tr>
157
			<tr>
164
			<tr>
158
				<td>Item type</td>
165
				<td>Item type</td>
159
				<td><input type="radio" name="Line" value="itemtype" /></td>
166
				<td><input type="radio" name="Line" value="itemtype" /></td>
160
				<td><input type="radio" name="Column" value="itemtype" /></td>
167
				<td><input type="radio" name="Column" value="itemtype" /></td>
161
				<td >[% CGIItemType %]</td>
168
                <td>
169
                    <select name="Filter" size="1" id="itemtypes">
170
                        <option value=""></option>
171
                        [% FOREACH value IN ItemType.values %]
172
                        <option value="[%- value -%]">[%- ItemType.labels.$value -%]</option>
173
                        [% END %]
174
                    </select>
175
                </td>
162
			</tr>
176
			</tr>
163
			<tr class="hilighted">
177
			<tr class="hilighted">
164
				<td>Library</td>
178
				<td>Library</td>
165
				<td><input type="radio" name="Line" value="branchcode" /></td>
179
				<td><input type="radio" name="Line" value="branchcode" /></td>
166
				<td><input type="radio" name="Column" value="branchcode" /></td>
180
				<td><input type="radio" name="Column" value="branchcode" /></td>
167
                           <td><select name="Filter" size="1" id="branch">
181
                <td>
168
                                    <option value=""></option>
182
                    <select name="Filter" size="1" id="branch">
169
                                [%- FOREACH branchloo IN branchloop %]
183
                        <option value=""></option>
170
                                    <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
184
                        [%- FOREACH branchloo IN branchloop %]
171
                                [%- END %]
185
                        <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
172
                                    </select>
186
                        [%- END %]
173
                                </td>
187
                    </select>
188
                </td>
174
			</tr>
189
			</tr>
175
			[% IF ( hassort1 ) %]
190
			[% IF ( hassort1 ) %]
176
				<tr class="hilighted"> 
191
				<tr class="hilighted"> 
177
					<td>Sort1</td>
192
					<td>Sort1</td>
178
					<td><input type="radio" name="Line" value="borrowers.sort1" /></td>
193
					<td><input type="radio" name="Line" value="borrowers.sort1" /></td>
179
					<td><input type="radio" name="Column" value="borrowers.sort1" /></td>
194
					<td><input type="radio" name="Column" value="borrowers.sort1" /></td>
180
					<td>[% CGISort1 %] </td>
195
                    <td>
196
                        <select name="Filter" size="1" id="sort1">
197
                            <option value=""></option>
198
                            [%- FOREACH value IN Sort1.values %]
199
                            <option value="[%- value -%]">[%- value -%]</option>
200
                            [%- END %]
201
                        </select>
202
                    </td>
181
				</tr>
203
				</tr>
182
			[% END %]
204
			[% END %]
183
			[% IF ( hassort2 ) %]
205
			[% IF ( hassort2 ) %]
Lines 185-191 Link Here
185
					<td>Sort2</td>
207
					<td>Sort2</td>
186
					<td><input type="radio" name="Line" value="borrowers.sort2" /></td>
208
					<td><input type="radio" name="Line" value="borrowers.sort2" /></td>
187
					<td><input type="radio" name="Column" value="borrowers.sort2" /></td>
209
					<td><input type="radio" name="Column" value="borrowers.sort2" /></td>
188
					<td>[% CGISort2 %] </td>
210
                    <td>
211
                        <select name="Filter" size="1" id="sort2">
212
                            <option value=""></option>
213
                            [%- FOREACH value IN Sort2.values %]
214
                            <option value="[%- value -%]">[%- value -%]</option>
215
                            [%- END %]
216
                        </select>
217
                    </td>
189
				</tr>
218
				</tr>
190
			[% END %]
219
			[% END %]
191
		</tbody>
220
		</tbody>
Lines 202-208 Link Here
202
            <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
231
            <label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" />
203
            <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
232
            <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
204
            <label class="inline" for="MIME">Into an application: </label>
233
            <label class="inline" for="MIME">Into an application: </label>
205
            [% CGIextChoice %]
234
            <select name="MIME"  size="1" id="MIME">
235
                <option value="CSV">CSV</option>
236
            </select>
206
            <select name="sep" id="sep" size="1">
237
            <select name="sep" id="sep" size="1">
207
            [% FOREACH value IN CGIsepChoice.values.sort() %]
238
            [% FOREACH value IN CGIsepChoice.values.sort() %]
208
              [% IF ( value == CGIsepChoice.default ) %]
239
              [% IF ( value == CGIsepChoice.default ) %]
(-)a/reports/issues_avg_stats.pl (-55 / +30 lines)
Lines 115-208 if ($do_it) { Link Here
115
} else {
115
} else {
116
    my $dbh = C4::Context->dbh;
116
    my $dbh = C4::Context->dbh;
117
    my @values;
117
    my @values;
118
    my %labels;
119
    my %select;
120
    my $req;
118
    my $req;
121
    $req = $dbh->prepare("select distinctrow categorycode,description from categories order by description");
119
    $req = $dbh->prepare("select distinctrow categorycode,description from categories order by description");
122
    $req->execute;
120
    $req->execute;
123
    my @select;
121
    my %labelsc;
124
    push @select,"";
122
    my @selectc;
125
    $select{""}="";
126
    while (my ($value, $desc) =$req->fetchrow) {
123
    while (my ($value, $desc) =$req->fetchrow) {
127
        push @select, $value;
124
        push @selectc, $value;
128
        $select{$value}=$desc;
125
        $labelsc{$value} = $desc;
129
    }
126
    }
130
    my $CGIBorCat=CGI::scrolling_list( -name     => 'Filter',
127
    my $BorCat = {
131
                -id => 'borcat',
128
        values   => \@selectc,
132
                -values   => \@select,
129
        labels   => \%labelsc,
133
                -labels   => \%select,
130
    };
134
                -size     => 1,
135
                -multiple => 0 );
136
    
131
    
137
    $req = $dbh->prepare( "select distinctrow itemtype,description from itemtypes order by description");
132
    $req = $dbh->prepare( "select distinctrow itemtype,description from itemtypes order by description");
138
    $req->execute;
133
    $req->execute;
139
    undef @select;
134
    my @selecti;
140
    undef %select;
135
    my %labelsi;
141
    push @select,"";
142
    $select{""}="";
143
    while (my ($value,$desc) =$req->fetchrow) {
136
    while (my ($value,$desc) =$req->fetchrow) {
144
        push @select, $value;
137
        push @selecti, $value;
145
        $select{$value}=$desc;
138
        $labelsi{$value}=$desc;
146
    }
139
    }
147
    my $CGIItemTypes=CGI::scrolling_list( -name     => 'Filter',
140
    my $ItemTypes = {
148
                -id => 'itemtypes',
141
        values   => \@selecti,
149
                -values   => \@select,
142
        labels    => \%labelsi,
150
                -labels    => \%select,
143
    };
151
                -size     => 1,
152
                -multiple => 0 );
153
    
144
    
154
    $req = $dbh->prepare("select distinctrow sort1 from borrowers where sort1 is not null order by sort1");
145
    $req = $dbh->prepare("select distinctrow sort1 from borrowers where sort1 is not null order by sort1");
155
    $req->execute;
146
    $req->execute;
156
    undef @select;
147
    my @selects1;
157
    push @select,"";
158
    my $hassort1;
148
    my $hassort1;
159
    while (my ($value) =$req->fetchrow) {
149
    while (my ($value) =$req->fetchrow) {
160
        $hassort1 =1 if ($value);
150
        $hassort1 =1 if ($value);
161
        push @select, $value;
151
        push @selects1, $value;
162
    }
152
    }
163
    
153
    my $Sort1 = {
164
    my $CGISort1=CGI::scrolling_list( -name     => 'Filter',
154
        values   => \@selects1,
165
                -id => 'sort1',
155
    };
166
                -values   => \@select,
167
                -size     => 1,
168
                -multiple => 0 );
169
    
156
    
170
    $req = $dbh->prepare("select distinctrow sort2 from borrowers where sort2 is not null order by sort2");
157
    $req = $dbh->prepare("select distinctrow sort2 from borrowers where sort2 is not null order by sort2");
171
    $req->execute;
158
    $req->execute;
172
    undef @select;
159
    my @selects2;
173
    push @select,"";
174
    my $hassort2;
160
    my $hassort2;
175
    my $hglghtsort2;
161
    my $hglghtsort2;
176
    while (my ($value) =$req->fetchrow) {
162
    while (my ($value) =$req->fetchrow) {
177
        $hassort2 =1 if ($value);
163
        $hassort2 =1 if ($value);
178
        $hglghtsort2= !($hassort1);
164
        $hglghtsort2= !($hassort1);
179
        push @select, $value;
165
        push @selects2, $value;
180
    }
166
    }
181
    my $CGISort2=CGI::scrolling_list( -name     => 'Filter',
167
    my $Sort2 = {
182
                -id => 'sort2',
168
        values   => \@selects2,
183
                -values   => \@select,
169
    };
184
                -size     => 1,
185
                -multiple => 0 );
186
    
187
    my $CGIextChoice=CGI::scrolling_list(
188
                -name     => 'MIME',
189
                -id       => 'MIME',
190
                -values   => ['CSV'], # FIXME translation
191
                -size     => 1,
192
                -multiple => 0 );
193
    
170
    
194
    my $CGIsepChoice=GetDelimiterChoices;
171
    my $CGIsepChoice=GetDelimiterChoices;
195
    
172
    
196
    $template->param(
173
    $template->param(
197
                    CGIBorCat    => $CGIBorCat,
174
                    BorCat       => $BorCat,
198
                    CGIItemType  => $CGIItemTypes,
175
                    ItemType     => $ItemTypes,
199
                    branchloop   => GetBranchesLoop(),
176
                    branchloop   => GetBranchesLoop(),
200
                    hassort1     => $hassort1,
177
                    hassort1     => $hassort1,
201
                    hassort2     => $hassort2,
178
                    hassort2     => $hassort2,
202
                    HlghtSort2   => $hglghtsort2,
179
                    HlghtSort2   => $hglghtsort2,
203
                    CGISort1     => $CGISort1,
180
                    Sort1        => $Sort1,
204
                    CGISort2     => $CGISort2,
181
                    Sort2        => $Sort2,
205
                    CGIextChoice => $CGIextChoice,
206
                    CGIsepChoice => $CGIsepChoice
182
                    CGIsepChoice => $CGIsepChoice
207
                    );
183
                    );
208
output_html_with_http_headers $input, $cookie, $template->output;
184
output_html_with_http_headers $input, $cookie, $template->output;
209
- 

Return to bug 14279