diff options
author | msquare <msquare@notrademark.de> | 2017-12-29 18:57:11 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2017-12-29 18:57:11 +0100 |
commit | ee9fbda098b3c608176ced4425765e3029ca8f93 (patch) | |
tree | 5bfe5bbdb55e644d1f3f321ef44747fa420839d9 /includes/controller | |
parent | d95e48889356eab85aff5ae7121aeb18115aef95 (diff) |
add work date to work log
Diffstat (limited to 'includes/controller')
-rw-r--r-- | includes/controller/user_worklog_controller.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/controller/user_worklog_controller.php b/includes/controller/user_worklog_controller.php index ba91534b..bd62c83c 100644 --- a/includes/controller/user_worklog_controller.php +++ b/includes/controller/user_worklog_controller.php @@ -69,6 +69,12 @@ function user_worklog_from_request($userWorkLog) $valid = true; + $userWorkLog['work_timestamp'] = parse_date('Y-m-d H:i', $request->input('work_timestamp') . ' 00:00'); + if ($userWorkLog['work_timestamp'] == null) { + $valid = false; + error(_('Please enter work date.')); + } + $userWorkLog['work_hours'] = $request->input('work_hours'); if (! preg_match("/[0-9]+(\.[0-9]+)?/", $userWorkLog['work_hours'])) { $valid = false; |