summaryrefslogtreecommitdiffstats
path: root/extensions/TrackingFlags
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/TrackingFlags')
-rw-r--r--extensions/TrackingFlags/lib/Admin.pm3
-rw-r--r--extensions/TrackingFlags/template/en/default/pages/tracking_flags_admin_edit.html.tmpl2
2 files changed, 3 insertions, 2 deletions
diff --git a/extensions/TrackingFlags/lib/Admin.pm b/extensions/TrackingFlags/lib/Admin.pm
index 5af593f08..ef7672eaa 100644
--- a/extensions/TrackingFlags/lib/Admin.pm
+++ b/extensions/TrackingFlags/lib/Admin.pm
@@ -81,6 +81,7 @@ sub admin_edit {
} else {
$vars->{message} = 'tracking_flag_updated';
}
+ $vars->{mode} = 'edit';
} else {
# initial load
@@ -145,7 +146,7 @@ sub _load_from_input {
# flag
my $flag = {
- id => $input->{flag_id} || 0,
+ id => ($input->{mode} eq 'edit' ? $input->{flag_id} : 0),
name => trim($input->{flag_name} || ''),
description => trim($input->{flag_desc} || ''),
sortkey => $input->{flag_sort} || 0,
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 17b64d41e..12c8d2c3b 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
@@ -180,7 +180,7 @@ var selected_components = [
<div>
<input type="submit" name="submit" id="submit" value="[% mode == 'edit' ? 'Save Changes' : 'Add' %]">
- [% IF !flag.bug_count %]
+ [% IF mode == "edit" && !flag.bug_count %]
<input type="hidden" name="delete" id="delete" value="">
<input type="submit" value="Delete Flag [% IF flag.activity_count %] and Activity[% END %]"
onclick="return delete_confirm('[% flag.name FILTER js FILTER html %]')">