From df261614f53d42a5288a472d65d33a671df1d654 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 14 Sep 2006 18:31:46 +0000 Subject: [PATCH] fixed bug reported by Udgin (error when you have no project-label so far, eg. empty install) --- timesheet/inc/class.uitimesheet.inc.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/timesheet/inc/class.uitimesheet.inc.php b/timesheet/inc/class.uitimesheet.inc.php index 9b961d92ea..d85b7905f9 100644 --- a/timesheet/inc/class.uitimesheet.inc.php +++ b/timesheet/inc/class.uitimesheet.inc.php @@ -574,12 +574,18 @@ class uitimesheet extends botimesheet } $read_grants = $this->grant_list(EGW_ACL_READ); $content['nm']['no_owner_col'] = count($read_grants) == 1; - - return $etpl->exec(TIMESHEET_APP.'.uitimesheet.index',$content,array( - 'ts_project' => $this->query_list('ts_project')+array(lang('No project')), + + $sel_options = array( 'ts_owner' => $read_grants, 'pm_id' => array(lang('No project')), 'cat_id' => array(lang('None')), - ),$readonlys,$preserv); + ); + if ($this->pm_integration != 'full') + { + $projects =& $this->query_list('ts_project'); + if (!is_array($projects)) $projects = array(); + $sel_options['ts_project'] = $projects + array(lang('No project')); + } + return $etpl->exec(TIMESHEET_APP.'.uitimesheet.index',$content,$sel_options,$readonlys,$preserv); } }