public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* Re: Removed lines in responsible
       [not found] ` <5.1.0.14.2.20021014210535.04654818@ms-etro01-01.norway>
@ 2002-10-24  4:29   ` Lars Henriksen
  2002-10-27 13:48     ` Yngve Svendsen
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Henriksen @ 2002-10-24  4:29 UTC (permalink / raw)
  To: Yngve Svendsen; +Cc: Dieperink Alwin, 'help-gnats@gnu.org'

On Mon, Oct 14, 2002 at 09:06:55PM +0200, Yngve Svendsen wrote:
> This is a known problem in Gnatsweb 3.99.3. We hope to have it fixed in a 
> week or so (I have been promised a patch).

Here is a proposal for a solution to the problems gnatsweb has with entries
that have been removed from the responsible file. See also my previous email
in this thread.

It is a general solution for all unknown enumeration type values, not just
responsible. The solution leaves the gnatsweb query format unchanged, i.e.
enumeration values are still returned as integers. The value "unknown" is
introduced and used whenever an enumeration value cannot be displayed, whether
in a query result or on the Edit page. The solution is selfcontained and
requires no changes to dbconfig or files that define enumeration types.
It does not take multienumeration types into account.

The net effect is that for enumeration type values which are undefined,
"unknown" is displayed in query results and is preselected in drop-down menues
on the Edit page (thus forcing an explicit change).

The responsible field is special in that any value is allowed (see dbconfig,
though I am not sure that allow-any-value really is needed). In submitedit()
I have inserted specific checks for "unknown" similar to those in
validate_new_pr() and have removed a check that I don't understand (for a blank
user or responsible). This allows for an entry in the responsible file like

unknown:The name is not in the responsible file - use "view" to see it.:gnats-admin

Finally, "unknown" is preselected as Category on the Create page. This is not
related to the other changes. It forces users to select a category. Experience
shows that users often forget to do so; the new PR is then created in the
default category (pending, the first category in the categories file).

Patch follows.

Regards
Lars Henriksen

Index: gnatsweb.pl
===================================================================
RCS file: /cvsroot/gnatsweb/gnatsweb/gnatsweb.pl,v
retrieving revision 1.110
diff -u -r1.110 gnatsweb.pl
--- gnatsweb.pl	14 Oct 2002 23:02:31 -0000	1.110
+++ gnatsweb.pl	24 Oct 2002 11:16:56 -0000
@@ -1069,6 +1069,11 @@
 
     if (fieldinfo($_, 'fieldtype') eq "enum")
     {
+      # Force choice of category.
+      if ($_ eq $CATEGORY_FIELD) {
+        push(@values, "unknown") if (!grep /^unknown$/, @values);
+        $default = "unknown";
+      }
       print popup_or_scrolling_menu($_, @values, $default),
             "</td>\n</tr>\n";
     }
@@ -1562,7 +1567,13 @@
 
     if (fieldinfo ($_, 'fieldtype') eq 'enum')
     {
-      print popup_or_scrolling_menu($_, @values, $fields{$_}),
+      my $default = $fields{$_};
+      # Check whether field value is a known enumeration value.
+      if (!grep /^$default$/, @values) {
+        push(@values, 'unknown') if (!grep /^unknown$/, @values);
+        $default = 'unknown';
+      }
+      print popup_or_scrolling_menu($_, \@values, $default),
             "</td>\n</tr>\n";
     }
     elsif (fieldinfo ($_, 'fieldtype') eq 'multienum')
@@ -1724,11 +1735,20 @@
       last LOCKED;
     }
 
-    if($db_prefs{'user'} eq "" || $fields{$RESPONSIBLE_FIELD} eq "")
-    {
-# dtb this appears to make it impossible to edit a PR with a blank
-# Responsible field.  this might not be the right thing to do...
-      error_page("Responsible party is '$fields{$RESPONSIBLE_FIELD}', user is '$db_prefs{'user'}'");
+    my (@errors) = ();
+    if ($fields{$RESPONSIBLE_FIELD} eq "unknown") {
+      push(@errors, "$RESPONSIBLE_FIELD is 'unknown'");
+    }
+    if ($fields{$CATEGORY_FIELD} eq "unknown") {
+      push(@errors, "$CATEGORY_FIELD is 'unknown'.");
+    }
+    if($fields{$SUBMITTER_ID_FIELD} eq "unknown") {
+      push(@errors, "$SUBMITTER_ID_FIELD is 'unknown'.");
+    }
+    if (@errors) {
+      push(@errors,
+           "Go back to the edit form, correct the errors and submit again.");
+      error_page("The PR has not been submitted.", \@errors);
       last LOCKED;
     }
 
@@ -2432,7 +2452,9 @@
       if ($fieldtypes[$whichfield] eq 'enum')
       {
         my $enumvals = fieldinfo($columns[$whichfield], 'values');
-        $fieldcontents = $$enumvals[$fieldcontents - 1] || 'invalid';
+	# A zero means that the string is absent from the enumeration type.
+        $fieldcontents =
+	  $fieldcontents ? $$enumvals[$fieldcontents - 1] : 'unknown';
       }
       $fieldcontents = $q->escapeHTML($fieldcontents);
       $fieldcontents = nonempty($fieldcontents);


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

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

* Re: Removed lines in responsible
  2002-10-24  4:29   ` Removed lines in responsible Lars Henriksen
@ 2002-10-27 13:48     ` Yngve Svendsen
  2002-10-28  0:45       ` Lars Henriksen
  0 siblings, 1 reply; 5+ messages in thread
From: Yngve Svendsen @ 2002-10-27 13:48 UTC (permalink / raw)
  To: Lars Henriksen; +Cc: Dieperink Alwin, 'help-gnats@gnu.org'

At 13:25 24.10.2002 +0200, Lars Henriksen wrote:
>Here is a proposal for a solution to the problems gnatsweb has with entries
>that have been removed from the responsible file. See also my previous email
>in this thread.

Committed. there were some problems with hash references, but I cleaned it up.

>It is a general solution for all unknown enumeration type values, not just
>responsible. The solution leaves the gnatsweb query format unchanged, i.e.
>enumeration values are still returned as integers.

In a longer perspective, we should probably look into stopping doing that. 
Using integer values messes up the sorting system for instance, since you 
do not get an alphabetical order of values when you sort query results on 
an enumerated value field ("sort" should rather be called "group" for that 
kind of field).

>The net effect is that for enumeration type values which are undefined,
>"unknown" is displayed in query results and is preselected in drop-down menues
>on the Edit page (thus forcing an explicit change).

I toyed with the idea of changing "unknown" to "Select value".

(snip)

>Finally, "unknown" is preselected as Category on the Create page. This is not
>related to the other changes. It forces users to select a category. Experience
>shows that users often forget to do so; the new PR is then created in the
>default category (pending, the first category in the categories file).

Good idea.

- Yngve 



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

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

* Re: Removed lines in responsible
  2002-10-27 13:48     ` Yngve Svendsen
@ 2002-10-28  0:45       ` Lars Henriksen
  2002-10-31 12:50         ` Lars Henriksen
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Henriksen @ 2002-10-28  0:45 UTC (permalink / raw)
  To: Yngve Svendsen; +Cc: Dieperink Alwin, 'help-gnats@gnu.org'

On Sun, Oct 27, 2002 at 10:48:14PM +0100, Yngve Svendsen wrote:
> At 13:25 24.10.2002 +0200, Lars Henriksen wrote:
> ... 
> Committed. there were some problems with hash references, but I cleaned it 
> up.

Oops. Sorry about that. Some of my local changes crept in here. I have found
that with many categories and many responsibles, it's nice to have the menues
alphabetically sorted (as they were in gnatsweb 2.9.3). I have been planning
to submit a patch so here it comes (see below).

> >It is a general solution for all unknown enumeration type values, not just
> >responsible. The solution leaves the gnatsweb query format unchanged, i.e.
> >enumeration values are still returned as integers.
> 
> In a longer perspective, we should probably look into stopping doing that. 
> Using integer values messes up the sorting system for instance, since you 
> do not get an alphabetical order of values when you sort query results on 
> an enumerated value field ("sort" should rather be called "group" for that 
> kind of field).

For some fields, e.g. "state", that is what I want: first the open PRs, then
the analyzed etc. and finally the closed. For responsible I keep the entries
in alphabetical order in the file.

> >The net effect is that for enumeration type values which are undefined,
> >"unknown" is displayed in query results and is preselected in drop-down 
> >menues
> >on the Edit page (thus forcing an explicit change).
> 
> I toyed with the idea of changing "unknown" to "Select value".
> 
> (snip)
> 
> >Finally, "unknown" is preselected as Category on the Create page. This is 
> >not
> >related to the other changes. It forces users to select a category. 
> >Experience
> >shows that users often forget to do so; the new PR is then created in the
> >default category (pending, the first category in the categories file).

You get the above effect for Category if you add an entry to the categories
file like

unknown:Select value:gnats-admin:

For responsible I use a similar thing.

Lars Henriksen

Index: gnatsweb.pl
===================================================================
RCS file: /cvsroot/gnatsweb/gnatsweb/gnatsweb.pl,v
retrieving revision 1.115
diff -u -r1.115 gnatsweb.pl
--- gnatsweb.pl	27 Oct 2002 22:33:18 -0000	1.115
+++ gnatsweb.pl	28 Oct 2002 08:33:07 -0000
@@ -1063,7 +1063,10 @@
     # Get default value(s).
     my $default = fieldinfo($_, 'default');
 
-    my $values = fieldinfo($_, 'values');
+    my @values = @{fieldinfo($_, 'values')};
+    if ($_ eq $CATEGORY_FIELD || $_ eq $SUBMITTER_ID_FIELD) {
+      @values = sort {lc($a) cmp lc($b)} @values;
+    }
 
     # The "intro" provides a way for the site callback to print something
     # at the top of a given field.
@@ -1084,13 +1087,13 @@
         push(@$values, "unknown") if (!grep /^unknown$/, @$values);
         $default = "unknown";
       }
-      print popup_or_scrolling_menu($_, $values, $default),
+      print popup_or_scrolling_menu($_, \@values, $default),
             "</td>\n</tr>\n";
     }
     elsif (fieldinfo ($_, 'fieldtype') eq 'multienum')
     {
       my $defaultsref = parse_multienum($default, $_);
-      print multiselect_menu($_, $values, $defaultsref),
+      print multiselect_menu($_, \@values, $defaultsref),
             "</td>\n</tr>\n";
     }
     elsif (fieldinfo($_, 'fieldtype') eq "multitext")
@@ -1563,7 +1566,12 @@
 
     $field_number++;
 
-    my $values = fieldinfo($_, 'values');
+    my @values = @{fieldinfo ($_, 'values')};
+    if ($_ eq $CATEGORY_FIELD ||
+        $_ eq $SUBMITTER_ID_FIELD ||
+        $_ eq $RESPONSIBLE_FIELD) {
+      @values = sort {lc($a) cmp lc($b)} @values;
+    }
 
     # The "intro" provides a way for the site callback to print something
     # at the top of a given field.
@@ -1576,18 +1584,18 @@
     {
       my $default = $fields{$_};
       # Check whether field value is a known enumeration value.
-      if (!(grep /^$default$/, @$values))
+      if (!(grep /^$default$/, @values))
       {
-	push(@$values, 'unknown') if (!grep /^unknown$/, @$values);
+	push(@values, 'unknown') if (!grep /^unknown$/, @values);
 	$default = 'unknown';
       }
-      print popup_or_scrolling_menu($_, $values, $default),
+      print popup_or_scrolling_menu($_, \@values, $default),
             "</td>\n</tr>\n";
     }
     elsif (fieldinfo ($_, 'fieldtype') eq 'multienum')
     {
       my $defaultsref = parse_multienum($fields{$_}, $_);
-      print multiselect_menu($_, $values, $defaultsref),
+      print multiselect_menu($_, \@values, $defaultsref),
       "</td>\n</tr>\n";
     }
     elsif (fieldinfo ($_, 'fieldtype') eq 'multitext')
@@ -1867,8 +1875,11 @@
     if (fieldinfo($_, 'fieldtype') =~ /enum/)
     {
       print "<tr><td valign=top>$_:</td>\n<td>";
-      my $value_list=fieldinfo($_, 'values');
-      my @values=('any', @$value_list);
+      my @values=@{fieldinfo($_, 'values')};
+      if ($_ eq $RESPONSIBLE_FIELD || $_ eq $CATEGORY_FIELD) {
+	@values=sort {lc($a) cmp lc($b)} @values;
+      }
+      @values=('any', @values);
       if (fieldinfo($_, 'fieldtype') eq 'enum')
       {
         print popup_or_scrolling_menu ($_, \@values, $values[0]);
@@ -2054,11 +2065,15 @@
     print "<td>";
     if (fieldinfo($_, 'fieldtype') =~ 'enum')
     {
-      my $ary_ref = fieldinfo($_, 'values');
+      my @values = @{fieldinfo($_, 'values')};
+      if ($_ eq $RESPONSIBLE_FIELD || $_ eq $CATEGORY_FIELD)
+      {
+        @values = sort {lc($a) cmp lc($b)} @values;
+      }
       my $size = scalar(@$ary_ref);
       $size = 4 if $size > 4;
       print $q->scrolling_list(-name=>$_,
-                               -values=>$ary_ref,
+                               -values=>\@values,
                                -multiple=>1,
                                -size=>$size);
     }


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

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

* Re: Removed lines in responsible
  2002-10-28  0:45       ` Lars Henriksen
@ 2002-10-31 12:50         ` Lars Henriksen
  2002-10-31 15:34           ` Lars Henriksen
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Henriksen @ 2002-10-31 12:50 UTC (permalink / raw)
  To: Yngve Svendsen; +Cc: Dieperink Alwin, 'help-gnats@gnu.org'

On Mon, Oct 28, 2002 at 09:37:28AM +0100, Lars Henriksen wrote:
> On Sun, Oct 27, 2002 at 10:48:14PM +0100, Yngve Svendsen wrote:
> > At 13:25 24.10.2002 +0200, Lars Henriksen wrote:
> > ... 
> > Committed. there were some problems with hash references, but I cleaned it 
> > up.
> 
> Oops. Sorry about that. Some of my local changes crept in here. I have found
> that with many categories and many responsibles, it's nice to have the menues
> alphabetically sorted (as they were in gnatsweb 2.9.3). I have been planning
> to submit a patch so here it comes (see below).

Unfortunately I managed to mess up my own changes so the patch mentioned above
wasn't quite correct.

I you want alphabetically sorted Category and Responsible menues (like in
gnatsweb 2.9.3) here is the patch.

Lars Henriksen

Index: gnatsweb.pl
===================================================================
RCS file: /cvsroot/gnatsweb/gnatsweb/gnatsweb.pl,v
retrieving revision 1.115
diff -u -r1.115 gnatsweb.pl
--- gnatsweb.pl	27 Oct 2002 22:33:18 -0000	1.115
+++ gnatsweb.pl	31 Oct 2002 20:25:59 -0000
@@ -1063,7 +1063,11 @@
     # Get default value(s).
     my $default = fieldinfo($_, 'default');
 
-    my $values = fieldinfo($_, 'values');
+    my @values = @{fieldinfo($_, 'values')};
+    if ($_ eq $CATEGORY_FIELD || $_ eq $SUBMITTER_ID_FIELD)
+    {
+      @values = sort {lc($a) cmp lc($b)} @values;
+    }
 
     # The "intro" provides a way for the site callback to print something
     # at the top of a given field.
@@ -1081,16 +1085,16 @@
       # Force user to choose a category.
       if ($_ eq $CATEGORY_FIELD)
       {
-        push(@$values, "unknown") if (!grep /^unknown$/, @$values);
+        push(@values, "unknown") if (!grep /^unknown$/, @values);
         $default = "unknown";
       }
-      print popup_or_scrolling_menu($_, $values, $default),
+      print popup_or_scrolling_menu($_, \@values, $default),
             "</td>\n</tr>\n";
     }
     elsif (fieldinfo ($_, 'fieldtype') eq 'multienum')
     {
       my $defaultsref = parse_multienum($default, $_);
-      print multiselect_menu($_, $values, $defaultsref),
+      print multiselect_menu($_, \@values, $defaultsref),
             "</td>\n</tr>\n";
     }
     elsif (fieldinfo($_, 'fieldtype') eq "multitext")
@@ -1563,7 +1567,12 @@
 
     $field_number++;
 
-    my $values = fieldinfo($_, 'values');
+    my @values = @{fieldinfo ($_, 'values')};
+    if ($_ eq $CATEGORY_FIELD ||
+        $_ eq $SUBMITTER_ID_FIELD ||
+        $_ eq $RESPONSIBLE_FIELD) {
+      @values = sort {lc($a) cmp lc($b)} @values;
+    }
 
     # The "intro" provides a way for the site callback to print something
     # at the top of a given field.
@@ -1576,18 +1585,18 @@
     {
       my $default = $fields{$_};
       # Check whether field value is a known enumeration value.
-      if (!(grep /^$default$/, @$values))
+      if (!(grep /^$default$/, @values))
       {
-	push(@$values, 'unknown') if (!grep /^unknown$/, @$values);
+	push(@values, 'unknown') if (!grep /^unknown$/, @values);
 	$default = 'unknown';
       }
-      print popup_or_scrolling_menu($_, $values, $default),
+      print popup_or_scrolling_menu($_, \@values, $default),
             "</td>\n</tr>\n";
     }
     elsif (fieldinfo ($_, 'fieldtype') eq 'multienum')
     {
       my $defaultsref = parse_multienum($fields{$_}, $_);
-      print multiselect_menu($_, $values, $defaultsref),
+      print multiselect_menu($_, \@values, $defaultsref),
       "</td>\n</tr>\n";
     }
     elsif (fieldinfo ($_, 'fieldtype') eq 'multitext')
@@ -1867,8 +1876,12 @@
     if (fieldinfo($_, 'fieldtype') =~ /enum/)
     {
       print "<tr><td valign=top>$_:</td>\n<td>";
-      my $value_list=fieldinfo($_, 'values');
-      my @values=('any', @$value_list);
+      my @values = @{fieldinfo($_, 'values')};
+      if ($_ eq $RESPONSIBLE_FIELD || $_ eq $CATEGORY_FIELD)
+      {
+        @values=sort {lc($a) cmp lc($b)} @values;
+      }
+      @values=('any', @values);
       if (fieldinfo($_, 'fieldtype') eq 'enum')
       {
         print popup_or_scrolling_menu ($_, \@values, $values[0]);
@@ -2054,11 +2067,15 @@
     print "<td>";
     if (fieldinfo($_, 'fieldtype') =~ 'enum')
     {
-      my $ary_ref = fieldinfo($_, 'values');
-      my $size = scalar(@$ary_ref);
+      my @values = @{fieldinfo($_, 'values')};
+      if ($_ eq $RESPONSIBLE_FIELD || $_ eq $CATEGORY_FIELD)
+      {
+        @values = sort {lc($a) cmp lc($b)} @values;
+      }
+      my $size = @values;
       $size = 4 if $size > 4;
       print $q->scrolling_list(-name=>$_,
-                               -values=>$ary_ref,
+                               -values=>\@values,
                                -multiple=>1,
                                -size=>$size);
     }


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

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

* Re: Removed lines in responsible
  2002-10-31 12:50         ` Lars Henriksen
@ 2002-10-31 15:34           ` Lars Henriksen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Henriksen @ 2002-10-31 15:34 UTC (permalink / raw)
  To: Yngve Svendsen; +Cc: Dieperink Alwin, 'help-gnats@gnu.org'

On Mon, Oct 28, 2002 at 09:37:28AM +0100, Lars Henriksen wrote:
> On Sun, Oct 27, 2002 at 10:48:14PM +0100, Yngve Svendsen wrote:
> > At 13:25 24.10.2002 +0200, Lars Henriksen wrote:
> > ... 
> > Committed. there were some problems with hash references, but I cleaned it 
> > up.
> 
> Oops. Sorry about that. Some of my local changes crept in here. I have found
> that with many categories and many responsibles, it's nice to have the menues
> alphabetically sorted (as they were in gnatsweb 2.9.3). I have been planning
> to submit a patch so here it comes (see below).

Unfortunately I managed to mess up my own changes so the patch mentioned above
wasn't quite correct.

I you want alphabetically sorted Category and Responsible menues (like in
gnatsweb 2.9.3) here is the patch.

Lars Henriksen

Index: gnatsweb.pl
===================================================================
RCS file: /cvsroot/gnatsweb/gnatsweb/gnatsweb.pl,v
retrieving revision 1.115
diff -u -r1.115 gnatsweb.pl
--- gnatsweb.pl	27 Oct 2002 22:33:18 -0000	1.115
+++ gnatsweb.pl	31 Oct 2002 20:25:59 -0000
@@ -1063,7 +1063,11 @@
     # Get default value(s).
     my $default = fieldinfo($_, 'default');
 
-    my $values = fieldinfo($_, 'values');
+    my @values = @{fieldinfo($_, 'values')};
+    if ($_ eq $CATEGORY_FIELD || $_ eq $SUBMITTER_ID_FIELD)
+    {
+      @values = sort {lc($a) cmp lc($b)} @values;
+    }
 
     # The "intro" provides a way for the site callback to print something
     # at the top of a given field.
@@ -1081,16 +1085,16 @@
       # Force user to choose a category.
       if ($_ eq $CATEGORY_FIELD)
       {
-        push(@$values, "unknown") if (!grep /^unknown$/, @$values);
+        push(@values, "unknown") if (!grep /^unknown$/, @values);
         $default = "unknown";
       }
-      print popup_or_scrolling_menu($_, $values, $default),
+      print popup_or_scrolling_menu($_, \@values, $default),
             "</td>\n</tr>\n";
     }
     elsif (fieldinfo ($_, 'fieldtype') eq 'multienum')
     {
       my $defaultsref = parse_multienum($default, $_);
-      print multiselect_menu($_, $values, $defaultsref),
+      print multiselect_menu($_, \@values, $defaultsref),
             "</td>\n</tr>\n";
     }
     elsif (fieldinfo($_, 'fieldtype') eq "multitext")
@@ -1563,7 +1567,12 @@
 
     $field_number++;
 
-    my $values = fieldinfo($_, 'values');
+    my @values = @{fieldinfo ($_, 'values')};
+    if ($_ eq $CATEGORY_FIELD ||
+        $_ eq $SUBMITTER_ID_FIELD ||
+        $_ eq $RESPONSIBLE_FIELD) {
+      @values = sort {lc($a) cmp lc($b)} @values;
+    }
 
     # The "intro" provides a way for the site callback to print something
     # at the top of a given field.
@@ -1576,18 +1585,18 @@
     {
       my $default = $fields{$_};
       # Check whether field value is a known enumeration value.
-      if (!(grep /^$default$/, @$values))
+      if (!(grep /^$default$/, @values))
       {
-	push(@$values, 'unknown') if (!grep /^unknown$/, @$values);
+	push(@values, 'unknown') if (!grep /^unknown$/, @values);
 	$default = 'unknown';
       }
-      print popup_or_scrolling_menu($_, $values, $default),
+      print popup_or_scrolling_menu($_, \@values, $default),
             "</td>\n</tr>\n";
     }
     elsif (fieldinfo ($_, 'fieldtype') eq 'multienum')
     {
       my $defaultsref = parse_multienum($fields{$_}, $_);
-      print multiselect_menu($_, $values, $defaultsref),
+      print multiselect_menu($_, \@values, $defaultsref),
       "</td>\n</tr>\n";
     }
     elsif (fieldinfo ($_, 'fieldtype') eq 'multitext')
@@ -1867,8 +1876,12 @@
     if (fieldinfo($_, 'fieldtype') =~ /enum/)
     {
       print "<tr><td valign=top>$_:</td>\n<td>";
-      my $value_list=fieldinfo($_, 'values');
-      my @values=('any', @$value_list);
+      my @values = @{fieldinfo($_, 'values')};
+      if ($_ eq $RESPONSIBLE_FIELD || $_ eq $CATEGORY_FIELD)
+      {
+        @values=sort {lc($a) cmp lc($b)} @values;
+      }
+      @values=('any', @values);
       if (fieldinfo($_, 'fieldtype') eq 'enum')
       {
         print popup_or_scrolling_menu ($_, \@values, $values[0]);
@@ -2054,11 +2067,15 @@
     print "<td>";
     if (fieldinfo($_, 'fieldtype') =~ 'enum')
     {
-      my $ary_ref = fieldinfo($_, 'values');
-      my $size = scalar(@$ary_ref);
+      my @values = @{fieldinfo($_, 'values')};
+      if ($_ eq $RESPONSIBLE_FIELD || $_ eq $CATEGORY_FIELD)
+      {
+        @values = sort {lc($a) cmp lc($b)} @values;
+      }
+      my $size = @values;
       $size = 4 if $size > 4;
       print $q->scrolling_list(-name=>$_,
-                               -values=>$ary_ref,
+                               -values=>\@values,
                                -multiple=>1,
                                -size=>$size);
     }


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

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

end of thread, other threads:[~2002-10-31 20:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <A13B47F8EC3FD111A91500C04FD2A282021FA39F@exchange.elca.ch>
     [not found] ` <5.1.0.14.2.20021014210535.04654818@ms-etro01-01.norway>
2002-10-24  4:29   ` Removed lines in responsible Lars Henriksen
2002-10-27 13:48     ` Yngve Svendsen
2002-10-28  0:45       ` Lars Henriksen
2002-10-31 12:50         ` Lars Henriksen
2002-10-31 15:34           ` Lars Henriksen

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