use Bugzilla::Error;
use Bugzilla::Util;
+use Bugzilla::Util::DateTime;
use Bugzilla::Series;
use Date::Format;
# 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} = parse_date($self->{$date})
|| ThrowUserError("illegal_date", { date => $self->{$date}});
}
}
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
-package Bugzilla::Extension::BMO::Util;
+package Bugzilla::Util::DateTime;
use 5.10.1;
use strict;
our @EXPORT = qw( string_to_datetime
time_to_datetime
- parse_date
- is_active_status_field );
+ parse_date );
sub string_to_datetime {
my $input = shift;
return str2time($str);
}
-sub is_active_status_field {
- my ($field) = @_;
-
- if ($field->type == FIELD_TYPE_EXTENSION
- && $field->isa('Bugzilla::Extension::TrackingFlags::Flag')
- && $field->flag_type eq 'tracking'
- && $field->name =~ /_status_/
- ) {
- return $field->is_active;
- }
-
- return 0;
-}
-
1;
use Bugzilla::Constants;
use Bugzilla::Error;
-use Bugzilla::Extension::BMO::Util;
use Bugzilla::Field;
use Bugzilla::FlagType;
use Bugzilla::Util qw(trick_taint validate_date);
foreach my $product (@usable_products) {
my @fields =
sort { $a->sortkey <=> $b->sortkey }
- grep { is_active_status_field($_) }
+ grep { _is_active_status_field($_) }
Bugzilla->active_custom_fields({ product => $product });
my @field_ids = map { $_->id } @fields;
if (!scalar @fields) {
return $query;
}
+sub _is_active_status_field {
+ my ($field) = @_;
+
+ if ($field->type == FIELD_TYPE_EXTENSION
+ && $field->isa('Bugzilla::Extension::TrackingFlags::Flag')
+ && $field->flag_type eq 'tracking'
+ && $field->name =~ /_status_/
+ ) {
+ return $field->is_active;
+ }
+
+ return 0;
+}
+
1;
use warnings;
use Bugzilla::Error;
-use Bugzilla::Extension::BMO::Util;
use Bugzilla::User;
use Bugzilla::Util qw(trim);
+use Bugzilla::Util::DateTime;
use DateTime;
sub report {