From 44de29d04d1ca7e3b047b2a847508dc949c29038 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 25 Oct 2005 06:11:55 +0000 Subject: Bug 312157: Remove $::template and $::vars from globals.pl - Patch by Olav Vitters r=LpSolit a=justdave --- Bugzilla/Flag.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Bugzilla/Flag.pm') diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 54a8bea80..6f0cb94cc 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -74,10 +74,6 @@ use Bugzilla::BugMail; 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 ###################################################################### @@ -947,6 +943,9 @@ Sends an email notification about a flag being created or fulfilled. sub notify { my ($flag, $template_file) = @_; + my $template = Bugzilla->template; + my $vars = {}; + my $attachment_is_private = $flag->{'target'}->{'attachment'} ? $flag->{'target'}->{'attachment'}->{'isprivate'} : undef; @@ -971,14 +970,14 @@ sub notify { $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); -- cgit v1.2.3-24-g4f1b