summaryrefslogtreecommitdiffstats
path: root/buglist.cgi
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2012-05-07 17:58:22 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-05-07 17:58:22 +0200
commit92a81752931c5fd7cdbf4b63305389844193d029 (patch)
tree13cae837e5d0491e9ad5d6426b558de741d261eb /buglist.cgi
parent4e5dcf363dd1ffa63f0d7a190fa61891061ddea2 (diff)
downloadbugzilla-92a81752931c5fd7cdbf4b63305389844193d029.tar.gz
bugzilla-92a81752931c5fd7cdbf4b63305389844193d029.tar.xz
Bug 616191: Implement UI to easily tag bugs from the bug report directly (and get rid of the current form in the footer)
r=timello a=LpSolit
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-xbuglist.cgi53
1 files changed, 9 insertions, 44 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 89ba3fe46..f0e778464 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -23,10 +23,8 @@ use Bugzilla::Search;
use Bugzilla::Search::Quicksearch;
use Bugzilla::Search::Recent;
use Bugzilla::Search::Saved;
-use Bugzilla::User;
use Bugzilla::Bug;
use Bugzilla::Product;
-use Bugzilla::Keyword;
use Bugzilla::Field;
use Bugzilla::Status;
use Bugzilla::Token;
@@ -445,51 +443,18 @@ elsif (($cmdtype eq "doit") && defined $cgi->param('remtype')) {
my $new_query = $cgi->param('newquery');
my $token = $cgi->param('token');
check_hash_token($token, ['savedsearch']);
- # If list_of_bugs is true, we are adding/removing tags to/from
- # individual bugs.
- if ($cgi->param('list_of_bugs')) {
- # We add/remove tags based on the action choosen.
- my $action = trim($cgi->param('action') || '');
- $action =~ /^(add|remove)$/
- || ThrowUserError('unknown_action', {action => $action});
-
- my $method = "${action}_tag";
-
- # If no new tag name has been given, use the selected one.
- $query_name ||= $cgi->param('oldqueryname')
- or ThrowUserError('no_tag_to_edit', {action => $action});
-
- my @buglist;
- # Validate all bug IDs before editing tags in any of them.
- foreach my $bug_id (split(/[\s,]+/, $cgi->param('bug_ids'))) {
- next unless $bug_id;
- push(@buglist, Bugzilla::Bug->check($bug_id));
- }
-
- foreach my $bug (@buglist) {
- $bug->$method($query_name);
- }
-
- $vars->{'message'} = 'tag_updated';
- $vars->{'action'} = $action;
- $vars->{'tag'} = $query_name;
- $vars->{'buglist'} = [map { $_->id } @buglist];
+ my $existed_before = InsertNamedQuery($query_name, $new_query, 1);
+ if ($existed_before) {
+ $vars->{'message'} = "buglist_updated_named_query";
}
else {
- my $existed_before = InsertNamedQuery($query_name, $new_query, 1);
- if ($existed_before) {
- $vars->{'message'} = "buglist_updated_named_query";
- }
- else {
- $vars->{'message'} = "buglist_new_named_query";
- }
-
- # Make sure to invalidate any cached query data, so that the footer is
- # correctly displayed
- $user->flush_queries_cache();
-
- $vars->{'queryname'} = $query_name;
+ $vars->{'message'} = "buglist_new_named_query";
}
+ $vars->{'queryname'} = $query_name;
+
+ # Make sure to invalidate any cached query data, so that the footer is
+ # correctly displayed
+ $user->flush_queries_cache();
print $cgi->header();
$template->process("global/message.html.tmpl", $vars)