From da6143f4aae6af35f60b8230b82f649b3b0cbd05 Mon Sep 17 00:00:00 2001 From: "myk%mozilla.org" <> Date: Tue, 24 Jun 2003 01:01:35 +0000 Subject: Fix for bug 204631: enhances config.cgi to generate a list of queryable fields so third-party clients can populate search forms with the list. r=gerv a=myk --- globals.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'globals.pl') diff --git a/globals.pl b/globals.pl index 9c36e9003..d8d11be53 100644 --- a/globals.pl +++ b/globals.pl @@ -627,6 +627,26 @@ sub GetSelectableProductHash { } +sub GetFieldDefs { + my $extra = ""; + if (!UserInGroup(Param('timetrackinggroup'))) { + $extra = "WHERE name NOT IN ('estimated time', 'remaining_time', " . + "'work_time', 'percentage_complete')"; + } + + my @fields; + PushGlobalSQLState(); + SendSQL("SELECT name, description FROM fielddefs $extra ORDER BY sortkey"); + while (MoreSQLData()) { + my ($name, $description) = FetchSQLData(); + push(@fields, { name => $name, description => $description }); + } + PopGlobalSQLState(); + + return(@fields); +} + + sub CanSeeBug { my ($id, $userid) = @_; -- cgit v1.2.3-24-g4f1b