This is the mail archive of the gnats-devel@sources.redhat.com mailing list for the GNATS project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: Prevent 'number' from appearing twice in Gnatsweb Query Results


The following patch provides a workaround for the problem which causes the 
Number column to appear twice in the Query Results table.

Yngve Svendsen
IS Engineer
Clustra AS, Trondheim, Norway
yngve.svendsen@clustra.com


2001-04-05  Yngve Svendsen  <yngve.svendsen@clustra.com>

         * gnatsweb.pl (query_page): Shift 'number' out of the array of
           selectable column names (@fieldnames) to prevent user from
           selecting it. That would cause the 'number' column to be
           repeated twice, since NUMBER_FIELD is explicitly added to the
           search format in submitquery. The best solution would be to
           remove the explicit addition, but that messes up column sorting.
           However, since the only drawback of the current fix is that we
           force the inclusion of PR numbers in the query results listing,
           this doesn't seem to matter much.



Index: gnatsweb.pl
===================================================================
RCS file: /cvs/gnats/gnats/contrib/gnatsweb/gnatsweb.pl,v
retrieving revision 2.32
diff -u -p -r2.32 gnatsweb.pl
--- gnatsweb.pl	2001/04/04 23:06:09	2.32
+++ gnatsweb.pl	2001/04/05 00:16:51
@@ -1378,6 +1378,13 @@ sub query_page
          "</td>\n</tr>\n",
  	"<tr valign=top>\n<td>Column Display:</td>\n<td>";

+  # 30/Mar/2001 yngves
+  # The 'number' field is always first in the @fieldnames array.
+  # If users were allowed to select it in this list, the PR number
+  # would appear twice in the Query Results table. We prevent this
+  # by shifting 'number' out of the array.
+  shift(@fieldnames);
+
    my @lcfields;
    foreach (@fieldnames)
    {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]