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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc (-1 / +1 lines)
Lines 34-40 Link Here
34
                        </li>
34
                        </li>
35
35
36
                        <li>
36
                        <li>
37
                            <label for="include-all">Include all rows (ignore pagination):</label>
37
                            <label for="include-all">Fetch additional rows ,up to preference  SvcMaxReportRows ([% Koha.Preference('SvcMaxReportRows') %] ):</label>
38
                            <input id="include-all" name="chart-include-all" type="checkbox" />
38
                            <input id="include-all" name="chart-include-all" type="checkbox" />
39
                        </li>
39
                        </li>
40
40
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-10 / +23 lines)
Lines 1190-1196 canned reports and writing custom SQL reports.</p> Link Here
1190
1190
1191
            [% IF results && !errors %]
1191
            [% IF results && !errors %]
1192
                $('#draw-chart').click(function() {
1192
                $('#draw-chart').click(function() {
1193
                    var results = [];
1194
                    if ($('input[name="chart-include-all"]').prop('checked')) {
1195
                        $.getJSON("/cgi-bin/koha/svc/report?id=[% id %][%- FOREACH param IN sql_params %]&amp;sql_params=[% param | uri %][% END %][%- FOREACH param_name IN param_names %]&amp;param_name=[% param_name | uri %][% END %]",function(data){
1196
                                $.each(data, function(row_index,row_value){
1197
                                    var row = [];
1198
                                    row_value.forEach(function(cell_value,cell_index){
1199
                                        row.push({ cell:  cell_value });
1200
                                    });
1201
1202
                                    results.push({ cells : row });
1203
                                });
1204
                                results.cells = results;
1205
                                drawchart(results);
1206
                            }
1207
                        );
1208
                    }
1209
                    else {
1210
                        results = [% results.json | $raw %];
1211
                        drawchart(results);
1212
                    }
1213
                });
1193
1214
1215
                function drawchart(results){
1194
                    var x_elements = $('select[name="x"]').val();
1216
                    var x_elements = $('select[name="x"]').val();
1195
                    var y_elements = [];
1217
                    var y_elements = [];
1196
                    var groups = [];
1218
                    var groups = [];
Lines 1199-1212 canned reports and writing custom SQL reports.</p> Link Here
1199
1221
1200
                    headers = [% header_row.json | $raw %];
1222
                    headers = [% header_row.json | $raw %];
1201
1223
1202
                    var results;
1203
                    if ($('input[name="chart-include-all"]').prop('checked')) {
1204
                        results = [% allresults.json | $raw %]
1205
                    }
1206
                    else {
1207
                        results = [% results.json | $raw %]
1208
                    }
1209
1210
                    if ($('input[name="chart-exclude-last"]').prop('checked')) {
1224
                    if ($('input[name="chart-exclude-last"]').prop('checked')) {
1211
                        results.splice(-1, 1);
1225
                        results.splice(-1, 1);
1212
                    }
1226
                    }
Lines 1257-1263 canned reports and writing custom SQL reports.</p> Link Here
1257
                    $("#download-chart,#toggle_chart_settings_hid,#chart").show();
1271
                    $("#download-chart,#toggle_chart_settings_hid,#chart").show();
1258
                    $("#toggle_chart_settings_vis").hide();
1272
                    $("#toggle_chart_settings_vis").hide();
1259
                    $("#chartModal").modal("hide");
1273
                    $("#chartModal").modal("hide");
1260
                });
1274
                };
1261
            [% END %]
1275
            [% END %]
1262
            [% IF ( create ) %]
1276
            [% IF ( create ) %]
1263
                load_group_subgroups();
1277
                load_group_subgroups();
1264
- 

Return to bug 23626