Avoid warnings when not subtotaling columns
authorBen Klang <ben@alkaloid.net>
Mon, 13 Sep 2010 16:53:45 +0000 (12:53 -0400)
committerBen Klang <ben@alkaloid.net>
Mon, 13 Sep 2010 16:53:45 +0000 (12:53 -0400)
hermes/lib/Api.php

index 86329f7..60a3399 100644 (file)
@@ -145,9 +145,13 @@ class Hermes_Api extends Horde_Registry_Api
                     } else {
                         $time_data[$key]['_client_name'] = $row['client'];
                     }
-                    $column[$key] = $time_data[$key][$subtotal_column];
+                    if (!is_null($subtotal_column)) {
+                      $column[$key] = $time_data[$key][$subtotal_column];
+                    }
+                }
+                if (!is_null($subtotal_column)) {
+                    array_multisort($column, SORT_ASC, $time_data);
                 }
-                array_multisort($column, SORT_ASC, $time_data);
             }
 
             $total_hours = 0.0;