help-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for gnatsweb.pl


From: Robert Lupton the Good
Subject: Patch for gnatsweb.pl
Date: Mon, 16 Sep 2002 09:41:21 -0400

(This is my `patch.3b')

I'd be happy to check these straight into cvs if given permission...


This patch:

        1/ requires exact matches for field names selected using
scrolling lists.  For example, we have a "Scheduled" field that
has entries "approved" and "notapproved"; without this patch
selecting "approved" gets "notapproved" too.  The reason is that
gnatsweb uses a ~ match in its query, and this seems reasonable.

This patch adds explicit "^" and "$" to the fields, and then
adds code so that the user doesn't see them (Note: this doesn't
work very elegantly with my "load stored query" patch that
I sent to the list a few days ago.  This problem is fixed in
a later patch that I'll send today).


        2/ Adds a field to the advanced query so that the
user can choose which field to sort on.  This includes support
for my "custom query" patch of a few days ago (but will work
even without it)


                                        R


*** gnatsweb.pl Mon Sep 16 09:33:23 2002
--- ../gnatsweb.pl-3    Wed Sep 11 14:11:32 2002
***************
*** 2023,2031 ****
--- 2023,2035 ----
      {
        my $ary_ref = fieldinfo($_, 'values');
        my $size = scalar(@$ary_ref);
+       my %ary_ref_names;
+       foreach (@$ary_ref) { $ary_ref_names{"^$_\$"} = "$_"; }
+       @$ary_ref = map {"^$_\$"} @$ary_ref; # require exact matches
        $size = 4 if $size > 4;
        print $q->scrolling_list(-name=>$lc_fieldname,
                                 -values=>$ary_ref,
+                              -labels=>\%ary_ref_names,
                                 -multiple=>1,
                                 -size=>$size);
      }
***************
*** 2065,2070 ****
--- 2069,2080 ----
    {
      @columns = @lcfields;
    }
+ 
+   my(@sortfields) = @lcfields;
+   unshift @sortfields, "PR";
+   unshift @sortfields, "custom"
+       if(cb('sort_query', 'custom', 'checking_if_custom_sort_exists'));
+ 
    print "<table border=1 cellspacing=0 bgcolor=$cell_bg>\n",
          "<caption>Display</caption>\n",
          "<tr valign=top>\n<td>Display these columns:</td>\n<td>",
***************
*** 2072,2078 ****
                             -values=>address@hidden,
                             -defaults=>address@hidden,
                             -multiple=>1),
!     "</td>\n</tr>\n<tr>\n<td colspan=2>",
          $q->checkbox_group(-name=>'displaydate',
                           -values=>['Display Current Date'],
                           -defaults=>['Display Current Date']),
--- 2082,2093 ----
                             -values=>address@hidden,
                             -defaults=>address@hidden,
                             -multiple=>1),
!         "<tr valign=top>\n<td>Sort By:</td>\n<td>",
!         $q->scrolling_list(-name=>'sortby',
!                            -values=>address@hidden,
!                            -multiple=>0,
!                          -size=>1),
!         "</td>\n</tr>\n<tr>\n<td colspan=2>",
          $q->checkbox_group(-name=>'displaydate',
                           -values=>['Display Current Date'],
                           -defaults=>['Display Current Date']),




reply via email to

[Prev in Thread] Current Thread [Next in Thread]