summaryrefslogtreecommitdiffstats
path: root/extensions/TrackingFlags
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-09-11 08:25:33 +0200
committerByron Jones <bjones@mozilla.com>2013-09-11 08:25:33 +0200
commit4b5d2d61669c35919345dc27e0ed3831ada92f24 (patch)
tree443ff0109c4a53971e85b7411ce9a23e0e262e51 /extensions/TrackingFlags
parent196782cb0c28322b6325f9415f3cdf2f25fc7c0d (diff)
downloadbugzilla-4b5d2d61669c35919345dc27e0ed3831ada92f24.tar.gz
bugzilla-4b5d2d61669c35919345dc27e0ed3831ada92f24.tar.xz
Bug 909843: trackingflags do not support "Can be set on bug creation"
Diffstat (limited to 'extensions/TrackingFlags')
-rw-r--r--extensions/TrackingFlags/Extension.pm6
-rw-r--r--extensions/TrackingFlags/lib/Admin.pm5
-rw-r--r--extensions/TrackingFlags/lib/Flag.pm8
-rw-r--r--extensions/TrackingFlags/template/en/default/pages/tracking_flags_admin_edit.html.tmpl6
4 files changed, 23 insertions, 2 deletions
diff --git a/extensions/TrackingFlags/Extension.pm b/extensions/TrackingFlags/Extension.pm
index 6172f0ffc..b79faef61 100644
--- a/extensions/TrackingFlags/Extension.pm
+++ b/extensions/TrackingFlags/Extension.pm
@@ -59,6 +59,7 @@ sub template_before_process {
{
$vars->{'tracking_flags'} = Bugzilla::Extension::TrackingFlags::Flag->match({
product => $vars->{'product'}->name,
+ enter_bug => 1,
is_active => 1,
});
@@ -122,6 +123,11 @@ sub db_schema_abstract_schema {
NOTNULL => 1,
DEFAULT => '0',
},
+ enter_bug => {
+ TYPE => 'BOOLEAN',
+ NOTNULL => 1,
+ DEFAULT => 'TRUE',
+ },
is_active => {
TYPE => 'BOOLEAN',
NOTNULL => 1,
diff --git a/extensions/TrackingFlags/lib/Admin.pm b/extensions/TrackingFlags/lib/Admin.pm
index 719b4f248..5af593f08 100644
--- a/extensions/TrackingFlags/lib/Admin.pm
+++ b/extensions/TrackingFlags/lib/Admin.pm
@@ -109,6 +109,7 @@ sub admin_edit {
}
$flag->set_sortkey(_next_unique_sortkey($flag->sortkey));
$flag->set_type($flag->flag_type);
+ $flag->set_enter_bug($flag->enter_bug);
# always default new flags as active, even when copying an inactive one
$flag->set_is_active(1);
@@ -121,6 +122,7 @@ sub admin_edit {
$vars->{mode} = 'new';
$vars->{flag} = {
sortkey => 0,
+ enter_bug => 1,
is_active => 1,
};
$vars->{values} = _flag_values_to_json([
@@ -148,10 +150,12 @@ sub _load_from_input {
description => trim($input->{flag_desc} || ''),
sortkey => $input->{flag_sort} || 0,
type => trim($input->{flag_type} || ''),
+ enter_bug => $input->{flag_enter_bug} ? 1 : 0,
is_active => $input->{flag_active} ? 1 : 0,
};
detaint_natural($flag->{id});
detaint_natural($flag->{sortkey});
+ detaint_natural($flag->{enter_bug});
detaint_natural($flag->{is_active});
# values
@@ -288,6 +292,7 @@ sub _update_db_flag {
description => $flag->{description},
sortkey => $flag->{sortkey},
type => $flag->{type},
+ enter_bug => $flag->{enter_bug},
is_active => $flag->{is_active},
};
diff --git a/extensions/TrackingFlags/lib/Flag.pm b/extensions/TrackingFlags/lib/Flag.pm
index 9be416978..f7eb674ee 100644
--- a/extensions/TrackingFlags/lib/Flag.pm
+++ b/extensions/TrackingFlags/lib/Flag.pm
@@ -35,6 +35,7 @@ use constant DB_COLUMNS => qw(
description
type
sortkey
+ enter_bug
is_active
);
@@ -45,6 +46,7 @@ use constant UPDATE_COLUMNS => qw(
description
type
sortkey
+ enter_bug
is_active
);
@@ -53,8 +55,8 @@ use constant VALIDATORS => {
description => \&_check_description,
type => \&_check_type,
sortkey => \&_check_sortkey,
+ enter_bug => \&Bugzilla::Object::check_boolean,
is_active => \&Bugzilla::Object::check_boolean,
-
};
use constant UPDATE_VALIDATORS => {
@@ -62,6 +64,7 @@ use constant UPDATE_VALIDATORS => {
description => \&_check_description,
type => \&_check_type,
sortkey => \&_check_sortkey,
+ enter_bug => \&Bugzilla::Object::check_boolean,
is_active => \&Bugzilla::Object::check_boolean,
};
@@ -332,6 +335,7 @@ sub set_name { $_[0]->set('name', $_[1]); }
sub set_description { $_[0]->set('description', $_[1]); }
sub set_type { $_[0]->set('type', $_[1]); }
sub set_sortkey { $_[0]->set('sortkey', $_[1]); }
+sub set_enter_bug { $_[0]->set('enter_bug', $_[1]); }
sub set_is_active { $_[0]->set('is_active', $_[1]); }
###############################
@@ -343,6 +347,7 @@ sub name { return $_[0]->{'name'}; }
sub description { return $_[0]->{'description'}; }
sub flag_type { return $_[0]->{'type'}; }
sub sortkey { return $_[0]->{'sortkey'}; }
+sub enter_bug { return $_[0]->{'enter_bug'}; }
sub is_active { return $_[0]->{'is_active'}; }
sub values {
@@ -425,7 +430,6 @@ sub legal_values { return $_[0]->values; }
sub custom { return 1; }
sub in_new_bugmail { return 1; }
sub obsolete { return $_[0]->is_active ? 1 : 0; }
-sub enter_bug { return 1; }
sub buglist { return 1; }
sub is_select { return 1; }
sub is_abnormal { return 1; }
diff --git a/extensions/TrackingFlags/template/en/default/pages/tracking_flags_admin_edit.html.tmpl b/extensions/TrackingFlags/template/en/default/pages/tracking_flags_admin_edit.html.tmpl
index 85915dbde..17b64d41e 100644
--- a/extensions/TrackingFlags/template/en/default/pages/tracking_flags_admin_edit.html.tmpl
+++ b/extensions/TrackingFlags/template/en/default/pages/tracking_flags_admin_edit.html.tmpl
@@ -98,6 +98,12 @@ var selected_components = [
</tr>
<tr>
+ <th>Enter [% terms.Bug %]</th>
+ <td><input type="checkbox" name="flag_enter_bug" id="flag_enter_bug" value="1" [% "checked" IF flag.enter_bug %]></td>
+ <td class="help">can be set on [% terms.bug %] creation</td>
+</tr>
+
+<tr>
<th>Active</th>
<td><input type="checkbox" name="flag_active" id="flag_active" value="1" [% "checked" IF flag.is_active %]></td>
</tr>