[Rt-commit] r5246 - in rt/branches/3.7-EXPERIMENTAL: . html/Search

ruz at bestpractical.com ruz at bestpractical.com
Thu May 18 06:14:18 EDT 2006


Author: ruz
Date: Thu May 18 06:14:17 2006
New Revision: 5246

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Search/Chart
   rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/Chart

Log:
 r2890 at cubic-pc:  cubic | 2006-05-18 14:22:09 +0400
 * 'not set' date is equal to '1970-01-01', in chart we should show 'not set'


Modified: rt/branches/3.7-EXPERIMENTAL/html/Search/Chart
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Search/Chart	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Search/Chart	Thu May 18 06:14:17 2006
@@ -60,6 +60,18 @@
     push @values, $entry->__Value($count_name);
 }
 
+# XXX: Convert 1970-01-01 date to the 'Not Set'
+# this code should be generalized!!!
+if ( $PrimaryGroupBy =~ /(Daily|Monthly|Annually)$/ ) {
+    my $re;
+    $re = qr{1970-01-01} if $PrimaryGroupBy =~ /Daily$/;
+    $re = qr{1970-01} if $PrimaryGroupBy =~ /Monthly$/;
+    $re = qr{1970} if $PrimaryGroupBy =~ /Annually$/;
+    foreach (@keys) {
+        s/^$re/loc('Not Set')/e;
+    }   
+}
+
 unless (@keys && @values) {
     @keys = ('');
     @values = (0);

Modified: rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/Chart
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/Chart	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Search/Elements/Chart	Thu May 18 06:14:17 2006
@@ -32,6 +32,18 @@
     push @values, $entry->__Value( $count_name );
 }
 
+# XXX: Convert 1970-01-01 date to the 'Not Set'
+# this code should be generalized!!!
+if ( $PrimaryGroupBy =~ /(Daily|Monthly|Annually)$/ ) {
+    my $re;
+    $re = qr{1970-01-01} if $PrimaryGroupBy =~ /Daily$/;
+    $re = qr{1970-01} if $PrimaryGroupBy =~ /Monthly$/;
+    $re = qr{1970} if $PrimaryGroupBy =~ /Annually$/;
+    foreach (@keys) {
+        s/^$re/loc('Not Set')/e;
+    }   
+}
+
 
 my $query_string = $m->comp('/Elements/QueryString', %ARGS);
 </%init>


More information about the Rt-commit mailing list