sortkey => {TYPE => 'INT2', NOTNULL => 1},
obsolete => {TYPE => 'BOOLEAN', NOTNULL => 1,
DEFAULT => 'FALSE'},
+ enter_bug => {TYPE => 'BOOLEAN', NOTNULL => 1,
+ DEFAULT => 'FALSE'},
],
INDEXES => [
fielddefs_name_idx => {FIELDS => ['name'],
'description',
'type',
'custom',
- 'obsolete'
+ 'obsolete',
+ 'enter_bug',
);
our $columns = join(", ", DB_COLUMNS);
sub obsolete { return $_[0]->{obsolete} }
+=over
+
+=item C<enter_bug>
+
+A boolean specifying whether or not this field should appear on
+enter_bug.cgi
+
+=back
+
+=cut
+
+sub enter_bug { return $_[0]->{enter_bug} }
+
=pod
if (defined $criteria->{obsolete}) {
push(@terms, "obsolete=" . ($criteria->{obsolete} ? "1" : "0"));
}
+ if (defined $criteria->{enter_bug}) {
+ push(@terms, "enter_bug=" . ($criteria->{enter_bug} ? '1' : '0'));
+ }
my $where = (scalar(@terms) > 0) ? "WHERE " . join(" AND ", @terms) : "";
my $records = Bugzilla->dbh->selectall_arrayref(
}
}
+$dbh->bz_add_column('fielddefs', 'enter_bug',
+ {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'});
+
# If you had to change the --TABLE-- definition in any way, then add your
# differential change code *** A B O V E *** this comment.
#
$vars->{'token'} = Bugzilla::Token::IssueSessionToken('createbug:');
+
+my @enter_bug_fields = Bugzilla->get_fields({ custom => 1, obsolete => 0,
+ enter_bug => 1 });
+foreach my $field (@enter_bug_fields) {
+ $vars->{$field->name} = formvalue($field->name);
+}
+
if ($cloned_bug_id) {
$default{'component_'} = $cloned_bug->{'component'};
$vars->{'cc'} = formvalue('cc');
}
+ foreach my $field (@enter_bug_fields) {
+ $vars->{$field->name} = $cloned_bug->{$field->name};
+ }
+
# We need to ensure that we respect the 'insider' status of
# the first comment, if it has one. Either way, make a note
# that this bug was cloned from another bug.
-value => login_to_id(trim($cgi->param('assigned_to')), THROW_ERROR));
}
+
+my @enter_bug_field_names = map {$_->name} Bugzilla->get_fields({ custom => 1,
+ obsolete => 0, enter_bug => 1});
+
my @bug_fields = ("version", "rep_platform",
"bug_severity", "priority", "op_sys", "assigned_to",
"bug_status", "everconfirmed", "bug_file_loc", "short_desc",
- "target_milestone", "status_whiteboard");
+ "target_milestone", "status_whiteboard",
+ @enter_bug_field_names);
if (Bugzilla->params->{"usebugaliases"}) {
my $alias = trim($cgi->param('alias') || "");
</td>
</tr>
+ [% USE Bugzilla %]
+ [% FOREACH field = Bugzilla.get_fields({ obsolete => 0, custom => 1,
+ enter_bug => 1 }) %]
+ [% SET value = ${field.name} IF ${field.name}.defined %]
+ <tr>
+ [% PROCESS bug/field.html.tmpl editable=1 value_span=3 %]
+ </tr>
+ [% END %]
+
<tr>
<td align="right"><strong>Summary:</strong></td>
<td colspan="3">
# value: The value of the field for this bug.
# editable: Whether the field should be displayed as an editable
# <input> or as just the plain text of its value.
+ # value_span: A colspan for the table cell containing
+ # the field value.
#%]
<th class="field_label">
[% CASE constants.FIELD_TYPE_FREETEXT %]
<input name="[% field.name FILTER html %]"
value="[% value FILTER html %]"
+ [% "colspan=\"$value_span\"" FILTER none IF value_span %]
size="60">
[% END %]
[% ELSE %]