* Timesheet - Fix bug where editing entries from disabled users changed the user

This commit is contained in:
nathangray 2017-09-05 09:04:31 -06:00
parent 36991cb80b
commit 7c7b1711e5

View File

@ -433,8 +433,9 @@ class timesheet_ui extends timesheet_bo
{ {
$readonlys['ts_owner'] = true; $readonlys['ts_owner'] = true;
} }
// in view mode, we need to add the owner, if it does not exist, otherwise it's displayed empty // in view mode or when editing existing entries, we need to add the owner
if ($view && $content['ts_owner'] && !isset($edit_grants[$content['ts_owner']])) // if it does not exist, otherwise it's displayed empty or missing
if (($view || $content['ts_id']) && $content['ts_owner'] && !isset($edit_grants[$content['ts_owner']]))
{ {
$edit_grants[$content['ts_owner']] = Api\Accounts::username($content['ts_owner']); $edit_grants[$content['ts_owner']] = Api\Accounts::username($content['ts_owner']);
} }