From 2bd5449c402f4519c55c0444ff06cbf6630901b5 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 14 Dec 2009 16:25:12 +0000 Subject: [PATCH] fix to control the existence of content start_time/end_time before trying to construct a dateobject --- timesheet/inc/class.timesheet_ui.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index 80b0bbfe54..49aa007009 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -112,7 +112,7 @@ class timesheet_ui extends timesheet_bo $content['start_time']=$content['end_time']='00:00'; } // we only need 2 out of 3 values from start-, end-time or duration (the date in ts_start is always required!) - if ($content['start_time'] != '00:00') // start-time specified + if (isset($content['start_time']) && $content['start_time'] != '00:00') // start-time specified { //$content['ts_start'] += $content['start_time']; $start = new egw_time($content['ts_start']); @@ -120,7 +120,7 @@ class timesheet_ui extends timesheet_bo $start->setTime($start_time[0],$start_time[1]); $content['ts_start'] = $start->format('ts'); } - if ($content['end_time'] != '00:00') // end-time specified + if (isset($content['end_time']) && $content['end_time'] != '00:00') // end-time specified { $end = new egw_time($content['ts_start']); $end_time = explode(':',$content['end_time']); @@ -384,7 +384,7 @@ class timesheet_ui extends timesheet_bo } if (!$this->customfields) $readonlys['tabs']['customfields'] = true; // suppress tab if there are not customfields if (!$this->data['ts_id']) $readonlys['tabs']['history'] = true; //suppress history for the first loading without ID - + return $etpl->exec(TIMESHEET_APP.'.timesheet_ui.edit',$content,$sel_options,$readonlys,$preserv,2); }