From 92a81752931c5fd7cdbf4b63305389844193d029 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Mon, 7 May 2012 17:58:22 +0200 Subject: 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 --- process_bug.cgi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'process_bug.cgi') diff --git a/process_bug.cgi b/process_bug.cgi index 30e30b622..29cc54e9f 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -28,10 +28,6 @@ use Bugzilla::Bug; use Bugzilla::User; use Bugzilla::Util; use Bugzilla::Error; -use Bugzilla::Field; -use Bugzilla::Product; -use Bugzilla::Component; -use Bugzilla::Keyword; use Bugzilla::Flag; use Bugzilla::Status; use Bugzilla::Token; @@ -330,6 +326,14 @@ if (defined $cgi->param('id')) { my ($flags, $new_flags) = Bugzilla::Flag->extract_flags_from_cgi( $first_bug, undef, $vars); $first_bug->set_flags($flags, $new_flags); + + # Tags can only be set to one bug at once. + if (should_set('tag')) { + my @new_tags = split(/[\s,]+/, $cgi->param('tag')); + my ($tags_removed, $tags_added) = diff_arrays($first_bug->tags, \@new_tags); + $first_bug->remove_tag($_) foreach @$tags_removed; + $first_bug->add_tag($_) foreach @$tags_added; + } } ############################## -- cgit v1.2.3-24-g4f1b