coar        97/06/06 05:01:36

  Modified:    .         bugdb.cgi
  Log:
        Some serious enhancements:
  
        o ability to search header or content fields
        o ability to add comments when editing w/o having to change PR state
        o PR number now in title bar on more screens
        o subject of edit notification now matches GNATS' expectations
          so replies to users can just add apbugs w/o having to edit
          the subject too
  
  Reviewed by:  Roy Fielding, Marc Slemko
  
  Revision  Changes    Path
  1.6       +54 -15    apache-site/bugdb.cgi
  
  Index: bugdb.cgi
  ===================================================================
  RCS file: /export/home/cvs/apache-site/bugdb.cgi,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -C3 -r1.5 -r1.6
  *** bugdb.cgi 1997/05/27 05:23:43     1.5
  --- bugdb.cgi 1997/06/06 12:01:35     1.6
  ***************
  *** 174,180 ****
    ### Main menu
    } elsif ($PATH_INFO eq "") {
        &main_menu();
  !     print "<HR><SMALL>Version: 1 May 1997<BR>Authors: ",
        "<A HREF=\"http://alumni.caltech.edu/~dank\";>Dan Kegel</A> ",
            "[EMAIL PROTECTED] &amp; ",
        "<A HREF=\"http://alumni.caltech.edu/~huyle/\";>Huy Le</A> ",
  --- 174,180 ----
    ### Main menu
    } elsif ($PATH_INFO eq "") {
        &main_menu();
  !     print "<HR><SMALL>Version: 6 June 1997<BR>Authors: ",
        "<A HREF=\"http://alumni.caltech.edu/~dank\";>Dan Kegel</A> ",
            "[EMAIL PROTECTED] &amp; ",
        "<A HREF=\"http://alumni.caltech.edu/~huyle/\";>Huy Le</A> ",
  ***************
  *** 448,463 ****
    
    # Sends the PR changes
    sub handle_edit_pr {
        # Display title
  !     print "<head><title>Problem Report editing</title></head>
    <body>
    ";
        # Initialization
        $errmsg="<H3>Your problem report changes have not been sent.</H3>\n";
    
  -     # Get the PR, editor, old state, and timestamp
  -     local($pr, $oldstate, $timestamp) = @_;
  - 
        # Get arguments
        local($_)=scalar(<STDIN>);
        chop; s/\r$//;
  --- 448,463 ----
    
    # Sends the PR changes
    sub handle_edit_pr {
  +     # Get the PR, editor, old state, and timestamp
  +     local($pr, $oldstate, $timestamp) = @_;
  + 
        # Display title
  !     print "<head><title>Problem Report editing for PR#$pr</title></head>
    <body>
    ";
        # Initialization
        $errmsg="<H3>Your problem report changes have not been sent.</H3>\n";
    
        # Get arguments
        local($_)=scalar(<STDIN>);
        chop; s/\r$//;
  ***************
  *** 465,471 ****
        foreach (split(/&/)) {
            ++$i;
            local($key,$value)=split(/=/);
  !         $input{$key}=&cgi_trans($value);
        }
    
        # Verify arguments
  --- 465,483 ----
        foreach (split(/&/)) {
            ++$i;
            local($key,$value)=split(/=/);
  !         $value=&cgi_trans($value);
  !     if ($fieldnames_multi{$key} > 0) {
  !         #
  !         # Convert any CR-LFs or CRs to \n (different browsers use
  !         # different line terminators).
  !         #
  !         $value =~ s/\r\n/\n/g;
  !         $value =~ s/\r/\n/g;
  !         if ($value !~ /\n$/) {
  !             $value .= "\n";
  !         }
  !     }
  !     $input{$key}=$value;
        }
    
        # Verify arguments
  ***************
  *** 537,542 ****
  --- 549,563 ----
    ";
            $to_old = $to_subm = 1;
            $fieldvalues{'State'} = $input{'State'};
  +     } elsif ($input{'StateReason'} ne "") {
  +         $change_msg .= 
  + "Comment-Added-By: $input{'Editor'}
  + Comment-Added-When: $date
  + Comment-Added:
  + $input{'StateReason'}
  + ";
  +         $to_old = $to_subm = 1;
  +         $fieldvalues{'State'} = $input{'State'};
        }
    
        if ($input{"Class"} ne $fieldvalues{'Class'}) {
  ***************
  *** 659,665 ****
            $msg = 
    "To: $mail_to
    From: $input{'Editor'}
  ! Subject: Changed information for PR $semipr
    
    Synopsis: $oldsyn
    
  --- 680,686 ----
            $msg = 
    "To: $mail_to
    From: $input{'Editor'}
  ! Subject: Re: $semipr: $oldsyn
    
    Synopsis: $oldsyn
    
  ***************
  *** 685,694 ****
    # Gives the interface to change the PR
    sub edit_pr
    {
        # Display title
  !     print "<HEAD><TITLE>Problem Report editing</TITLE></HEAD><BODY>\n";
    
  -     $pr = $_[0];
        if ($pr eq "") {
        print "<H3>Sorry</H3>\n";
        print "You must specify the number of the problem report to edit.\n";
  --- 706,716 ----
    # Gives the interface to change the PR
    sub edit_pr
    {
  +     $pr = $_[0];
  + 
        # Display title
  !     print "<HEAD><TITLE>Problem Report editing for 
PR#$pr</TITLE></HEAD><BODY>\n";
    
        if ($pr eq "") {
        print "<H3>Sorry</H3>\n";
        print "You must specify the number of the problem report to edit.\n";
  ***************
  *** 763,769 ****
        print "> $option\n";
        }
        print 
  ! "</SELECT><BR><dt>If state changed, give the reason here:<dd><TEXTAREA 
NAME=\"StateReason\" COLS=$width ROWS=$height></TEXTAREA>";
    
        print "<dt>New category:\n";
        print "<dd>";
  --- 785,793 ----
        print "> $option\n";
        }
        print 
  ! "</SELECT><BR><dt>If state changed, give the reason here.
  ! To add a comment to the case, enter text here without changing the
  ! state:<dd><TEXTAREA NAME=\"StateReason\" COLS=$width 
ROWS=$height></TEXTAREA>";
    
        print "<dt>New category:\n";
        print "<dd>";
  ***************
  *** 860,865 ****
  --- 884,899 ----
        if ($oldval ne "") {
        $restrict{$oldkey} = $oldval;
        }
  +     #
  +     # Now let's remove form-fields that don't equate to GNATS-fields.
  +     #
  +     $oldval = $restrict{"search"};
  +     if ($oldval && $restrict{"qstring"}) {
  +     $restrict{$oldval} = $restrict{"qstring"};
  +     }
  +     delete $restrict{"string"};
  +     delete $restrict{"qstring"};
  +     delete $restrict{"search"};
        local($opts);
        local(@prs);
        # Read in quick format list of pr's matching query
  ***************
  *** 1227,1235 ****
        if ($_ eq "State") {
            $mode = "SIZE=". eval"[EMAIL PROTECTED]";
            $mode .= " MULTIPLE";
  !         $separator = "<td>";
        }
        print "$separator $_:\n";
            print "<SELECT $mode NAME=\"$_\">\n";
        # Refer to arrays @nCategory, @nState, @nResponsible as appropriate.
        # Note use of eval.
  --- 1261,1270 ----
        if ($_ eq "State") {
            $mode = "SIZE=". eval"[EMAIL PROTECTED]";
            $mode .= " MULTIPLE";
  !         $separator = "</td>\n<td>";
        }
        print "$separator $_:\n";
  +     print "<BR>\n" if ($_ eq "State");
            print "<SELECT $mode NAME=\"$_\">\n";
        # Refer to arrays @nCategory, @nState, @nResponsible as appropriate.
        # Note use of eval.
  ***************
  *** 1240,1251 ****
            print "</SELECT><BR>\n";
        }
        print <<EOM;
  ! </TABLE>
  ! <P>
    and/or specifying a
    <a href="$GNUINFOSCRIPT?(gnats)Regexps">freeform text search</a> on 
  ! <a href="$GNUINFOSCRIPT?(gnats)Fields">any field</a>:
  ! <INPUT NAME="multitext" SIZE="32">
    <P>
    <INPUT TYPE="submit" VALUE="Search the bug database">
    </FORM>
  --- 1275,1290 ----
            print "</SELECT><BR>\n";
        }
        print <<EOM;
  ! </TD>
  ! <TD>
    and/or specifying a
    <a href="$GNUINFOSCRIPT?(gnats)Regexps">freeform text search</a> on 
  ! <a href="$GNUINFOSCRIPT?(gnats)Fields">any field</a>:</BR>
  ! <INPUT TYPE="radio" NAME="search" VALUE="text"> Header fields<BR>
  ! <INPUT TYPE="radio" NAME="search" VALUE="multitext" CHECKED> Report text<BR>
  ! <INPUT TYPE="text" NAME="qstring" SIZE=24>
  ! </TD></TR>
  ! </TABLE>
    <P>
    <INPUT TYPE="submit" VALUE="Search the bug database">
    </FORM>
  
  
  

Reply via email to