Skip to content
Snippets Groups Projects
Commit 168413d0 authored by Robert Lange's avatar Robert Lange
Browse files

Merge branch 'instance/fid' into instance/fid_adlr

parents b59465ed 0c16de51
Branches
Tags
No related merge requests found
......@@ -241,6 +241,19 @@ class User
* })
*/
protected $data = [];
/**
* Creation time
*
* @var \DateTime
* @Groups({
* "user:details:response",
* "user:list:response",
* "user:creation:response",
* "user:update:response"
* })
*/
protected $createdAt;
/**
* Magic function as shortcut for all getters
......@@ -463,6 +476,29 @@ class User
*
* @return string|null
*/
/**
* Get creation date
*
* @return \DateTime
*/
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
/**
* Set creation date
*
* @param \DateTime $createdAt created at
*
* @return void
*/
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
public function getJobTitle(): ?string
{
return $this->jobTitle;
......@@ -777,4 +813,5 @@ class User
}
return rtrim($output, $delimiter);
}
}
......@@ -5,7 +5,7 @@ foreach ($config['Admin']['permission_options'] ?? [] as $perm) {
$state = $user->getPermissions()[$perm];
/* #16383: set requested as bold text - GG */
$state = $state === 'requested' ? '<strong>' . $this->escapeHtml($state) . '</strong>' : $state;
$permissions[$perm] = $this->escapeHtml($perm) . " ($state)";
$permissions[$perm] = $this->transEsc("fid::$perm") . " ($state)";
}
foreach ($this->fields as $field):
......@@ -14,6 +14,13 @@ foreach ($this->fields as $field):
<td><?=implode(', ', $permissions)?></td>
<?php elseif ($field === 'Deleted'): ?>
<td><?= $user->isDeleted() ? $this->translate("fid::label_deleted") : '' ?></td>
<?php elseif ($field === 'CreatedAt'): ?>
<td>
<?php // time accessibility via <time>: https://www.w3schools.com/tags/tag_time.asp ?>
<time datetime="<?=$user->getCreatedAt()->format(DateTime::ATOM)?>">
<?=$user->getCreatedAt()->format("d.m.Y")?>
</time>
</td>
<?php else: ?>
<td><?=$this->escapeHtml($user->$field)?></td>
<?php endif; ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment