Bug 18283 - Display improvements on report results - hide code and change wording
authorNick Clemens <nick@bywatersolutions.com>
Thu, 16 Mar 2017 15:28:29 +0000 (11:28 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 31 Mar 2017 14:07:53 +0000 (14:07 +0000)
This patch makes small display improvements to the report results page.

-Add toggle link for SQL code
-Change results count wording
-Add 'Notes:' label report notes

To test:
1 - Apply patch
2 - Run some reports
3 - Check that results page makes sense
4 - Hide and display code and ensure toggle works

Followed test plan, works as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt

index 0ea3cea..75599fc 100644 (file)
                     <li><a id="ods" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&amp;format=ods&amp;sql=[% sql |uri %]&amp;reportname=[% name |uri %]">Open Document Spreadsheet</a></li>
                 </ul>
             </div>
+            <div class="btn-group">
+                <a class="btn btn-default btn-sm toggle_sql" id="toggle_sql_hid" href="#"><i class="fa fa-eye"></i> Show sql code</a>
+                <a class="btn btn-default btn-sm toggle_sql" id="toggle_sql_vis" href="#" style="display:none;"><i class="fa fa-eye-slash"></i> Hide sql code</a>
+            </div>
         [% END %]
 
     [% END %]
index 62ee1e4..1c02b1c 100644 (file)
@@ -172,6 +172,12 @@ $("#delColumn").on("click",function(){
     });
 [% END %]
 
+    $(".toggle_sql").click(function(){
+        $("#sql_output").toggle();
+        $("#toggle_sql_hid").toggle();
+        $("#toggle_sql_vis").toggle();
+    });
+
     $("#table_reports").delegate(".confirmdelete", 'click', function(){
         $(this).parents('tr').attr("class","warn");
         if(confirm(_("Are you sure you want to delete this saved report?"))){
@@ -826,9 +832,10 @@ canned reports and writing custom SQL reports.</p>
 
 [% IF ( execute ) %]
 <h1>[% name %]</h1>
-[% IF ( notes ) %]<p>[% notes %]</p>[% END %]
-[% IF ( unlimited_total ) %]<p>Total number of rows matching the (unlimited) query is [% unlimited_total %].</p>[% END %]
-<pre id="sql_output">[% sql |html %]</pre>
+[% IF ( notes ) %]<p><span class="label">Notes:</span> [% notes %]</p>[% END %]
+[% IF ( unlimited_total ) %]<p><span class="label">Total number of results:</span> [% unlimited_total %][% IF unlimited_total > limit %] ([% limit %] shown)[% END %].</p>[% END %]
+<div id="sql_output" style="display:none;"><span class="label">Report SQL:</span><pre>[% sql |html %]</pre></div>
+</br>
 
 <form action="/cgi-bin/koha/reports/guided_reports.pl" method="get" id="limitselect">
     <input type="hidden" name="phase" value="Run this report"/>