]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 581690: Restore the ability to move several bugs at once to another installation
authorFrédéric Buclin <LpSolit@gmail.com>
Thu, 12 Aug 2010 23:16:15 +0000 (01:16 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Thu, 12 Aug 2010 23:16:15 +0000 (01:16 +0200)
r=ghendricks a=LpSolit

extensions/OldBugMove/Extension.pm
extensions/OldBugMove/template/en/default/hook/bug/edit-after_comment_textarea.html.tmpl
extensions/OldBugMove/template/en/default/hook/list/edit-multiple-after_groups.html.tmpl [new file with mode: 0644]
template/en/default/list/edit-multiple.html.tmpl

index c6b5659b07cc6adab17a0c314940ffdcc4af509e..3aca16a5739274ee7b4cf5bb0d8dcfe711752924 100644 (file)
@@ -107,7 +107,7 @@ sub object_end_of_set_all {
     my ($self, $args) = @_;
     my $object = $args->{'object'};
 
-    if ($object->isa('Bugzilla::Bug') and _bug_is_moving($object)) {
+    if ($object->isa('Bugzilla::Bug') and Bugzilla->input_params->{'oldbugmove'}) {
         my $new_status = Bugzilla->params->{'duplicate_or_move_bug_status'};
         $object->set_bug_status($new_status, { resolution => 'MOVED' });
     }
@@ -132,7 +132,7 @@ sub _check_bug_resolution {
     my $original_validator = shift;
     my ($invocant, $resolution) = @_;
 
-    if ($resolution eq 'MOVED' and !_bug_is_moving($invocant)) {
+    if ($resolution eq 'MOVED' and !Bugzilla->input_params->{'oldbugmove'}) {
         # MOVED has a special meaning and can only be used when
         # really moving bugs to another installation.
         ThrowUserError('oldbugmove_no_manual_move');
@@ -198,12 +198,6 @@ sub _move_bug {
     MessageToMTA($msg);
 }
 
-sub _bug_is_moving {
-    my $bug = shift;
-    my $oldbugmove = Bugzilla->input_params->{"oldbugmove_" . $bug->id};
-    return $oldbugmove ? 1 : 0;
-}
-
 sub _user_is_mover {
     my $user = shift;
 
index 71fe0659010b7e74ea91d4ebb3ee42f3d96cedfe..0a7a4fa2787cfe4584233c6ea02af5b6b03c0f00 100644 (file)
@@ -19,9 +19,9 @@
   #%]
 
 [% IF oldbugmove_user_is_mover(user) AND bug.resolution != 'MOVED' %]
-  <br>
-  <input type="submit" name="oldbugmove_[% bug.id FILTER html %]"
-         id="oldbugmove" 
-         value="Move [% terms.Bug FILTER html %] to 
-                [%= Param('move-to-url') FILTER html %]">
+  <p>
+    <input type="submit" id="oldbugmove" name="oldbugmove"
+           value="Move [% terms.Bug FILTER html %] to 
+                  [%= Param('move-to-url') FILTER html %]">
+  </p>
 [% END %]
diff --git a/extensions/OldBugMove/template/en/default/hook/list/edit-multiple-after_groups.html.tmpl b/extensions/OldBugMove/template/en/default/hook/list/edit-multiple-after_groups.html.tmpl
new file mode 100644 (file)
index 0000000..10e6f73
--- /dev/null
@@ -0,0 +1,28 @@
+[%# 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 Everything Solved, Inc.
+  # Portions created by the Initial Developer are Copyright (C) 2010
+  # the Initial Developer. All Rights Reserved.
+  #
+  # Contributor(s):
+  #   Max Kanat-Alexander <mkanat@bugzilla.org>
+  #   Frédéric Buclin <LpSolit@gmail.com>
+  #%]
+
+[% IF oldbugmove_user_is_mover(user) %]
+  <p>
+    <input type="submit" id="oldbugmove" name="oldbugmove"
+           value="Move [% terms.Bugs FILTER html %] to 
+                  [%= Param('move-to-url') FILTER html %]">
+  </p>
+[% END %]
index 736f2c71a2647cb5068f25edf58c20d9d6001fe8..1f22624d648b7792e9ecbd2c1a37a5fad59cad59 100644 (file)
   [% END %]
 
 [% END %]
+
+[%+ Hook.process('after_groups') %]
+
 <input type="submit" id="commit" value="Commit">
 
 [%############################################################################%]