From 7ba0af7f28035bc325682012267f70e052352405 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 6 May 2009 08:12:51 +0000 Subject: [PATCH] "only add total automatically, if $only_keys === false or show_sums" --- timesheet/inc/class.timesheet_bo.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/timesheet/inc/class.timesheet_bo.inc.php b/timesheet/inc/class.timesheet_bo.inc.php index 7441403bd6..dbe11d6d55 100644 --- a/timesheet/inc/class.timesheet_bo.inc.php +++ b/timesheet/inc/class.timesheet_bo.inc.php @@ -150,7 +150,7 @@ class timesheet_bo extends so_sql_cf { if ($grant & $required) { - $result[$uid] = $GLOBALS['egw']->common->grab_owner_name($uid); + $result[$uid] = common::grab_owner_name($uid); } } natcasesort($result); @@ -294,8 +294,10 @@ class timesheet_bo extends so_sql_cf { $extra_cols = $extra_cols ? explode(',',$extra_cols) : array(); } - $extra_cols[] = $total_sql.' AS ts_total'; - + if ($only_keys === false || $this->show_sums && strpos($order_by,'ts_start') !== false) + { + $extra_cols[] = $total_sql.' AS ts_total'; + } if (!isset($filter['ts_owner']) || !count($filter['ts_owner'])) { $filter['ts_owner'] = array_keys($this->grants);