aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorReed Loden <reed@reedloden.com>2010-07-05 02:42:01 -0500
committerReed Loden <reed@reedloden.com>2010-07-05 02:42:01 -0500
commitbf3e63a75b8fbc9d613ec3fd6289a178731692e4 (patch)
treee2e063f03682f85368cb462d525b35e3114053db /Bugzilla
parente598bc84cff9a281d312651332465c3899e3f49d (diff)
downloadbugs-bf3e63a75b8fbc9d613ec3fd6289a178731692e4.tar
bugs-bf3e63a75b8fbc9d613ec3fd6289a178731692e4.tar.gz
bugs-bf3e63a75b8fbc9d613ec3fd6289a178731692e4.tar.bz2
bugs-bf3e63a75b8fbc9d613ec3fd6289a178731692e4.tar.xz
bugs-bf3e63a75b8fbc9d613ec3fd6289a178731692e4.zip
Bug 455810 - Add autocomplete support to the keywords field
* Special thanks to Guy Pyrzak for the original patch [r=mkanat a=mkanat]
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Constants.pm2
-rw-r--r--Bugzilla/Field.pm4
-rw-r--r--Bugzilla/Template.pm3
3 files changed, 7 insertions, 2 deletions
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm
index d11736af1..a003ce739 100644
--- a/Bugzilla/Constants.pm
+++ b/Bugzilla/Constants.pm
@@ -128,6 +128,7 @@ use File::Basename;
FIELD_TYPE_DATETIME
FIELD_TYPE_BUG_ID
FIELD_TYPE_BUG_URLS
+ FIELD_TYPE_KEYWORDS
EMPTY_DATETIME_REGEX
@@ -395,6 +396,7 @@ use constant FIELD_TYPE_TEXTAREA => 4;
use constant FIELD_TYPE_DATETIME => 5;
use constant FIELD_TYPE_BUG_ID => 6;
use constant FIELD_TYPE_BUG_URLS => 7;
+use constant FIELD_TYPE_KEYWORDS => 8;
use constant EMPTY_DATETIME_REGEX => qr/^[0\-:\sA-Za-z]+$/;
diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm
index 9ab5c49b9..15b494762 100644
--- a/Bugzilla/Field.pm
+++ b/Bugzilla/Field.pm
@@ -182,7 +182,7 @@ use constant DEFAULT_FIELDS => (
{name => 'status_whiteboard', desc => 'Status Whiteboard',
in_new_bugmail => 1, buglist => 1},
{name => 'keywords', desc => 'Keywords', in_new_bugmail => 1,
- buglist => 1},
+ type => FIELD_TYPE_KEYWORDS, buglist => 1},
{name => 'resolution', desc => 'Resolution',
type => FIELD_TYPE_SINGLE_SELECT, buglist => 1},
{name => 'bug_severity', desc => 'Severity', in_new_bugmail => 1,
@@ -322,7 +322,7 @@ sub _check_type {
my $saved_type = $type;
# The constant here should be updated every time a new,
# higher field type is added.
- (detaint_natural($type) && $type <= FIELD_TYPE_BUG_URLS)
+ (detaint_natural($type) && $type <= FIELD_TYPE_KEYWORDS)
|| ThrowCodeError('invalid_customfield_type', { type => $saved_type });
my $custom = blessed($invocant) ? $invocant->custom : $params->{custom};
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index a317bb7c7..71ade2f01 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -765,6 +765,9 @@ sub create {
# Whether or not keywords are enabled, in this Bugzilla.
'use_keywords' => sub { return Bugzilla::Keyword->any_exist; },
+ # All the keywords.
+ 'all_keywords' => sub { return Bugzilla::Keyword->get_all(); },
+
'feature_enabled' => sub { return Bugzilla->feature(@_); },
# field_descs can be somewhat slow to generate, so we generate