use Bugzilla::Constants;
use Bugzilla::Field;
-# Note that this line doesn't actually import these variables for some reason,
-# so I have to use them as $::template and $::vars in the package code.
-use vars qw($template $vars);
-
######################################################################
# Global Variables
######################################################################
sub notify {
my ($flag, $template_file) = @_;
+ my $template = Bugzilla->template;
+ my $vars = {};
+
my $attachment_is_private = $flag->{'target'}->{'attachment'} ?
$flag->{'target'}->{'attachment'}->{'isprivate'} : undef;
$flag->{'requestee'}->{'email'} .= Param('emailsuffix');
$flag->{'setter'}->{'email'} .= Param('emailsuffix');
- $::vars->{'flag'} = $flag;
+ $vars->{'flag'} = $flag;
my $message;
my $rv =
- $::template->process($template_file, $::vars, \$message);
+ $template->process($template_file, $vars, \$message);
if (!$rv) {
Bugzilla->cgi->header();
- ThrowTemplateError($::template->error());
+ ThrowTemplateError($template->error());
}
Bugzilla::BugMail::MessageToMTA($message);
use Date::Format ();
use base qw(Template);
-use vars qw($vars);
# Convert the constants in the Bugzilla::Constants module into a hash we can
# pass to the template object for reflection into its "constants" namespace
sub put_header {
my $self = shift;
+ my $vars = {};
($vars->{'title'}, $vars->{'h1'}, $vars->{'h2'}) = (@_);
$self->process("global/header.html.tmpl", $vars)
sub put_footer {
my $self = shift;
- $self->process("global/footer.html.tmpl", $vars)
+ $self->process("global/footer.html.tmpl")
|| ThrowTemplateError($self->error());
}
# Mail the user the token along with instructions for using it.
- my $template = $::template;
- my $vars = $::vars;
+ my $template = Bugzilla->template;
+ my $vars = {};
$vars->{'oldemailaddress'} = $old_email . Param('emailsuffix');
$vars->{'newemailaddress'} = $new_email . Param('emailsuffix');
# Mail the user the token along with instructions for using it.
- my $template = $::template;
- my $vars = $::vars;
+ my $template = Bugzilla->template;
+ my $vars = {};
$vars->{'token'} = $token;
$vars->{'emailaddress'} = $loginname . Param('emailsuffix');
# This should only happen when the user accidentally makes a token request
# or when a malicious hacker makes a token request on behalf of a user.
- my ($token, $cancelaction) = @_;
+ my ($token, $cancelaction, $vars) = @_;
my $dbh = Bugzilla->dbh;
+ $vars ||= {};
# Quote the token for inclusion in SQL statements.
my $quotedtoken = &::SqlQuote($token);
# Get the email address of the Bugzilla maintainer.
my $maintainer = Param('maintainer');
- my $template = $::template;
- my $vars = $::vars;
+ my $template = Bugzilla->template;
$vars->{'emailaddress'} = $loginname . Param('emailsuffix');
$vars->{'maintainer'} = $maintainer;
# prepare default form values
- my $vars = $::vars;
-
# What does a "--do_not_change--" field look like (if any)?
my $dontchange = $cgi->param('dontchange');
# Skip confirmation if we were told to, or if we don't need to confirm.
return $retval if ($behavior == MATCH_SKIP_CONFIRM || !$need_confirm);
+ my $template = Bugzilla->template;
+ my $vars = {};
+
$vars->{'script'} = $ENV{'SCRIPT_NAME'}; # for self-referencing URLs
$vars->{'fields'} = $fields; # fields being matched
$vars->{'matches'} = $matches; # matches that were made
print Bugzilla->cgi->header();
- $::template->process("global/confirm-user-match.html.tmpl", $vars)
- || ThrowTemplateError($::template->error());
+ $template->process("global/confirm-user-match.html.tmpl", $vars)
+ || ThrowTemplateError($template->error());
exit;
use lib qw(.);
-use vars qw($template $vars);
-
# Include the Bugzilla CGI and general utility library.
require "globals.pl";
use Bugzilla::Config qw(:locations);
Bugzilla->login();
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
################################################################################
# Main Body Execution
use lib qw(.);
-use vars qw($template $vars);
-
use Bugzilla;
use Bugzilla::Search;
use Bugzilla::Search::Quicksearch;
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $template = Bugzilla->template;
+my $vars = {};
my $buffer = $cgi->query_string();
if (length($buffer) == 0) {
use Bugzilla::Series;
use Bugzilla::User;
-use vars qw($vars);
-
my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
+my $vars = {};
# Go back to query.cgi if we are adding a boolean chart parameter.
if (grep(/^cmd-/, $cgi->param())) {
use vars qw(
@legal_keywords
- $template
- $vars
);
use Bugzilla;
GetVersionTable();
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
# The master list not only says what fields are possible, but what order
# they get displayed in.
# Use the global template variables defined in globals.pl
# to generate the output.
-use vars qw($vars);
my $user = Bugzilla->login(LOGIN_OPTIONAL);
GetVersionTable();
# Pass a bunch of Bugzilla configuration to the templates.
+my $vars = {};
$vars->{'priority'} = \@::legal_priority;
$vars->{'severity'} = \@::legal_severity;
$vars->{'platform'} = \@::legal_platform;
use Bugzilla::BugMail;
use Bugzilla::Util;
-# Shut up misguided -w warnings about "used only once":
-use vars qw($template $vars);
-
# Just in case someone already has an account, let them get the correct footer
# on an error message. The user is logged out just after the account is
# actually created.
my $dbh = Bugzilla->dbh;
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
+
print $cgi->header();
# If we're using LDAP for login, then we can't create a new account here.
use Bugzilla::Constants;
require "globals.pl";
-use vars qw($vars @legal_product);
+use vars qw(@legal_product);
my $user = Bugzilla->login();
my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
+my $vars = {};
my $product = trim($cgi->param('product') || '');
my $product_id = get_product_id($product);
require "globals.pl";
-# Use the global template variables.
-use vars qw($vars $template);
-
Bugzilla->login();
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $template = Bugzilla->template;
+my $vars = {};
SendSQL("SELECT keyworddefs.name, keyworddefs.description,
COUNT(keywords.bug_id)
exit;
}
-# Use global templatisation variables.
-use vars qw($template $vars);
+my $template = Bugzilla->template;
+my $vars = {};
GetVersionTable();
use Bugzilla::Component;
use Bugzilla::Bug;
-use vars qw($template $vars);
-
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $template = Bugzilla->template;
+my $vars = {};
#
# Preliminary checks:
use Bugzilla::Group;
use Bugzilla::Util;
-use vars qw( $template $vars );
+my $template = Bugzilla->template;
+my $vars = {};
# Make sure the user is logged in and is an administrator.
my $user = Bugzilla->login(LOGIN_REQUIRED);
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
-
-use vars qw($template $vars);
+my $template = Bugzilla->template;
+my $vars = {};
my $user = Bugzilla->login(LOGIN_REQUIRED);
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
-
-use vars qw($template $vars);
-
+my $template = Bugzilla->template;
+my $vars = {};
sub Validate {
my ($name, $description) = @_;
use Bugzilla::Milestone;
use Bugzilla::Bug;
-use vars qw($template $vars);
-
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $template = Bugzilla->template;
+my $vars = {};
#
# Preliminary checks:
use Bugzilla::Config::Common;
require "globals.pl";
-use vars qw($vars @parampanels);
+use vars qw(@parampanels);
my $user = Bugzilla->login(LOGIN_REQUIRED);
my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
+my $vars = {};
print $cgi->header();
use strict;
use lib ".";
-use vars qw ($template $vars);
use Bugzilla::Constants;
require "globals.pl";
use Bugzilla::Bug;
my $whoid = $user->id;
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
+
print $cgi->header();
$user->in_group('editcomponents')
require "globals.pl";
-# Use global template variables.
-use vars qw($template $vars);
+my $template = Bugzilla->template;
+my $vars = {};
###############################
### Subroutine Definitions ###
require "globals.pl";
-use vars qw( $vars );
-
use Bugzilla;
use Bugzilla::User;
use Bugzilla::Bug;
my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
+my $vars = {};
my $dbh = Bugzilla->dbh;
my $user = Bugzilla->user;
my $userid = $user->id;
use Bugzilla::Product;
use Bugzilla::Version;
-use vars qw($template $vars);
-
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $template = Bugzilla->template;
+my $vars = {};
#
# Preliminary checks:
use lib ".";
require "globals.pl";
-use vars qw( $vars );
-
use Bugzilla::Constants;
use Bugzilla::User;
use Bugzilla::Group;
my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
+my $vars = {};
my $dbh = Bugzilla->dbh;
my $userid = $user->id;
require "globals.pl";
use vars qw(
- $template
- $vars
@enterable_products
@legal_opsys
@legal_platform
my $cloned_bug_id;
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
my $product = $cgi->param('product');
$zz = @main::milestoneurl;
$zz = %main::proddesc;
$zz = @main::prodmaxvotes;
- $zz = $main::template;
$zz = $main::userid;
- $zz = $main::vars;
}
#
use Bugzilla;
-$::template = Bugzilla->template();
-
-$::vars = {};
-
1;
use lib ".";
require "globals.pl";
-use vars qw($vars);
-
# Check whether or not the user is logged in and, if so, set the $::userid
use Bugzilla::Constants;
Bugzilla->login(LOGIN_OPTIONAL);
print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
-$template->process("index.html.tmpl", $vars)
+$template->process("index.html.tmpl")
|| ThrowTemplateError($template->error());
require "globals.pl";
-use vars qw($template $vars);
-
Bugzilla->login();
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
my $id = $cgi->param('id');
if ($id) {
print $cgi->header($format->{'ctype'});
- $template->process("$format->{'template'}", $vars)
+ $template->process("$format->{'template'}")
|| ThrowTemplateError($template->error());
}
else {
$zz = %::target_milestone;
}
-# Use global template variables.
-use vars qw($vars $template);
-
my $user = Bugzilla->login(LOGIN_REQUIRED);
+
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $template = Bugzilla->template;
+my $vars = {};
# do a match on the fields if applicable
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $template = Bugzilla->template;
+my $vars = {};
my $requiremilestone = 0;
-use vars qw($template $vars);
-
######################################################################
# Begin Data/Security Validation
######################################################################
@log_columns
%versions
%components
- $template
- $vars
);
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $template = Bugzilla->template;
+my $vars = {};
my $buffer = $cgi->query_string();
if ($cgi->param("GoAheadAndLogIn")) {
use strict;
-use vars qw($userid $template $vars);
+use vars qw($userid);
use lib qw(.);
Bugzilla->login(LOGIN_REQUIRED);
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
my $action = $cgi->param('action') || "";
require "globals.pl";
-use vars qw($template $vars @legal_opsys @legal_platform @legal_severity);
+use vars qw(@legal_opsys @legal_platform @legal_severity);
use Bugzilla;
use Bugzilla::Constants;
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
my $buffer = $cgi->query_string();
# Go straight back to query.cgi if we are adding a boolean chart.
my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
+my $vars = {};
# We only want those products that the user has permissions for.
my @myproducts;
print $cgi->header(-Content_Disposition=>'inline; filename=bugzilla_report.html');
$template->put_header("Bug Charts");
+ $vars->{'header_done'} = 1;
show_chart($product);
print $cgi->header();
$template->put_header("Bug Charts");
+ $vars->{'header_done'} = 1;
print <<FIN;
<center>
my ($product) = @_;
if (! defined $cgi->param('datasets')) {
- ThrowUserError("missing_datasets");
+ ThrowUserError("missing_datasets", $vars);
}
my $datasets = join('', $cgi->param('datasets'));
$product = '';
}
- ThrowCodeError("chart_data_not_generated", {'product' => $product});
+ $vars->{'product'} = $product;
+ ThrowCodeError("chart_data_not_generated", $vars);
}
my @fields;
if (/^#/) {
if (/^# fields?: (.*)\s*$/) {
@fields = split /\||\r/, $1;
- ThrowCodeError("chart_datafile_corrupt", {file => $data_file})
- unless $fields[0] =~ /date/i;
+ unless ($fields[0] =~ /date/i) {
+ $vars->{'file'} = $data_file;
+ ThrowCodeError("chart_datafile_corrupt", $vars);
+ }
push @labels, grep($datasets{$_}, @fields);
}
next;
}
- ThrowCodeError("chart_datafile_corrupt", {file => $data_file})
- unless @fields;
+ unless (@fields) {
+ $vars->{'file'} = $data_file;
+ ThrowCodeError("chart_datafile_corrupt", $vars);
+ }
my @line = split /\|/;
my $date = $line[0];
close FILE;
if (! @{$data{DATE}}) {
- ThrowUserError("insufficient_data_points");
+ ThrowUserError("insufficient_data_points", $vars);
}
my $img = Chart::Lines->new (800, 600);
use Bugzilla::FlagType;
use Bugzilla::User;
-use vars qw($template $vars);
-
# Make sure the user is logged in.
my $user = Bugzilla->login();
my $userid = $user->id;
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
################################################################################
use strict;
use lib qw(.);
-use vars qw ($template $vars);
require "globals.pl";
use Bugzilla::Bug;
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
###############################################################################
# Begin Data/Security Validation
require "globals.pl";
-use vars qw($template $vars $userid);
+use vars qw($userid);
use Bugzilla::Bug;
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
if ($cgi->param('GoAheadAndLogIn')) {
Bugzilla->login(LOGIN_REQUIRED);
Bugzilla->login();
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
# Connect to the shadow database if this installation is using one to improve
# performance.
Bugzilla->switch_to_shadow_db();
-use vars qw($template $vars $userid);
+use vars qw($userid);
my %seen;
my %edgesdone;
use Bugzilla::User;
use Bugzilla::Bug;
-# Use global template variables.
-use vars qw($template $vars);
-
Bugzilla->login();
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
# Connect to the shadow database if this installation is using one to improve
# performance.
use lib ".";
require "globals.pl";
-# Shut up "Used Only Once" errors
-use vars qw($template $vars);
-
Bugzilla->login();
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
###############################################################################
# Main Body Execution
if ($useragent =~ m:Mozilla/([1-9][0-9]*):i && $1 >= 5 && $useragent !~ m/compatible/i) {
print $cgi->header("application/vnd.mozilla.xul+xml");
# Generate and return the XUL from the appropriate template.
- $template->process("sidebar.xul.tmpl", $vars)
+ $template->process("sidebar.xul.tmpl")
|| ThrowTemplateError($template->error());
} else {
ThrowUserError("sidebar_supports_mozilla_only");
use Bugzilla::User; # UserInGroup
require "globals.pl";
-GetVersionTable();
+my $template = Bugzilla->template;
+my $vars = {};
-# Use global template variables.
-use vars qw($template $vars);
+GetVersionTable();
#
# Date handling
use lib qw(.);
-use vars qw($template $vars);
-
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Util;
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $template = Bugzilla->template;
+my $vars = {};
# Include the Bugzilla CGI and general utility library.
require "globals.pl";
# confirmed initially so cancel token if it is not still available
if (! is_available_username($new_email,$old_email)) {
$vars->{'email'} = $new_email; # Needed for Bugzilla::Token::Cancel's mail
- Bugzilla::Token::Cancel($::token,"account_exists");
+ Bugzilla::Token::Cancel($::token, "account_exists", $vars);
ThrowUserError("account_exists", { email => $new_email } );
}
$vars->{'old_email'} = $old_email;
$vars->{'new_email'} = $new_email;
- Bugzilla::Token::Cancel($::token, $vars->{'message'});
+ Bugzilla::Token::Cancel($::token, $vars->{'message'}, $vars);
$dbh->bz_lock_tables('tokens WRITE');
$dbh->do(q{DELETE FROM tokens WHERE userid = ?
require "globals.pl";
# Use global template variables.
-use vars qw($template $vars $userid);
+use vars qw($userid);
+
+my $template = Bugzilla->template;
+my $vars = {};
###############################################################################
# Each panel has two functions - panel Foo has a DoFoo, to get the data
require "globals.pl";
-# Use global template variables
-use vars qw($template $vars);
-
my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
+my $vars = {};
# If the action is show_bug, you need a bug_id.
# If the action is show_user, you can supply a userid to show the votes for