mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
Calendar: History tab showed start / end times in server time, not user time
This commit is contained in:
parent
2d7e267c4b
commit
efd073c4c2
@ -3108,6 +3108,37 @@ class calendar_uiforms extends calendar_ui
|
||||
// custom fields are now "understood" directly by historylog widget
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
$history = [];
|
||||
$sel_options = [];
|
||||
$this->setup_history($history, $sel_options);
|
||||
foreach($data['rows'] as $index => &$row)
|
||||
{
|
||||
if($row['appname'] !== 'calendar')
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(str_contains($history['history']['status-widgets'][$row['status']], 'date'))
|
||||
{
|
||||
foreach(['old_value', 'new_value'] as $field)
|
||||
{
|
||||
if(!$row[$field])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$row[$field] = Api\DateTime::server2user($row[$field], Api\DateTime::ET2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* moves an event to another date/time
|
||||
*
|
||||
|
@ -47,6 +47,7 @@ $setup_info['calendar']['hooks']['categories'] = 'calendar_hooks::categories';
|
||||
$setup_info['calendar']['hooks']['mail_import'] = 'calendar_hooks::mail_import';
|
||||
$setup_info['calendar']['hooks']['notifications_actions'] = 'calendar_hooks::notifications_actions';
|
||||
$setup_info['calendar']['hooks']['etemplate2_register_widgets'] = 'calendar_hooks::widgets';
|
||||
$setup_info['calendar']['hooks']['etemplate2_history_get_rows'] = 'calendar.calendar_uiforms.modify_history';
|
||||
|
||||
/* Dependencies for this app to work */
|
||||
$setup_info['calendar']['depends'][] = array(
|
||||
|
Loading…
Reference in New Issue
Block a user