]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 63536: User preference for whether or not to go to the next bug after processing...
authorlpsolit%gmail.com <>
Mon, 11 Jul 2005 05:37:05 +0000 (05:37 +0000)
committerlpsolit%gmail.com <>
Mon, 11 Jul 2005 05:37:05 +0000 (05:37 +0000)
checksetup.pl
process_bug.cgi
template/en/default/bug/process/next.html.tmpl [deleted file]
template/en/default/bug/show.html.tmpl
template/en/default/filterexceptions.pl
template/en/default/global/code-error.html.tmpl
template/en/default/global/setting-descs.none.tmpl

index b5158ccb3a862aa23f102d0148eccef306f4975f..09c079956d748d88b35fc5895ef489468b270123 100755 (executable)
@@ -4046,6 +4046,13 @@ add_setting ("comment_sort_order", {"oldest_to_newest" => 1,
                                     "newest_to_oldest_desc_first" => 3}, 
              "oldest_to_newest" );
 
+# 2005-05-12 bugzilla@glob.com.au -- Bug 63536
+add_setting ("post_bug_submit_action", {"next_bug" => 1,
+                                        "same_bug" => 2,
+                                        "nothing" => 3,
+                                       },
+             "next_bug" );
+
 ###########################################################################
 # Create Administrator  --ADMIN--
 ###########################################################################
index 4b6410b2c78faabbce4ce29eeb4435dc4f1d2b0d..58e52f83c5e1e0744db6d8581f909235d89c685b 100755 (executable)
@@ -193,20 +193,10 @@ if (defined $cgi->param('id')) {
 }
 
 # Set up the vars for nagiavtional <link> elements
-my $next_bug;
+my @bug_list;
 if ($cgi->cookie("BUGLIST") && defined $cgi->param('id')) {
-    my @bug_list = split(/:/, $cgi->cookie("BUGLIST"));
+    @bug_list = split(/:/, $cgi->cookie("BUGLIST"));
     $vars->{'bug_list'} = \@bug_list;
-    my $cur = lsearch(\@bug_list, $cgi->param("id"));
-    if ($cur >= 0 && $cur < $#bug_list) {
-        $next_bug = $bug_list[$cur + 1];
-
-        # Note that we only bother with the bug_id here, and get
-        # the full bug object at the end, before showing the edit
-        # page. If you change this, remember that we have not
-        # done the security checks on the next bug yet
-        $vars->{'bug'} = { bug_id => $next_bug };
-    }
 }
 
 GetVersionTable();
@@ -1829,28 +1819,47 @@ foreach my $id (@idlist) {
     }
 }
 
-# now show the next bug
-if ($next_bug) {
-    if (detaint_natural($next_bug) && Bugzilla->user->can_see_bug($next_bug)) {
-        my $bug = new Bugzilla::Bug($next_bug, $whoid);
-        ThrowCodeError("bug_error", { bug => $bug }) if $bug->error;
+# Determine if Patch Viewer is installed, for Diff link
+# (NB: Duplicate code with show_bug.cgi.)
+eval {
+    require PatchReader;
+    $vars->{'patchviewerinstalled'} = 1;
+};
 
-        # next.html.tmpl includes edit.html.tmpl, and therefore we
-        # need $bug defined in $vars.
-        $vars->{'bug'} = $bug;
+$action = Bugzilla->user->settings->{'post_bug_submit_action'}->{'value'};
 
-        # And we need to determine if Patch Viewer is installed, for
-        # Diff link (NB: Duplicate code with show_bug.cgi.)
-        eval {
-            require PatchReader;
-            $vars->{'patchviewerinstalled'} = 1;
-        };
+if ($action eq 'next_bug') {
+    my $next_bug;
+    my $cur = lsearch(\@bug_list, $cgi->param("id"));
+    if ($cur >= 0 && $cur < $#bug_list) {
+        $next_bug = $bug_list[$cur + 1];
+    }
+    if ($next_bug) {
+        if (detaint_natural($next_bug) && Bugzilla->user->can_see_bug($next_bug)) {
+            my $bug = new Bugzilla::Bug($next_bug, $whoid);
+            ThrowCodeError("bug_error", { bug => $bug }) if $bug->error;
 
-        $template->process("bug/process/next.html.tmpl", $vars)
-          || ThrowTemplateError($template->error());
+            $vars->{'bugs'} = [$bug];
+            $vars->{'nextbug'} = $bug->bug_id;
 
-        exit;
+            $template->process("bug/show.html.tmpl", $vars)
+              || ThrowTemplateError($template->error());
+
+            exit;
+        }
     }
+} elsif ($action eq 'same_bug') {
+    my $bug = new Bugzilla::Bug($cgi->param('id'), $whoid);
+    ThrowCodeError("bug_error", { bug => $bug }) if $bug->error;
+
+    $vars->{'bugs'} = [$bug];
+
+    $template->process("bug/show.html.tmpl", $vars)
+      || ThrowTemplateError($template->error());
+
+    exit;
+} elsif ($action ne 'nothing') {
+    ThrowCodeError("invalid_post_bug_submit_action");
 }
 
 # End the response page.
diff --git a/template/en/default/bug/process/next.html.tmpl b/template/en/default/bug/process/next.html.tmpl
deleted file mode 100644 (file)
index 1cd9328..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-[%# 1.0@bugzilla.org %]
-[%# 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): Myk Melez <myk@mozilla.org>
-  #%]
-
-[%# INTERFACE:
-  # bug : Bug object; the next bug to show
-  #%]
-
-[% PROCESS global/variables.none.tmpl %]
-
-<hr>
-
-<p>
-  The next [% terms.bug %] in your list is [% terms.bug %]
-  <a href="show_bug.cgi?id=[% bug.bug_id %]">[% bug.bug_id %]</a>:
-</p>
-
-<hr>
-<table border="0" cellspacing="0" width="100%">
-  <tr>
-    <td valign="top" align="left" nowrap="nowrap">
-      <font size="+1">
-        <b>[%+ terms.Bugzilla %] [%+ terms.Bug %] [%+ bug.bug_id %]</b>
-      </font>
-    </td>
-    <td valign="middle" align="left">
-      &nbsp;
-    </td>
-    <td valign="middle" align="left">
-      [% bug.short_desc FILTER html %]
-    </td>
-    <td valign="middle" align="right">
-      Last modified: [% bug.delta_ts FILTER time %]
-    </td>
-  </tr>
-</table>
-
-[% PROCESS bug/navigate.html.tmpl %]
-
-<hr>
-
-[% PROCESS "bug/edit.html.tmpl" %]
-
-<hr>
-
-[% PROCESS bug/navigate.html.tmpl %]
-
-<br>
-
-[% PROCESS global/footer.html.tmpl %]
index 8db59a9800444047e56d2f65e1af68e119fdffa3..8cb14ee4df121f64e0ff5378f8eaab1c514722d2 100644 (file)
 [%# This script/template only handles one bug #%]
 [% bug = bugs.0 %]
 
-[% filtered_desc = bug.short_desc FILTER html %]
-[% filtered_timestamp = bug.delta_ts FILTER time %]
-[% PROCESS global/header.html.tmpl
-  title = "$terms.Bug $bug.bug_id - $bug.short_desc"
-  h1 = "$terms.Bugzilla $terms.Bug $bug.bug_id"
-  h2 = filtered_desc
-  h3 = "Last modified: $filtered_timestamp"
-  bodyclasses = ['bz_bug',
-                 "bz_status_$bug.bug_status",
-                 "bz_component_$bug.component",
-                 "bz_bug_$bug.bug_id"
-                ]
-%]
+[% IF !header_done %]
+  [% filtered_desc = bug.short_desc FILTER html %]
+  [% filtered_timestamp = bug.delta_ts FILTER time %]
+  [% PROCESS global/header.html.tmpl
+    title = "$terms.Bug $bug.bug_id - $bug.short_desc"
+    h1 = "$terms.Bugzilla $terms.Bug $bug.bug_id"
+    h2 = filtered_desc
+    h3 = "Last modified: $filtered_timestamp"
+    bodyclasses = ['bz_bug',
+                   "bz_status_$bug.bug_status",
+                   "bz_component_$bug.component",
+                   "bz_bug_$bug.bug_id"
+                  ]
+  %]
+[% END %]
+
+[% IF nextbug %]
+  <hr>
+  <p>
+    The next [% terms.bug %] in your list is [% terms.bug %]
+    <a href="show_bug.cgi?id=[% bug.bug_id %]">[% bug.bug_id %]</a>:
+  </p>
+  <hr>
+[% END %]
 
 [% PROCESS bug/navigate.html.tmpl %]
 
index bfa46948160c9fed69a874ea179ca859cdb7cafc..eb6d32aef4d2cf963a4f10b377082b1a7707339b 100644 (file)
   'bug.deadline',
 ],
 
+'bug/show.html.tmpl' => [
+  'bug.bug_id',
+],
+
 'bug/show.xml.tmpl' => [
   'VERSION', 
   'a.attachid', 
   'bug_id', 
 ],
 
-'bug/process/next.html.tmpl' => [
-  'bug.bug_id', 
-],
-
 'bug/process/results.html.tmpl' => [
   'title.$type', 
   'id', 
index 36a752949a22a0a3808b86cf2493243e4064ce3a..1b7af3fea2a5f20a7a5170f663faf5a875eb8fc4 100644 (file)
     There is an internal error in the SQL query generation code,
     creating queries with implicit JOIN.
 
+  [% ELSIF error == "invalid_post_bug_submit_action" %]
+    Invalid setting for post_bug_submit_action
+
   [% ELSE %]
     [% title = "Internal error" %]
     An internal error has occured, but [% terms.Bugzilla %] doesn't know
index 1a31754a8eb8968be198b58db5d7e37c9fd87bf5..85edc19493224f803e540d5740683143030b3f1f 100644 (file)
@@ -27,5 +27,9 @@
    "off"                              => "Off",
    "oldest_to_newest"                 => "Oldest to Newest",
    "on"                               => "On"
+   "post_bug_submit_action"           => "After changing $terms.abug",
+   "next_bug"                         => "Show next $terms.bug in my list",
+   "same_bug"                         => "Show the updated $terms.bug",
+   "nothing"                          => "Do Nothing",
                    } 
 %]