help-gnats
[Top][All Lists]
Advanced

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

Re: Patch: Required fields on inital PR creation


From: Yngve Svendsen
Subject: Re: Patch: Required fields on inital PR creation
Date: Sun, 27 Oct 2002 12:15:02 +0100

At 00:13 27.10.2002 +0200, Yngve Svendsen wrote:
Now, we need a way for clients to get the "initial-entry required" stuff from gnatsd. Gnatsweb should for instance be able to mark required fields on the Create PR page. I have cooked up a 20-liner that should take care of this, implementing "LIST InitialRequiredFields".

Here it comes. As I said, it implements an "InitialRequiredFields" argument for the gnatsd LIST command.

I need this in order to make marking of required fields work in Gnatsweb, so unless there are serious protests, I'll apply it tomorrow, also taking care of the associated docs.

- Yngve

Index: lists.c
===================================================================
RCS file: /cvsroot/gnats/gnats/gnats/lists.c,v
retrieving revision 1.19
diff -u -p -r1.19 lists.c
--- lists.c     4 Dec 2001 20:04:43 -0000       1.19
+++ lists.c     27 Oct 2002 11:10:12 -0000
@@ -37,6 +37,7 @@ struct list_type_list {
   { "States",             ListStates,             ".sta", "state" },
   { "FieldNames",         ListFieldNames,         ".fns", NULL },
   { "InitialInputFields", ListInitialInputFields, ".lfn", NULL },
+  { "InitialRequiredFields", ListInitialRequiredFields, ".lrn", NULL },
   { "Databases",          ListDatabases,          ".dbl", NULL },
   { NULL,                InvalidListType,        NULL,   NULL }
 };
@@ -142,6 +143,16 @@ getGnatsFile (const DatabaseInfo databas
          {
            FieldDef field = fieldDefForIndex (t->index);
            fprintf (fpout, "%s\n", field->name);
+         }
+       break;
+      }
+    case ListInitialRequiredFields:
+      {
+       FieldList fields = getRequiredInputFields(database);
+       while (fields != NULL)
+         {
+           fprintf (fpout, "%s\n", complexFieldIndexToString (fields->ent));
+           fields = fields->next;
          }
        break;
       }
Index: query.h
===================================================================
RCS file: /cvsroot/gnats/gnats/gnats/query.h,v
retrieving revision 1.36
diff -u -p -r1.36 query.h
--- query.h     10 Feb 2002 18:24:02 -0000      1.36
+++ query.h     27 Oct 2002 11:10:12 -0000
@@ -28,7 +28,8 @@ struct re_pattern_buffer;
 typedef enum e_lists {
   InvalidListType = -1,
   ListCategories = 0, ListSubmitters, ListResponsible, ListStates,
-  ListFieldNames,  ListInitialInputFields, ListDatabases
+  ListFieldNames,  ListInitialInputFields, ListInitialRequiredFields,
+  ListDatabases
 } ListTypes;

/* The four operations to perform. */




reply via email to

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