summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Field.pm
diff options
context:
space:
mode:
authorrojanu <aliustek@gmail.com>2012-05-17 01:22:41 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-05-17 01:22:41 +0200
commit629f2c959658c50ec2f4790b80bfe5ff30e3cd82 (patch)
treef7554f685112a8ae5a6fdeaddc328f2baec1ef0f /Bugzilla/Field.pm
parent82c52c304a6513c68735923f5ecb42c5137b9ed4 (diff)
downloadbugzilla-629f2c959658c50ec2f4790b80bfe5ff30e3cd82.tar.gz
bugzilla-629f2c959658c50ec2f4790b80bfe5ff30e3cd82.tar.xz
Bug 728138: Custom fields should have a "Long Description" attribute to better understand what they are used for
r/a=LpSolit
Diffstat (limited to 'Bugzilla/Field.pm')
-rw-r--r--Bugzilla/Field.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm
index c244e66d9..250d7239e 100644
--- a/Bugzilla/Field.pm
+++ b/Bugzilla/Field.pm
@@ -80,6 +80,7 @@ use constant DB_COLUMNS => qw(
id
name
description
+ long_desc
type
custom
mailhead
@@ -97,6 +98,7 @@ use constant DB_COLUMNS => qw(
use constant VALIDATORS => {
custom => \&_check_custom,
description => \&_check_description,
+ long_desc => \&_check_long_desc,
enter_bug => \&_check_enter_bug,
buglist => \&Bugzilla::Object::check_boolean,
mailhead => \&_check_mailhead,
@@ -123,6 +125,7 @@ use constant VALIDATOR_DEPENDENCIES => {
use constant UPDATE_COLUMNS => qw(
description
+ long_desc
mailhead
sortkey
obsolete
@@ -279,6 +282,15 @@ sub _check_description {
return $desc;
}
+sub _check_long_desc {
+ my ($invocant, $long_desc) = @_;
+ $long_desc = clean_text($long_desc || '');
+ if (length($long_desc) > MAX_FIELD_LONG_DESC_LENGTH) {
+ ThrowUserError('field_long_desc_too_long');
+ }
+ return $long_desc;
+}
+
sub _check_enter_bug { return $_[1] ? 1 : 0; }
sub _check_is_numeric {
@@ -441,6 +453,17 @@ sub description { return $_[0]->{description} }
=over
+=item C<long_desc>
+
+A string providing detailed info about the field;
+
+=back
+=cut
+
+sub long_desc { return $_[0]->{long_desc} }
+
+=over
+
=item C<type>
an integer specifying the kind of field this is; values correspond to
@@ -824,6 +847,8 @@ They will throw an error if you try to set the values to something invalid.
=item C<set_description>
+=item C<set_long_desc>
+
=item C<set_enter_bug>
=item C<set_obsolete>
@@ -850,6 +875,7 @@ They will throw an error if you try to set the values to something invalid.
=cut
sub set_description { $_[0]->set('description', $_[1]); }
+sub set_long_desc { $_[0]->set('long_desc', $_[1]); }
sub set_enter_bug { $_[0]->set('enter_bug', $_[1]); }
sub set_is_numeric { $_[0]->set('is_numeric', $_[1]); }
sub set_obsolete { $_[0]->set('obsolete', $_[1]); }
@@ -972,6 +998,8 @@ Just like L<Bugzilla::Object/create>. Takes the following parameters:
=item C<description> B<Required> - The field label to display in the UI.
+=item C<long_desc> - A longer description of the field.
+
=item C<mailhead> - boolean - Whether this field appears at the
top of the bugmail for a newly-filed bug. Defaults to 0.