Skip to content

Commit 535d16d

Browse files
authored
Fix(ContactLog): fix tab content display (#39)
1 parent 53e0562 commit 535d16d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
## Fixed
1111

12+
- Fix `displayTabContentForItem` for `PluginDatabaseinventoryContactLog`
1213
- Fix foreign key constraint in `where` clause.
1314

1415
## [1.0.1] - 2024-12-11

inc/contactlog.class.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,14 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
101101

102102
public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
103103
{
104-
switch ($tabnum) {
105-
case 1:
104+
switch (get_class($item)) {
105+
case (PluginDatabaseinventoryDatabaseParam::class):
106106
self::showForDatabaseParams($item);
107107
break;
108-
case 2:
108+
case (Agent::class):
109109
self::showForAgent($item);
110110
break;
111111
}
112-
113112
return true;
114113
}
115114

templates/contactlog.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
{% else %}
5353
<td><a href = {{contactlog['linkagent']}}> {{ contactlog['agentname'] }}</a></td>
5454
{% endif %}
55-
<td>{{ contactlog['date_creation'] }}</td>
55+
<td>{{ contactlog['date_creation']|formatted_datetime }}</td>
5656
</tr>
5757
{% endfor %}
5858
{{ tableheader }}
5959
</table>
6060
{% endif %}
6161
{% endif %}
62-
{% endblock %}
62+
{% endblock %}

0 commit comments

Comments
 (0)