# 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,
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,
my @bug_list;
if ($cgi->cookie("BUGLIST")) {
@bug_list = split(/:/, $cgi->cookie("BUGLIST"));
- $vars->{'bug_list'} = \@bug_list;
}
my ($action, $next_bug);
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
# 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 %]
<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 %]
<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>
],
'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',
#%]
[%# 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 %]">