Bugzilla – Attachment 92845 Details for
Bug 23626
Add a system preference to limit the number of rows of data used when charting or exporting report results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
New syspref ReportsMaxRowsInChart
new-syspref-ReportsMaxRowsInChart.diff (text/plain), 3.27 KB, created by
Paul Hoffman
on 2019-09-16 19:51:19 UTC
(
hide
)
Description:
New syspref ReportsMaxRowsInChart
Filename:
MIME Type:
Creator:
Paul Hoffman
Created:
2019-09-16 19:51:19 UTC
Size:
3.27 KB
patch
obsolete
>diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 6ce6ee1..78f5bef 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -508,6 +508,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'), > ('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'), > ('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'), >+('ReportsMaxRowsInChart','10000',NULL,'If greater than 0, sets the maximum number of rows that will be used when charting results of guided reports','Integer'), > ('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'), > ('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'), > ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >index de04098..bea40ab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt >@@ -719,6 +719,7 @@ canned reports and writing custom SQL reports.</p> > <h1>[% name | html %]</h1> > [% IF ( notes ) %]<p><span class="label">Notes:</span> [% notes | html %]</p>[% END %] > [% IF ( unlimited_total ) %]<p><span class="label">Total number of results:</span> [% unlimited_total | html %][% IF unlimited_total > limit %] ([% limit | html %] shown)[% END %].</p>[% END %] >+[% IF ( allresults.size == max_rows_in_chart ) %]Data in chart have been limited to [% max_rows_in_chart | html %] rows.[% END %] > > <div id="sql_output" style="display:none;"> > <span class="label">Report SQL:</span> >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index bb4e87e..277e1e5 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -829,6 +829,7 @@ elsif ($phase eq 'Run this report'){ > $template->param(header_types => $header_types); > my ( $sth, $errors ) = execute_query( $sql, $offset, $limit, undef, $report_id ); > my ($sth2, $errors2) = execute_query($sql); >+ my $max_rows = C4::Context->preference('ReportsMaxRowsInChart'); > my $total = nb_rows($sql) || 0; > unless ($sth) { > die "execute_query failed to return sth for report $report_id: $sql"; >@@ -842,6 +843,7 @@ elsif ($phase eq 'Run this report'){ > while (my $row = $sth2->fetchrow_arrayref()) { > my @cells = map { +{ cell => $_ } } @$row; > push @allrows, { cells => \@cells }; >+ last if $max_rows && @allrows >= $max_rows; > } > } > >@@ -857,6 +859,7 @@ elsif ($phase eq 'Run this report'){ > $template->param( > 'results' => \@rows, > 'allresults' => \@allrows, >+ 'max_rows_in_chart' => $max_rows, > 'sql' => $sql, > original_sql => $original_sql, > 'id' => $report_id,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23626
:
92845
|
92904
|
92905
|
92908
|
92909
|
92910
|
92919
|
92920
|
92921
|
92992
|
92994
|
93126
|
93137
|
93204
|
93406
|
93589
|
93720
|
93723
|
93729
|
93914
|
93915
|
93916
|
93981