[Rt-commit] r13546 - in rt/3.8/trunk: sbin

sartak at bestpractical.com sartak at bestpractical.com
Mon Jun 23 17:31:01 EDT 2008


Author: sartak
Date: Mon Jun 23 17:31:01 2008
New Revision: 13546

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/sbin/rt-email-dashboards.in

Log:
 r63078 at onn:  sartak | 2008-06-23 17:30:36 -0400
 Need to handle multi-valued keys in rt-email-dashboards to handle multiple "ShowLink"s for graphs. This tactic is becoming increasingly fussy.


Modified: rt/3.8/trunk/sbin/rt-email-dashboards.in
==============================================================================
--- rt/3.8/trunk/sbin/rt-email-dashboards.in	(original)
+++ rt/3.8/trunk/sbin/rt-email-dashboards.in	Mon Jun 23 17:31:01 2008
@@ -395,7 +395,19 @@
                 or die "Unable to parse query parameter '$_'";
 
             for ($k, $v) { s/%(..)/chr hex $1/ge }
-            $args{$k} = $v;
+
+            # no value yet, simple key=value
+            if (!exists $args{$k}) {
+                $args{$k} = $v;
+            }
+            # already have key=value, need to upgrade it to key=[value1, value2]
+            elsif (!ref($args{$k})) {
+                $args{$k} = [$args{$k}, $v];
+            }
+            # already key=[value1, value2], just add the new value
+            else {
+                push @{ $args{$k} }, $v;
+            }
         }
     }
 


More information about the Rt-commit mailing list