diff --git a/webtools/bugzilla/editkeywords.cgi b/webtools/bugzilla/editkeywords.cgi index 7af0c1a6c2f7..cf2c44efc4f2 100755 --- a/webtools/bugzilla/editkeywords.cgi +++ b/webtools/bugzilla/editkeywords.cgi @@ -25,6 +25,8 @@ use lib "."; require "CGI.pl"; +use vars qw($template $vars); + my $localtrailer = "edit more keywords"; @@ -126,6 +128,8 @@ unless (UserInGroup("editkeywords")) { my $action = trim($::FORM{action} || ''); +$vars->{'action'} = $action; + detaint_natural($::FORM{id}); @@ -180,20 +184,12 @@ if ($action eq "") { if ($action eq 'add') { - PutHeader("Add keyword"); - print "
"; - - my $other = $localtrailer; - $other =~ s/more/other/; - PutTrailer($other); exit; } @@ -308,8 +304,6 @@ if ($action eq 'edit') { # if ($action eq 'update') { - PutHeader("Update keyword"); - my $id = $::FORM{id}; my $name = trim($::FORM{name} || ''); my $description = trim($::FORM{description} || ''); @@ -321,6 +315,8 @@ if ($action eq 'update') { my $tmp = FetchOneColumn(); if ($tmp && $tmp != $id) { + PutHeader("Update keyword"); + print "The keyword '$name' already exists. Please press\n"; print "Back and try again.\n"; PutTrailer($localtrailer); @@ -331,26 +327,27 @@ if ($action eq 'update') { ", description = " . SqlQuote($description) . " WHERE id = $id"); - print "Keyword updated.$name
keyword?
+ $vars->{'bug_count'} = $bugs;
+ $vars->{'keyword_id'} = $id;
+ $vars->{'name'} = $name;
-
-};
+ print Bugzilla->cgi->header();
+
+ $template->process("admin/keywords/confirm-delete.html.tmpl",
+ $vars)
+ || ThrowTemplateError($template->error());
- PutTrailer($localtrailer);
exit;
}
}
@@ -380,31 +372,17 @@ to delete the $name
keyword?
SendSQL("DELETE FROM keywords WHERE keywordid = $id");
SendSQL("DELETE FROM keyworddefs WHERE id = $id");
- print "Keyword $name deleted.\n";
-
- &RebuildCacheWarning;
# Make versioncache flush
unlink "data/versioncache";
- PutTrailer($localtrailer);
+ print Bugzilla->cgi->header();
+
+ $vars->{'name'} = $name;
+ $template->process("admin/keywords/rebuild-cache.html.tmpl",
+ $vars)
+ || ThrowTemplateError($template->error());
+
exit;
}
-PutHeader("Error");
-print "I don't have a clue what you want.
+ [% IF bug_count == 1 %]
+ There is one [% terms.bug %] with this keyword set.
+ [% ELSE %]
+ There are [% bug_count %] [%+terms.bugs %] with
+ this keyword set.
+ [% END %]
+
+ Are you sure you want to delete
+ the [% name FILTER html %]
keyword?
+
Go back to the query page +or edit other keywords.
+ +[% PROCESS global/footer.html.tmpl %] diff --git a/webtools/bugzilla/template/en/default/admin/keywords/create.html.tmpl b/webtools/bugzilla/template/en/default/admin/keywords/create.html.tmpl new file mode 100644 index 000000000000..49698a1db115 --- /dev/null +++ b/webtools/bugzilla/template/en/default/admin/keywords/create.html.tmpl @@ -0,0 +1,55 @@ + +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # The Initial Developer of the Original Code is Netscape Communications + # Corporation. Portions created by Netscape are + # Copyright (C) 1998 Netscape Communications Corporation. All + # Rights Reserved. + # + # Contributor(s): Terry WeissmanGo back to the query page +or edit other keywords.
+ +[% PROCESS global/footer.html.tmpl %] diff --git a/webtools/bugzilla/template/en/default/admin/keywords/rebuild-cache.html.tmpl b/webtools/bugzilla/template/en/default/admin/keywords/rebuild-cache.html.tmpl new file mode 100644 index 000000000000..4c4ea4b9aa14 --- /dev/null +++ b/webtools/bugzilla/template/en/default/admin/keywords/rebuild-cache.html.tmpl @@ -0,0 +1,56 @@ + +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # The Initial Developer of the Original Code is Netscape Communications + # Corporation. Portions created by Netscape are + # Copyright (C) 1998 Netscape Communications Corporation. All + # Rights Reserved. + # + # Contributor(s): Terry Weissman
+ After you have finished deleting or modifying keywords,
+ you need to rebuild the keyword cache.
+
+ Warning: on a very large installation of [% terms.Bugzilla %],
+ this can take several minutes.
+
Go back to the query page or +edit more keywords.
+ +[% PROCESS global/footer.html.tmpl %] diff --git a/webtools/bugzilla/template/en/default/filterexceptions.pl b/webtools/bugzilla/template/en/default/filterexceptions.pl index 56f20be72f79..d5f6b4d86a89 100644 --- a/webtools/bugzilla/template/en/default/filterexceptions.pl +++ b/webtools/bugzilla/template/en/default/filterexceptions.pl @@ -491,6 +491,11 @@ 'const.CONTROLMAPMANDATORY', ], +'admin/keywords/confirm-delete.html.tmpl' => [ + 'keyword_id', + 'bug_count', +], + 'admin/flag-type/confirm-delete.html.tmpl' => [ 'flag_count', 'flag_type.id',