summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Mason.pm1
-rw-r--r--FS/FS/cust_main.pm21
2 files changed, 21 insertions, 1 deletions
diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm
index 4c8c808cd..82e64f245 100644
--- a/FS/FS/Mason.pm
+++ b/FS/FS/Mason.pm
@@ -102,6 +102,7 @@ if ( -e $addl_handler_use_file ) {
use String::Approx qw(amatch);
use Chart::LinesPoints;
use Chart::Mountain;
+ use Chart::Bars;
use Color::Scheme;
use HTML::Widgets::SelectLayers 0.07; #should go away in favor of
#selectlayers.html
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 81b654cd7..24eb73a73 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -8522,6 +8522,15 @@ sub search {
}
##
+ # do the same for user
+ ##
+
+ if ( $params->{'usernum'} =~ /^(\d+)$/ and $1 ) {
+ push @where,
+ "cust_main.usernum = $1";
+ }
+
+ ##
# parse status
##
@@ -8556,13 +8565,23 @@ sub search {
next unless exists($params->{$field});
- my($beginning, $ending) = @{$params->{$field}};
+ my($beginning, $ending, $hour) = @{$params->{$field}};
push @where,
"cust_main.$field IS NOT NULL",
"cust_main.$field >= $beginning",
"cust_main.$field <= $ending";
+ # XXX: do this for mysql and/or pull it out of here
+ if(defined $hour) {
+ if ($dbh->{Driver}->{Name} eq 'Pg') {
+ push @where, "extract(hour from to_timestamp(cust_main.$field)) = $hour";
+ }
+ else {
+ warn "search by time of day not supported on ".$dbh->{Driver}->{Name}." databases";
+ }
+ }
+
$orderby ||= "ORDER BY cust_main.$field";
}