summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.pm
diff options
context:
space:
mode:
authormyk%mozilla.org <>2006-01-06 23:22:55 +0100
committermyk%mozilla.org <>2006-01-06 23:22:55 +0100
commit199d6ed76f022232c3799036c75661604a6d70d4 (patch)
tree2def77ae1ab734f5131b22e609b013734f2620fb /Bugzilla/Bug.pm
parent8a751a1e448b17a66a63b5728ffce0b456bc762b (diff)
downloadbugzilla-199d6ed76f022232c3799036c75661604a6d70d4.tar.gz
bugzilla-199d6ed76f022232c3799036c75661604a6d70d4.tar.xz
Bug 287325: an initial implementation of custom fields, including the ability to add text custom fields via the command-line script customfield.pl, search them via the boolean charts, display and edit them on the show bug page, and see changes to them in bug activity; r=mkanat, glob
Diffstat (limited to 'Bugzilla/Bug.pm')
-rwxr-xr-xBugzilla/Bug.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 61798f7cb..cfa5f49f6 100755
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -90,6 +90,8 @@ sub fields {
push @fields, qw(estimated_time remaining_time actual_time deadline);
}
+ push(@fields, Bugzilla->custom_field_names);
+
return @fields;
}
@@ -162,6 +164,11 @@ sub initBug {
$self->{'who'} = new Bugzilla::User($user_id);
+ my $custom_fields = "";
+ if (length(Bugzilla->custom_field_names) > 0) {
+ $custom_fields = ", " . join(", ", Bugzilla->custom_field_names);
+ }
+
my $query = "
SELECT
bugs.bug_id, alias, products.classification_id, classifications.name,
@@ -175,7 +182,8 @@ sub initBug {
delta_ts, COALESCE(SUM(votes.vote_count), 0),
reporter_accessible, cclist_accessible,
estimated_time, remaining_time, " .
- $dbh->sql_date_format('deadline', '%Y-%m-%d') . "
+ $dbh->sql_date_format('deadline', '%Y-%m-%d') .
+ $custom_fields . "
FROM bugs
LEFT JOIN votes
ON bugs.bug_id = votes.bug_id
@@ -212,7 +220,8 @@ sub initBug {
"target_milestone", "qa_contact_id", "status_whiteboard",
"creation_ts", "delta_ts", "votes",
"reporter_accessible", "cclist_accessible",
- "estimated_time", "remaining_time", "deadline")
+ "estimated_time", "remaining_time", "deadline",
+ Bugzilla->custom_field_names)
{
$fields{$field} = shift @row;
if (defined $fields{$field}) {