mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 15:33:23 +01:00
Infolog: History tab showed start / due / completed dates in server time, not user time
This commit is contained in:
parent
efd073c4c2
commit
e96031c154
@ -2768,4 +2768,34 @@ class infolog_ui
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Modify history to make timestamps in user time
|
||||
*
|
||||
* @param array $data values for keys "data" (data) and "args":
|
||||
* values for keys "value", "rows" (reference) and "total" (reference)
|
||||
*/
|
||||
public function modify_history(array $data)
|
||||
{
|
||||
$fields = ['Co', 'st', 'Mo', 'En'];
|
||||
foreach($data['rows'] as $index => &$row)
|
||||
{
|
||||
if($row['appname'] !== 'infolog')
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(in_array($row['status'], $fields))
|
||||
{
|
||||
foreach(['old_value', 'new_value'] as $field)
|
||||
{
|
||||
if(!$row[$field])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$row[$field] = Api\DateTime::server2user($row[$field], Api\DateTime::ET2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -58,6 +58,7 @@ $setup_info['infolog']['hooks']['timesheet_set'] = 'infolog.infolog_ui.timesheet
|
||||
$setup_info['infolog']['hooks']['calendar_set'] = 'infolog.infolog_ui.calendar_set';
|
||||
$setup_info['infolog']['hooks']['mail_import'] = 'infolog_hooks::mail_import';
|
||||
$setup_info['infolog']['hooks']['change_account_ids'] = 'infolog_customfields::change_account_ids';
|
||||
$setup_info['infolog']['hooks']['etemplate2_history_get_rows'] = 'infolog.infolog_ui.modify_history';
|
||||
|
||||
// Dependencies for this app to work
|
||||
$setup_info['infolog']['depends'][] = array(
|
||||
|
Loading…
Reference in New Issue
Block a user