public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* Patch: Fix to require Reason Changed in Gnatsweb
@ 2001-04-22 13:51 Yngve Svendsen
  0 siblings, 0 replies; only message in thread
From: Yngve Svendsen @ 2001-04-22 13:51 UTC (permalink / raw)
  To: gnats-devel

The current Gnatsweb (rev 2.33 plus the patch from Dirk) does not check 
that the required Reason Changed fields are filled in when a PR is edited. 
The following patch fixes this. It will be committed once things calm down 
after the patch from Dirk has been applied.

Dirk: Do you have any ETA on when the copyright paperwork will be finished?

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





*** gnatsweb.pl	Sun Apr 22 22:40:55 2001
--- gnatsweb_changed.pl	Sun Apr 22 22:37:51 2001
***************
*** 1503,1508 ****
--- 1503,1529 ----
         }
       }

+ 	# Check whether fields that are specified in dbconfig as requiring a
+ 	# 'Reason Changed' have the reason specified:
+ 	foreach my $fieldname (keys %fields)
+ 	{
+ 	  if ( ($fields{$fieldname} ne $oldfields{$fieldname}) && 
(fieldinfo($fieldname, 'flags') & $REASONCHANGE) )
+ 	  {
+ 		if($fields{$fieldname."-Changed-Why"} =~ /^\s*$/)
+ 		{
+ 		  page_heading($page, 'Error');
+ 		  print "<h3>Field '$fieldname' must have a reason for change</h3>",
+ 		  "<p>Please press the 'Back' button of you browser, correct the 
problem and resubmit.</p>\n";
+ 		  last LOCKED;
+ 		}
+ 	  }
+ 	  if ($fields{$fieldname} eq $oldfields{$fieldname} && exists 
$fields{$fieldname."-Changed-Why"} )
+ 	  {
+ 		delete $fields{$fieldname."-Changed-Why"};
+ 	  }
+ 	}
+
+
       my($newpr) = unparsepr('gnatsd', %fields);
       $newpr =~ s/\r//g;
   

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-04-22 13:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-22 13:51 Patch: Fix to require Reason Changed in Gnatsweb Yngve Svendsen

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).