diff --git a/mozilla/webtools/bugzilla/Bugzilla/Chart.pm b/mozilla/webtools/bugzilla/Bugzilla/Chart.pm index a0853d508bb..c878186bc79 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Chart.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Chart.pm @@ -36,6 +36,7 @@ use Bugzilla::Util; use Bugzilla::Series; use Date::Format; +use Date::Parse; sub new { my $invocant = shift; @@ -99,7 +100,7 @@ sub init { # Make sure the dates are ones we are able to interpret foreach my $date ('datefrom', 'dateto') { if ($self->{$date}) { - $self->{$date} = &::str2time($self->{$date}) + $self->{$date} = str2time($self->{$date}) || &::ThrowUserError("illegal_date", { date => $self->{$date}}); } } @@ -223,7 +224,7 @@ sub readData { my $datefrom = $dbh->selectrow_array("SELECT MIN(series_date) " . "FROM series_data " . "WHERE series_id IN ($series_ids)"); - $datefrom = &::str2time($datefrom); + $datefrom = str2time($datefrom); if ($self->{'datefrom'} && $self->{'datefrom'} > $datefrom) { $datefrom = $self->{'datefrom'}; @@ -232,7 +233,7 @@ sub readData { my $dateto = $dbh->selectrow_array("SELECT MAX(series_date) " . "FROM series_data " . "WHERE series_id IN ($series_ids)"); - $dateto = &::str2time($dateto); + $dateto = str2time($dateto); if ($self->{'dateto'} && $self->{'dateto'} < $dateto) { $dateto = $self->{'dateto'}; @@ -420,7 +421,7 @@ sub generateDateProgression { $dateto += (2 * $oneday) / 3; while ($datefrom < $dateto) { - push (@progression, &::time2str("%Y-%m-%d", $datefrom)); + push (@progression, time2str("%Y-%m-%d", $datefrom)); $datefrom += $oneday; } diff --git a/mozilla/webtools/bugzilla/buglist.cgi b/mozilla/webtools/bugzilla/buglist.cgi index 8465cae32e0..5d56c225570 100755 --- a/mozilla/webtools/bugzilla/buglist.cgi +++ b/mozilla/webtools/bugzilla/buglist.cgi @@ -44,6 +44,8 @@ use Bugzilla::Product; use Bugzilla::Keyword; use Bugzilla::Field; +use Date::Parse; + # Include the Bugzilla CGI and general utility library. require "globals.pl"; diff --git a/mozilla/webtools/bugzilla/customfield.pl b/mozilla/webtools/bugzilla/customfield.pl index 106c60582bd..101bac880a1 100755 --- a/mozilla/webtools/bugzilla/customfield.pl +++ b/mozilla/webtools/bugzilla/customfield.pl @@ -29,6 +29,7 @@ use strict; use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Field; use Getopt::Long; diff --git a/mozilla/webtools/bugzilla/editparams.cgi b/mozilla/webtools/bugzilla/editparams.cgi index 487208b4798..bb8fa591b88 100755 --- a/mozilla/webtools/bugzilla/editparams.cgi +++ b/mozilla/webtools/bugzilla/editparams.cgi @@ -25,6 +25,7 @@ use strict; use lib "."; +use Bugzilla; use Bugzilla::Constants; use Bugzilla::Config qw(:DEFAULT :admin :params $datadir); use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/editversions.cgi b/mozilla/webtools/bugzilla/editversions.cgi index c060657d2aa..dec675b5b40 100755 --- a/mozilla/webtools/bugzilla/editversions.cgi +++ b/mozilla/webtools/bugzilla/editversions.cgi @@ -33,6 +33,7 @@ use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Constants; use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Product; diff --git a/mozilla/webtools/bugzilla/editwhines.cgi b/mozilla/webtools/bugzilla/editwhines.cgi index 8086862d241..0db64355225 100755 --- a/mozilla/webtools/bugzilla/editwhines.cgi +++ b/mozilla/webtools/bugzilla/editwhines.cgi @@ -30,6 +30,7 @@ use strict; use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Constants; use Bugzilla::User; use Bugzilla::Group; diff --git a/mozilla/webtools/bugzilla/globals.pl b/mozilla/webtools/bugzilla/globals.pl index 2654c4a1f44..146b51550f9 100644 --- a/mozilla/webtools/bugzilla/globals.pl +++ b/mozilla/webtools/bugzilla/globals.pl @@ -42,16 +42,4 @@ use Bugzilla::Error; # of globals.pl do $localconfig; -use DBI; - -use Date::Format; # For time2str(). -use Date::Parse; # For str2time(). - -# Use standard Perl libraries for cross-platform file/directory manipulation. -use File::Spec; - -############# Live code below here (that is, not subroutine defs) ############# - -use Bugzilla; - 1; diff --git a/mozilla/webtools/bugzilla/index.cgi b/mozilla/webtools/bugzilla/index.cgi index 27f26083d2e..a409fe95197 100755 --- a/mozilla/webtools/bugzilla/index.cgi +++ b/mozilla/webtools/bugzilla/index.cgi @@ -32,6 +32,7 @@ use strict; use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Constants; use Bugzilla::Update; diff --git a/mozilla/webtools/bugzilla/query.cgi b/mozilla/webtools/bugzilla/query.cgi index 1ab53a9b8ad..67fc9636244 100755 --- a/mozilla/webtools/bugzilla/query.cgi +++ b/mozilla/webtools/bugzilla/query.cgi @@ -30,6 +30,7 @@ use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Bug; use Bugzilla::Constants; use Bugzilla::Search; diff --git a/mozilla/webtools/bugzilla/quips.cgi b/mozilla/webtools/bugzilla/quips.cgi index b2fd482bcc7..fa421c5343a 100755 --- a/mozilla/webtools/bugzilla/quips.cgi +++ b/mozilla/webtools/bugzilla/quips.cgi @@ -29,6 +29,7 @@ use lib qw(.); require "globals.pl"; +use Bugzilla; use Bugzilla::Constants; my $user = Bugzilla->login(LOGIN_REQUIRED); diff --git a/mozilla/webtools/bugzilla/sanitycheck.cgi b/mozilla/webtools/bugzilla/sanitycheck.cgi index b887deeff6d..7a74bfc070e 100755 --- a/mozilla/webtools/bugzilla/sanitycheck.cgi +++ b/mozilla/webtools/bugzilla/sanitycheck.cgi @@ -28,6 +28,8 @@ use strict; use lib qw(.); require "globals.pl"; + +use Bugzilla; use Bugzilla::Constants; use Bugzilla::Util; use Bugzilla::User; diff --git a/mozilla/webtools/bugzilla/sidebar.cgi b/mozilla/webtools/bugzilla/sidebar.cgi index 2f7743ebb59..671e44c7d97 100755 --- a/mozilla/webtools/bugzilla/sidebar.cgi +++ b/mozilla/webtools/bugzilla/sidebar.cgi @@ -20,8 +20,9 @@ use strict; use lib "."; require "globals.pl"; -Bugzilla->login(); +use Bugzilla; +Bugzilla->login(); my $cgi = Bugzilla->cgi; my $template = Bugzilla->template; diff --git a/mozilla/webtools/bugzilla/testserver.pl b/mozilla/webtools/bugzilla/testserver.pl index 0d1d08ba587..2211f8bfecb 100755 --- a/mozilla/webtools/bugzilla/testserver.pl +++ b/mozilla/webtools/bugzilla/testserver.pl @@ -18,17 +18,23 @@ # as its only argument. It attempts to troubleshoot as many installation # issues as possible. +use strict; + +BEGIN { + my $envpath = $ENV{'PATH'}; + require Bugzilla; + $ENV{'PATH'} = $envpath; +} + +use lib "."; + use Socket; use Bugzilla::Config qw($datadir); -my $envpath = $ENV{'PATH'}; -use lib "."; -use strict; + require "globals.pl"; eval "require LWP; require LWP::UserAgent;"; my $lwp = $@ ? 0 : 1; -$ENV{'PATH'}= $envpath; - if ((@ARGV != 1) || ($ARGV[0] !~ /^https?:/)) { print "Usage: $0 \n"; diff --git a/mozilla/webtools/bugzilla/whine.pl b/mozilla/webtools/bugzilla/whine.pl index 9f5a9acfee6..551defe4903 100755 --- a/mozilla/webtools/bugzilla/whine.pl +++ b/mozilla/webtools/bugzilla/whine.pl @@ -29,6 +29,7 @@ use strict; use lib "."; require "globals.pl"; +use Bugzilla; use Bugzilla::Config qw(:DEFAULT $datadir); use Bugzilla::Constants; use Bugzilla::Search;