diff --git a/time.php b/time.php index 5e0dda153..a76b470d5 100644 --- a/time.php +++ b/time.php @@ -155,19 +155,21 @@ $timeCustomFields = array(); // If we have time custom fields - collect input. -if ($request->isPost()) { +#if ($request->isPost()) { if ($custom_fields && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $control_name = 'time_field_'.$timeField['id']; + $cl_control_name = $request->getParameter($control_name, ($request->isPost() ? null : @$_SESSION[$control_name])); + $_SESSION[$control_name] = $cl_control_name; $timeCustomFields[$timeField['id']] = array('field_id' => $timeField['id'], 'control_name' => $control_name, 'label' => $timeField['label'], 'type' => $timeField['type'], 'required' => $timeField['required'], - 'value' => trim($request->getParameter($control_name))); + 'value' => trim($cl_control_name)); } } -} +#} // Elements of timeRecordForm. $form = new Form('timeRecordForm');