* Admin: fix user timezone not taken into account when displaying admin queue

also fixes Api\Storage\Base to also consider type=int&meta=timestamp columns as timestamps
This commit is contained in:
ralf 2024-01-25 20:46:23 +02:00
parent fff431fd4f
commit 579dbc7e1d
2 changed files with 6 additions and 5 deletions

View File

@ -184,7 +184,7 @@ abstract class admin_cmd
*/ */
function __construct(array $data) function __construct(array $data)
{ {
$this->created = time(); $this->created = new Api\DateTime('now');
$this->creator = $GLOBALS['egw_info']['user']['account_id']; $this->creator = $GLOBALS['egw_info']['user']['account_id'];
$this->creator_email = admin_cmd::user_email(); $this->creator_email = admin_cmd::user_email();
@ -363,7 +363,7 @@ abstract class admin_cmd
} }
if (!is_null($this->id)) if (!is_null($this->id))
{ {
$this->modified = time(); $this->modified = new Api\DateTime('now');
$this->modifier = $set_modifier ? $GLOBALS['egw_info']['user']['account_id'] : 0; $this->modifier = $set_modifier ? $GLOBALS['egw_info']['user']['account_id'] : 0;
if ($set_modifier) $this->modifier_email = admin_cmd::user_email(); if ($set_modifier) $this->modifier_email = admin_cmd::user_email();
} }
@ -669,7 +669,8 @@ abstract class admin_cmd
{ {
if (is_null(admin_cmd::$sql)) if (is_null(admin_cmd::$sql))
{ {
admin_cmd::$sql = new Api\Storage\Base('admin','egw_admin_queue',null,'cmd_'); admin_cmd::$sql = new Api\Storage\Base('admin','egw_admin_queue',null,'cmd_', true, 'object');
admin_cmd::$sql->convert_all_timestamps();
} }
} }

View File

@ -304,9 +304,9 @@ class Base
$check_already_included = !empty($this->timestamps); $check_already_included = !empty($this->timestamps);
foreach($this->table_def['fd'] as $name => $data) foreach($this->table_def['fd'] as $name => $data)
{ {
if ($data['type'] == 'timestamp' && (!$check_already_included || !in_array($name,$this->timestamps))) if (($data['type'] === 'timestamp' || $data['meta'] === 'timestamp') && (!$check_already_included || !in_array($name,$this->timestamps)))
{ {
$this->timestamps[] = $name; $this->timestamps[] = $this->db_cols[$name] ?? $name;
} }
} }
} }