* Infolog: Responsible user in a different timezone would adjust the due date when saving

After clicking 'Apply' responsible user could be given fully editable dialog in some cases (due to notifications)
This commit is contained in:
nathangray 2020-10-19 10:41:47 -06:00 committed by Ralf Becker
parent dd4e437d5b
commit 67bd66cf95
2 changed files with 14 additions and 2 deletions

View File

@ -807,9 +807,18 @@ class infolog_bo
$set_completed = !$values['info_datecompleted'] && // set date completed of finished job, only if its not already set
in_array($values['info_status'],array('done','billed','cancelled'));
// Old is in server time, so change it to user time or we might move all the dates if tz are different
if($user2server)
{
$this->time2time($old);
}
$values = $old;
// only overwrite explicitly allowed fields
// This one stays in the timezone it's in or we fail the modified check
$values['info_datemodified'] = $values_in['info_datemodified'];
// only overwrite explicitly allowed fields
foreach ($this->responsible_edit as $name)
{
if (isset($values_in[$name])) $values[$name] = $values_in[$name];
@ -1052,6 +1061,9 @@ class infolog_bo
$this->tracking->track($to_write,$old,$this->user,$values['info_status'] == 'deleted' || $old['info_status'] == 'deleted',
null,$skip_notification);
// Clear access cache after notifications, it may get modified as notifications switches user
unset(static::$access_cache[$info_id]);
if ($info_from_set) $values['info_from'] = '';
// Change new values back to user time before sending them back

View File

@ -1805,7 +1805,7 @@ class infolog_ui
$button = 'apply'; // need to store infolog first
}
}
//Validate the enddate must be grather than startdate
//Validate the enddate must be greater than startdate
if (!empty($content['info_enddate']) && !empty($content['info_startdate']))
{
$duration_date = $content['info_enddate']-$content['info_startdate'];