[freeside-commits] branch FREESIDE_4_BRANCH updated. 9e0a36966f7cbd8fd1584ce2a88c61448a5cec68

Ivan ivan at 420.am
Sun Dec 13 13:22:21 PST 2015


The branch, FREESIDE_4_BRANCH has been updated
       via  9e0a36966f7cbd8fd1584ce2a88c61448a5cec68 (commit)
      from  c789a4a738d7c4a711898cfc2eadc33362c8383d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9e0a36966f7cbd8fd1584ce2a88c61448a5cec68
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Dec 13 13:22:20 2015 -0800

    fix bandwidth graph date selection for d/m/y, RT#39029

diff --git a/httemplate/view/svc_port.cgi b/httemplate/view/svc_port.cgi
index 24717a7..58702eb 100644
--- a/httemplate/view/svc_port.cgi
+++ b/httemplate/view/svc_port.cgi
@@ -42,9 +42,16 @@ my $html_foot = sub {
     my $url = $nms->port_graphs_link($svc_port->serviceid);
     my $link = $url ? qq(<A HREF="$url">Torrus Graphs</A><BR><BR>) : '';
 
-    if($start && $end) {
-	$graph = "<BR><BR><IMG SRC=${p}/view/port_graph.html?svcnum=$svcnum;".
-		"start=".str2time("$start 00:00:00").";end=".str2time("$end 23:59:59").">";
+    if ( $start && $end ) {
+        my($s, $e) = ($start, $end);
+        if ( $date_format eq '%d/%m/%Y' ) {
+          $start =~ /^\s*(\d+)\D+(\d+)\D+(\d+)\s*$/ and $s = "$2/$1/$3";
+          $end   =~ /^\s*(\d+)\D+(\d+)\D+(\d+)\s*$/ and $e = "$2/$1/$3";
+        }
+        $graph = "<BR><BR><IMG SRC=${p}/view/port_graph.html?svcnum=$svcnum".
+                                  ";start=".str2time("$s 00:00:00").
+                                  ";end=".  str2time("$e 23:59:59").
+                         ">";
     }
 
     return '

-----------------------------------------------------------------------

Summary of changes:
 httemplate/view/svc_port.cgi |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list