From: Ben Klang Date: Mon, 13 Sep 2010 16:53:45 +0000 (-0400) Subject: Avoid warnings when not subtotaling columns X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=5e85df653f78c95b8697adffef1256df488fe8b2;p=horde.git Avoid warnings when not subtotaling columns --- diff --git a/hermes/lib/Api.php b/hermes/lib/Api.php index 86329f760..60a3399fe 100644 --- a/hermes/lib/Api.php +++ b/hermes/lib/Api.php @@ -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;