]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 509108: Don't require a bug_list parameter to show the bug template (create the...
authormkanat%bugzilla.org <>
Wed, 12 Aug 2009 01:42:32 +0000 (01:42 +0000)
committermkanat%bugzilla.org <>
Wed, 12 Aug 2009 01:42:32 +0000 (01:42 +0000)
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit

Bugzilla/Template.pm
post_bug.cgi
process_bug.cgi
show_bug.cgi
template/en/default/bug/create/created.html.tmpl
template/en/default/bug/navigate.html.tmpl
template/en/default/filterexceptions.pl
template/en/default/global/site-navigation.html.tmpl

index 22ea4b7ccb6e369a7590d663b8aec30994393447..d897cd946a9117180bf8489a316c6c9085dbf3d2 100644 (file)
@@ -756,7 +756,15 @@ sub create {
 
             # Whether or not keywords are enabled, in this Bugzilla.
             'use_keywords' => sub { return Bugzilla::Keyword->any_exist; },
-                
+
+            'last_bug_list' => sub {
+                my @bug_list;
+                my $cgi = Bugzilla->cgi;
+                if ($cgi->cookie("BUGLIST")) {
+                    @bug_list = split(/:/, $cgi->cookie("BUGLIST"));
+                }
+                return \@bug_list;
+            },
 
             # These don't work as normal constants.
             DB_MODULE        => \&Bugzilla::Constants::DB_MODULE,
index c6e4006e04ecf9466101d5c497dda747e69226ae..f3b31e9a8db97ce608159d87f441df61fd3e29ac 100755 (executable)
@@ -274,12 +274,6 @@ foreach my $i (@{$bug->dependson || []}, @{$bug->blocked || []}) {
     push (@{$vars->{'sentmail'}}, { type => 'dep', id => $i, });
 }
 
-my @bug_list;
-if ($cgi->cookie("BUGLIST")) {
-    @bug_list = split(/:/, $cgi->cookie("BUGLIST"));
-}
-$vars->{'bug_list'} = \@bug_list;
-
 if ($token) {
     trick_taint($token);
     $dbh->do('UPDATE tokens SET eventdata = ? WHERE token = ?', undef, 
index 85e6c60fc6fc71303cfcae600277f11d675fdf1e..c46dd6fb521201f7f9dcbded091dc9e5e10e3200 100755 (executable)
@@ -202,7 +202,6 @@ $vars->{'title_tag'} = "bug_processed";
 my @bug_list;
 if ($cgi->cookie("BUGLIST")) {
     @bug_list = split(/:/, $cgi->cookie("BUGLIST"));
-    $vars->{'bug_list'} = \@bug_list;
 }
 
 my ($action, $next_bug);
index c0e54323488bee73c851151d732b66224e6b5c41..4a530269e73b70de19eab29b3cc93e6950acdfef 100755 (executable)
@@ -103,14 +103,6 @@ $vars->{'marks'} = \%marks;
 my @bugids = map {$_->bug_id} grep {!$_->error} @bugs;
 $vars->{'bugids'} = join(", ", @bugids);
 
-# Next bug in list (if there is one)
-my @bug_list;
-if ($cgi->cookie("BUGLIST")) {
-    @bug_list = split(/:/, $cgi->cookie("BUGLIST"));
-}
-
-$vars->{'bug_list'} = \@bug_list;
-
 # Work out which fields we are displaying (currently XML only.)
 # If no explicit list is defined, we show all fields. We then exclude any
 # on the exclusion list. This is so you can say e.g. "Everything except 
index 0a03a4d71069e920b1304f42156a954da5626c4b..dd1be1c178e485ec20c2055ebc17bb1919adbdf0 100644 (file)
@@ -28,8 +28,6 @@
   #     this contents, see template bug/process/bugmail.html.tmpl
   # bug: object; Bugzilla::Bug object of the bug that was created (used in
   #     template bug/edit.html.tmpl
-  # bug_list: array of integers; sorted bug list (used in template
-  #     bug/navigate.html.tmpl)
   #%]
 
 [% PROCESS global/variables.none.tmpl %]
index 7b8f3c827400503a546ff0bfdd5691d1fb287703..9592301f719f9f5261a95e855aac69438cb325f3 100644 (file)
 
 
 <div class="navigation">
-[% IF bug_list && bug_list.size > 0 %]
-  [% this_bug_idx = lsearch(bug_list, bug.bug_id) %]
+[% IF last_bug_list.size > 0 %]
+  [% this_bug_idx = lsearch(last_bug_list, bug.id) %]
   <b>[% terms.Bug %] List:</b>
   [% IF this_bug_idx != -1 %]
-    ([% this_bug_idx + 1 %] of [% bug_list.size %])
+    ([% this_bug_idx + 1 %] of [% last_bug_list.size %])
   [% END %]
 
 [% IF this_bug_idx != -1 %]
-  <a href="show_bug.cgi?id=[% bug_list.first %]">First</a>
-  <a href="show_bug.cgi?id=[% bug_list.last %]">Last</a>
+  <a href="show_bug.cgi?id=[% last_bug_list.first FILTER url_quote %]">First</a>
+  <a href="show_bug.cgi?id=[% last_bug_list.last FILTER url_quote %]">Last</a>
 [% END %]
 
   [% IF bug.bug_id %]
     [% IF this_bug_idx != -1 %]
       [% IF this_bug_idx > 0 %]
         [% prev_bug = this_bug_idx - 1 %]
-        <a href="show_bug.cgi?id=[% bug_list.$prev_bug %]">Prev</a>
+        <a href="show_bug.cgi?id=
+                 [%- last_bug_list.$prev_bug FILTER url_quote %]">Prev</a>
       [% ELSE %]
         <i><font color="#777777">Prev</font></i>
       [% END %]
 
-      [% IF this_bug_idx + 1 < bug_list.size %]
+      [% IF this_bug_idx + 1 < last_bug_list.size %]
         [% next_bug = this_bug_idx + 1 %]
-        <a href="show_bug.cgi?id=[% bug_list.$next_bug %]">Next</a>
+        <a href="show_bug.cgi?id=
+                 [%- last_bug_list.$next_bug FILTER url_quote %]">Next</a>
       [% ELSE %]
         <i><font color="#777777">Next</font></i>
       [% END %]
@@ -72,7 +74,6 @@
 
   &nbsp;&nbsp;<a href="buglist.cgi?regetlastlist=1">Show last search results</a>
 [% ELSE %]
-  [%# Either !bug_list || bug_list.size <= 0 %]
   [%# With no list, don't show link to search results %]
   <i><font color="#777777">First</font></i>
   <i><font color="#777777">Last</font></i>
index 11c2804a8bbe27991f09c2e902a9cb7e14daee74..7e0d99c36f9f083735fb7ec2e90c7de0b041c152 100644 (file)
 ],
 
 'global/site-navigation.html.tmpl' => [
-  'bug_list.first', 
-  'bug_list.$prev_bug', 
-  'bug_list.$next_bug', 
-  'bug_list.last', 
   'bug.bug_id', 
   'bug.votes', 
 ],
   '" spellcheck=\"$spellcheck\"" IF spellcheck',
 ],
 
-'bug/navigate.html.tmpl' => [
-  'bug_list.first', 
-  'bug_list.last', 
-  'bug_list.$prev_bug', 
-  'bug_list.$next_bug', 
-],
-
 'bug/show-multiple.html.tmpl' => [
   'attachment.id', 
   'flag.status',
index 5440fe1f8842c5b2f0b7ea2f73c3aac6258b3627..df60b76387b48a19f3c1a02d70cee443c2b884cb 100644 (file)
@@ -20,7 +20,6 @@
   #%]
 
 [%# INTERFACE:
-  # bug_list: list of integers. List of bug numbers of current query (if any).
   # bug.bug_id: integer. Number of current bug (for navigation purposes)
   #%]
 
 [% IF NOT (cgi.user_agent("MSIE [1-6]") OR cgi.user_agent("Mozilla/4")) %]
   <link rel="Top" href="[% urlbase FILTER html %]">
 
-  [%# *** Bug List Navigation *** %]
-  [% IF bug_list && bug_list.size > 0 %]
-    <link rel="Up" href="buglist.cgi?regetlastlist=1">
-
-    <link rel="First" href="show_bug.cgi?id=[% bug_list.first %]">
-    <link rel="Last" href="show_bug.cgi?id=[% bug_list.last %]">
-
-    [% IF bug && bug.bug_id %]
-      [% current_bug_idx = lsearch(bug_list, bug.bug_id) %]
-      [% IF current_bug_idx != -1 %]
-
-        [% IF current_bug_idx > 0 %]
-          [% prev_bug = current_bug_idx - 1 %]
-          <link rel="Prev" href="show_bug.cgi?id=[% bug_list.$prev_bug %]">
-        [% END %]
-
-        [% IF current_bug_idx + 1 < bug_list.size %]
-          [% next_bug = current_bug_idx + 1 %]
-          <link rel="Next" href="show_bug.cgi?id=[% bug_list.$next_bug %]">
-        [% END %]
-
-      [% END %]
-    [% END %]
-  [% END %]
-
   [%# *** Attachment *** %]
   [% IF attachment && attachment.bug_id %]
     <link rel="Up" href="show_bug.cgi?id=[% attachment.bug_id FILTER none %]">