]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 180205 - General reporting fixes. Fixes bug 180151 (Grand total links are messed...
authorgerv%gerv.net <>
Mon, 18 Nov 2002 07:56:25 +0000 (07:56 +0000)
committergerv%gerv.net <>
Mon, 18 Nov 2002 07:56:25 +0000 (07:56 +0000)
report.cgi
template/en/default/reports/report-table.html.tmpl
template/en/default/search/form.html.tmpl
template/en/default/search/search-advanced.html.tmpl
template/en/default/search/search-report-select.html.tmpl
template/en/default/search/search.html.tmpl

index 5680ec466414ede30710c46352d7ccc7cc67cf5c..c532d523dde1a93829bc610a934257df24f461b8 100755 (executable)
@@ -28,6 +28,14 @@ require "CGI.pl";
 
 use vars qw($cgi $template $vars);
 
+# Go straight back to query.cgi if we are adding a boolean chart.
+if (grep(/^cmd-/, $cgi->param())) {
+    my $params = $cgi->canonicalise_query("format", "ctype");
+    print "Location: query.cgi?format=" . $cgi->param('query_format') . 
+                                           ($params ? "&$params" : "") . "\n\n";
+    exit;
+}
+
 use Bugzilla::Search;
 
 ConnectToDatabase();
@@ -216,10 +224,18 @@ if ($action eq "wrap") {
     $vars->{'format'} = $formatparam;
     $formatparam = '';
 
+    # We need to keep track of the defined restrictions on each of the 
+    # axes, because buglistbase, below, throws them away. Without this, we
+    # get buglistlinks wrong if there is a restriction on an axis field.
+    $vars->{'col_vals'} = join("&", $::buffer =~ /[&?]($col_field=[^&]+)/g);
+    $vars->{'row_vals'} = join("&", $::buffer =~ /[&?]($row_field=[^&]+)/g);
+    $vars->{'tbl_vals'} = join("&", $::buffer =~ /[&?]($tbl_field=[^&]+)/g);
+    
     # We need a number of different variants of the base URL for different
     # URLs in the HTML.
     $vars->{'buglistbase'} = $cgi->canonicalise_query(
-        "x_axis_field", "y_axis_field", "z_axis_field", "format", @axis_fields);
+                                 "x_axis_field", "y_axis_field", "z_axis_field",
+                                               "ctype", "format", @axis_fields);
     $vars->{'imagebase'}   = $cgi->canonicalise_query( 
                     $tbl_field, "action", "ctype", "format", "width", "height");
     $vars->{'switchbase'}  = $cgi->canonicalise_query( 
@@ -249,11 +265,11 @@ print "Content-Type: $format->{'ctype'}\n\n";
 # Problems with this CGI are often due to malformed data. Setting debug=1
 # prints out both data structures.
 if ($::FORM{'debug'}) {
-    use Data::Dumper;
+    require Data::Dumper;
     print "<pre>data hash:\n";
-    print Dumper(%data) . "\n\n";
+    print Data::Dumper::Dumper(%data) . "\n\n";
     print "data array:\n";
-    print Dumper(@image_data) . "\n\n</pre>";
+    print Data::Dumper::Dumper(@image_data) . "\n\n</pre>";
 }
 
 $template->process("$format->{'template'}", $vars)
index 5074484c36833e5836c7d4a3b619ec3c3a8766eb..e984dc6ae3101263c74777e38596ddd8f73c256d 100644 (file)
@@ -37,7 +37,8 @@
 [% row_field_disp = field_descs.$row_field || row_field %]
   
 [% IF tbl == "-total-" %]
-  [% urlbase = BLOCK %]buglist.cgi?[% buglistbase %][% END %]
+  [% urlbase = BLOCK %]buglist.cgi?[% buglistbase %]
+  [% "&amp;$tbl_vals" IF tbl_vals %][% END %]
 [% ELSE %]
   [% urlbase = BLOCK %]buglist.cgi?[% buglistbase %]&amp;
   [% tbl_field FILTER url_quote %]=[% tbl FILTER url_quote %][% END %]
       [% END %] 
       <td class="ttotal" align="right">
         <a href="[% urlbase %]&amp;
-          [% row_field FILTER url_quote %]=[% row FILTER url_quote %]">
+          [% row_field FILTER url_quote %]=[% row FILTER url_quote %]
+          [% "&amp;$col_vals" IF col_vals %]">
         [% row_total %]</a>
         [% grand_total = grand_total + row_total %]
       </td>
       
       <td class="ttotal" align="center">
         <a href="[% urlbase %]&amp;
-          [% col_field FILTER url_quote %]=[% col FILTER url_quote %]">
+          [% col_field FILTER url_quote %]=[% col FILTER url_quote %]
+          [% "&amp;$row_vals" IF row_vals %]">
         [% col_totals.$col %]</a>
       <strong>
       </td> 
     [% END %]
     <td class="ttotal" align="right">
       <strong>
-        <a href="buglist.cgi?[% urlbase %]">[% grand_total %]</a>
+        <a href="[% urlbase %]
+          [% "&amp;$row_vals" IF row_vals %]
+          [% "&amp;$col_vals" IF col_vals %]">[% grand_total %]</a>
       </strong>
     </td>
   </tr>
index a24772c31d45f48ca8617641a3bf66d072f54346..2f95748ed612181119dfc5bd25a7e51826ca5094 100644 (file)
@@ -329,6 +329,9 @@ function selectProduct(f) {
 
 [% PROCESS "global/field-descs.html.tmpl" %]
 
+[%# If we resubmit to ourselves, we need to know if we are using a format. %]
+<input type="hidden" name="query_format" value="[% format %]">
+
 [%# *** Summary *** %]
 
 <table>
index d1614ae3a6c1e08c420c527b13a8221062589968..4dd1972183106283586691e1a66894b54d360d22 100644 (file)
@@ -33,8 +33,6 @@
 [% button_name = "Search" %]
 
 <form method="get" action="buglist.cgi" name="queryform">
-  [%# If we resubmit to ourselves, we need to know if we are using a format. %]
-  <input type="hidden" name="query_format" value="[% format %]">
   
 [% PROCESS search/form.html.tmpl %]
 
index 75716eac7b767af90bafce8c7d137b9c4e4d4e33..9af620d3417200a2339334ac4924866024810607 100644 (file)
 [% PROCESS "global/field-descs.html.tmpl" %]
 
 [% BLOCK select %]
-  [% fields = ["product", "component", "version", "rep_platform",  
-               "op_sys", "bug_status", "resolution", "bug_severity", 
-               "priority", "target_milestone", "keywords", "assigned_to",
-               "reporter", "qa_contact", "votes" ] %]
+  [% rep_fields = ["product", "component", "version", "rep_platform",  
+                   "op_sys", "bug_status", "resolution", "bug_severity", 
+                   "priority", "target_milestone", "assigned_to",
+                   "reporter", "qa_contact", "votes" ] %]
 
   <select name="[% name FILTER html %]">
     <option value="">&lt;none&gt;</option>
     
-    [% FOREACH field = fields %]
+    [% FOREACH field = rep_fields %]
       [% NEXT IF field == "target_milestone" AND !Param('usetargetmilestone') %]
       [% NEXT IF field == "qa_contact" AND !Param('useqacontact') %]
       [% NEXT IF field == "votes" AND !Param('usevotes') %]      
index d1614ae3a6c1e08c420c527b13a8221062589968..4dd1972183106283586691e1a66894b54d360d22 100644 (file)
@@ -33,8 +33,6 @@
 [% button_name = "Search" %]
 
 <form method="get" action="buglist.cgi" name="queryform">
-  [%# If we resubmit to ourselves, we need to know if we are using a format. %]
-  <input type="hidden" name="query_format" value="[% format %]">
   
 [% PROCESS search/form.html.tmpl %]