1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{% set logentries = admin.getLogEntries(object) %}
<td>
{% block field %}
{% if logentries|length > 0 %}
<table class="table table-bordered table-striped">
<thead>
<tr>
{# <th>Id objet</th> #}
{# <th>Sujet</th> #}
<th>Date</th>
<th>Utilisateur</th>
<th>Champ(s) modifié(s)</th>
</tr>
</thead>
<tbody>
{% for log in logentries %}
{% set user = getLogUser(log.username) %}
<tr>
{# <td>{{ log.objectId }}</td> #}
{# <td>{{ admin.getLogEntryMappingClassName(log.objectClass) }}</td> #}
<td>{{ log.loggedAt|date('d/m/Y H:i') }}</td>
<td>
{% if user is not null %}
{# <a href="{{ path('admin_sonata_user_user_edit', {'id': user.id}) }}">{{ user.fullname }}</a> #}
{{ user.fullname }}
{% else %}
{{ log.username }}
{% endif %}
</td>
<td {% if log.action == 'create'%}class='bg-green'{% endif %}>
{% if log.action == 'create'%}
CREATION
{% else %}
<table class="table">
{% for field, value in log.data %}
<tr>
<th>{{ field }}</th>
<td>
{% if is_object(value) %}
{% if 'DateTime' == get_class(value) %}
{{ value|date(options.format|default(null), options.timezone|default(null)) }}
{% else %}
{{ value|serialize }}
{% endif %}
{% elseif value is iterable%}
{% for key, v in value %}
<p>{{ key }} => {{ v|raw }}</p>
{% endfor %}
{% else %}
{{ value }}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p><em>Aucun historique pour le moment !</em></p>
{% endif %}
{% endblock %}
</td>