public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* Patch for gnatsweb.pl
@ 2002-09-16  6:48 Robert Lupton the Good
  2002-09-17  9:47 ` Yngve Svendsen
  2002-09-23 12:22 ` Lars Henriksen
  0 siblings, 2 replies; 14+ messages in thread
From: Robert Lupton the Good @ 2002-09-16  6:48 UTC (permalink / raw)
  To: help-gnats


(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=>\@lcfields,
                             -defaults=>\@columns,
                             -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=>\@lcfields,
                             -defaults=>\@columns,
                             -multiple=>1),
!         "<tr valign=top>\n<td>Sort By:</td>\n<td>",
!         $q->scrolling_list(-name=>'sortby',
!                            -values=>\@sortfields,
!                            -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']),


_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Patch for gnatsweb.pl
@ 2002-09-16  6:46 Robert Lupton the Good
  0 siblings, 0 replies; 14+ messages in thread
From: Robert Lupton the Good @ 2002-09-16  6:46 UTC (permalink / raw)
  To: help-gnats


(This is my `patch.3a')

This patch prints a header if needed when debug=all statements (this
is sometimes needed)

				R

	

*** gnatsweb.pl	Wed Sep 11 14:06:11 2002
--- /u/dss/cgi-bin/gnatsweb-v4.pl	Wed Sep 11 14:10:10 2002
***************
*** 357,363 ****
  {
    my($state, $text, $type);
    my $raw_reply = <SOCK>;
!   print "<tt>server_reply: $_</tt><br>\n" if defined($reply_debug);
    if($raw_reply =~ /(\d+)([- ]?)(.*$)/)
    {
      $state = $1;
--- 357,367 ----
  {
    my($state, $text, $type);
    my $raw_reply = <SOCK>;
!   if(defined($reply_debug))
!   {
!     print_header();
!     print "<tt>server_reply: $raw_reply</tt><br>\n";
!   }
    if($raw_reply =~ /(\d+)([- ]?)(.*$)/)
    {
      $state = $1;
***************
*** 389,395 ****
  
    while(<SOCK>)
    {
!     print "<tt>read_server: $_</tt><br>\n" if defined($reply_debug);
      if(/^\.\r/)
      {
        return @text;
--- 393,404 ----
  
    while(<SOCK>)
    {
!     if(defined($reply_debug))
!     {
!       print_header();
!       print "<tt>read_server: $_</tt><br>\n";
!     }
! 
      if(/^\.\r/)
      {
        return @text;
***************
*** 703,710 ****
    my $debug = 0;
    print SOCK "$cmd\n";
    warn "client_cmd: $cmd" if $debug;
!   print "<br><tt>client_cmd: <pre>$cmd</pre></tt><br>\n"
!         if defined($client_cmd_debug);
    return get_reply();
  }
  
--- 712,722 ----
    my $debug = 0;
    print SOCK "$cmd\n";
    warn "client_cmd: $cmd" if $debug;
!   if(defined($client_cmd_debug))
!   {
!     print_header();
!     print "<br><tt>client_cmd: <pre>$cmd</pre></tt><br>\n";
!   }
    return get_reply();
  }
  


_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

^ permalink raw reply	[flat|nested] 14+ messages in thread
* patch for gnatsweb.pl
@ 2001-09-06 14:09 David, Lysander
  0 siblings, 0 replies; 14+ messages in thread
From: David, Lysander @ 2001-09-06 14:09 UTC (permalink / raw)
  To: 'gnats-devel@sources.redhat.com'

Hi,

When there is an gnats error, while submitting a pr,
the error message doesn't get returned.  Here is a patch to fix it.
I am using gnatsweb 2.8.2.

diff gnatsweb.pl gnatsweb.pl.new
1185c1185,1191
<       print_gnatsd_error($gnats::ERRSTR);
---
> 		my $page = "Error";
> 		print_header();
> 		page_start_html ( $page );
> 		page_heading ( $page, "GNATS Error" );
> 		print_gnatsd_error($gnats::ERRSTR);
> 		page_footer ( $page );
> 		page_end_html ( $page );


Thanks,
Lysander

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2002-09-29 19:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20020915103254.22538.88942.Mailman@monty-python.gnu.org>
2002-09-16  6:56 ` Patch for gnatsweb.pl Robert Lupton the Good
2002-09-16  7:24 ` patch " Robert Lupton the Good
2002-09-16  7:45 ` Robert Lupton the Good
2002-09-16  6:48 Patch " Robert Lupton the Good
2002-09-17  9:47 ` Yngve Svendsen
2002-09-23 12:22 ` Lars Henriksen
2002-09-25 11:18   ` Lars Henriksen
2002-09-25 11:43     ` Yngve Svendsen
2002-09-25 13:13       ` Lars Henriksen
2002-09-26 15:46         ` Robert Lupton the Good
2002-09-27  0:32         ` Robert Lupton the Good
2002-09-30  2:07         ` Lars Henriksen
  -- strict thread matches above, loose matches on Subject: below --
2002-09-16  6:46 Robert Lupton the Good
2001-09-06 14:09 patch " David, Lysander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).