383
$table, $column);
383
$table, $column);
386
sub bz_get_field_defs {
390
if (!Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})) {
391
$extra = "AND name NOT IN ('estimated_time', 'remaining_time', " .
392
"'work_time', 'percentage_complete', 'deadline')";
396
my $sth = $self->prepare("SELECT name, description FROM fielddefs
397
WHERE obsolete = 0 $extra
400
while (my $field_ref = $sth->fetchrow_hashref()) {
401
push(@fields, $field_ref);
406
#####################################################################
386
#####################################################################
407
# Database Setup
387
# Database Setup
408
#####################################################################
388
#####################################################################
1273
my $column = $dbh->bz_column_info($table, $column);
1253
my $column = $dbh->bz_column_info($table, $column);
1274
my $index = $dbh->bz_index_info($table, $index);
1254
my $index = $dbh->bz_index_info($table, $index);
1276
# General Information
1277
my @fields = $dbh->bz_get_field_defs();
1279
=head1 DESCRIPTION
1256
=head1 DESCRIPTION
1281
Functions in this module allows creation of a database handle to connect
1258
Functions in this module allows creation of a database handle to connect
1952
=item C<bz_get_field_defs>
1956
=item B<Description>
1958
Returns a list of all the "bug" fields in Bugzilla. The list
1959
contains hashes, with a C<name> key and a C<description> key.
1961
=item B<Params> (none)
1965
List of all the "bug" fields
1971
=head2 Database Setup Methods
1931
=head2 Database Setup Methods
87
$vars->{'closed_status'} = \@closed_status;
87
$vars->{'closed_status'} = \@closed_status;
89
# Generate a list of fields that can be queried.
89
# Generate a list of fields that can be queried.
90
$vars->{'field'} = [Bugzilla->dbh->bz_get_field_defs()];
90
my @fields = @{Bugzilla::Field->match({obsolete => 0})};
91
# Exclude fields the user cannot query.
92
if (!Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})) {
93
@fields = grep { $_->name !~ /^(estimated_time|remaining_time|work_time|percentage_complete|deadline)$/ } @fields;
95
$vars->{'field'} = \@fields;
92
display_data($vars);
97
display_data($vars);
113
var field = [
113
var field = [
114
[% FOREACH x = field %]
114
[% FOREACH x = field %]
115
{ name: '[% x.name FILTER js %]',
115
{ name: '[% x.name FILTER js %]',
116
description: '[% (field_descs.${x.name} OR x.description) FILTER js %]' },
116
description: '[% (field_descs.${x.name} OR x.description) FILTER js %]',
117
[%-# These values are meaningful for custom fields only. %]
119
type: '[% x.type FILTER js %]',
120
type_desc: '[% field_types.${x.type} FILTER js %]',
121
enter_bug: '[% x.enter_bug FILTER js %]',
117
[% END %]
124
[% END %]
204
<bz:field rdf:about="[% urlbase FILTER xml %]field.cgi?name=[% item.name FILTER url_quote %]">
204
<bz:field rdf:about="[% urlbase FILTER xml %]field.cgi?name=[% item.name FILTER url_quote %]">
205
<bz:name>[% item.name FILTER html %]</bz:name>
205
<bz:name>[% item.name FILTER html %]</bz:name>
206
<bz:description>[% (field_descs.${item.name} OR item.description) FILTER html %]</bz:description>
206
<bz:description>[% (field_descs.${item.name} OR item.description) FILTER html %]</bz:description>
207
[%-# These values are meaningful for custom fields only. %]
209
<bz:type>[% item.type FILTER html %]</bz:type>
210
<bz:type_desc>[% field_types.${item.type} FILTER html %]</bz:type_desc>
211
<bz:enter_bug>[% item.enter_bug FILTER html %]</bz:enter_bug>
207
</bz:field>
213
</bz:field>
209
[% END %]
215
[% END %]