From 6687ee2a502d5cf805f299608bfd65e652c9e8d4 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 20 Apr 2009 14:14:31 +0000 Subject: [PATCH] handling unset/uninitalized selectcols --- timesheet/inc/class.timesheet_ui.inc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index a261c4c37c..05a42cb33e 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -613,7 +613,7 @@ class timesheet_ui extends timesheet_bo if (!$have_cats || $query['cat_id']) $rows['no_cat_id'] = true; if ($query['col_filter']['ts_owner']) $rows['ownerClass'] = 'noPrint'; $rows['no_owner_col'] = $query['no_owner_col']; - if (!$rows['no_owner_col'] && !strpos($query['selectcols'],'ts_owner')) $rows['no_owner_col'] = 1; + if (!$rows['no_owner_col'] && $query['selectcols'] && !strpos($query['selectcols'],'ts_owner')) $rows['no_owner_col'] = 1; if ($query['filter']) { $rows += $this->summary; @@ -623,9 +623,9 @@ class timesheet_ui extends timesheet_bo if (!$rows['ts_viewtype']) { #_debug_array($query['selectcols']); #ts_quantity,ts_unitprice,ts_total - if (strpos($query['selectcols'],'ts_quantity')===false) $rows['no_ts_quantity'] = 1; - if (strpos($query['selectcols'],'ts_unitprice')===false) $rows['no_ts_unitprice'] = 1; - if (strpos($query['selectcols'],'ts_total')===false) $rows['no_ts_total'] = 1; + if ($query['selectcols'] && strpos($query['selectcols'],'ts_quantity')===false) $rows['no_ts_quantity'] = 1; + if ($query['selectcols'] && strpos($query['selectcols'],'ts_unitprice')===false) $rows['no_ts_unitprice'] = 1; + if ($query['selectcols'] && strpos($query['selectcols'],'ts_total')===false) $rows['no_ts_total'] = 1; } return $total; } @@ -681,7 +681,7 @@ class timesheet_ui extends timesheet_bo } $read_grants = $this->grant_list(EGW_ACL_READ); $content['nm']['no_owner_col'] = count($read_grants) == 1; - + if ($GLOBALS['egw_info']['user']['preferences']['timesheet']['nextmatch-timesheet.index.rows']) $content['nm']['selectcols'] = $GLOBALS['egw_info']['user']['preferences']['timesheet']['nextmatch-timesheet.index.rows']; $sel_options = array( 'ts_owner' => $read_grants, 'pm_id' => array(lang('No project')),