From 3ef7e5ac48efe4cac92700436b4b61d78a6ebd21 Mon Sep 17 00:00:00 2001 From: stonebuzz Date: Thu, 12 Dec 2024 15:43:41 +0100 Subject: [PATCH 1/2] Fix(ContactLog): fix tab content display --- CHANGELOG.md | 1 + inc/contactlog.class.php | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 963594d..f882189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Fixed +- Fix `displayTabContentForItem` for `PluginDatabaseinventoryContactLog` - Fix foreign key constraint in `where` clause. ## [1.0.1] - 2024-12-11 diff --git a/inc/contactlog.class.php b/inc/contactlog.class.php index 476ed9a..4759be3 100644 --- a/inc/contactlog.class.php +++ b/inc/contactlog.class.php @@ -101,15 +101,14 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { - switch ($tabnum) { - case 1: + switch (get_class($item)) { + case (PluginDatabaseinventoryDatabaseParam::class): self::showForDatabaseParams($item); break; - case 2: + case (Agent::class): self::showForAgent($item); break; } - return true; } From 443511f920071044f0b5635c7e5e125325c6bf1f Mon Sep 17 00:00:00 2001 From: stonebuzz Date: Thu, 12 Dec 2024 15:45:15 +0100 Subject: [PATCH 2/2] fix datetime display --- templates/contactlog.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/contactlog.html.twig b/templates/contactlog.html.twig index e3f154e..ac27926 100644 --- a/templates/contactlog.html.twig +++ b/templates/contactlog.html.twig @@ -52,11 +52,11 @@ {% else %} {{ contactlog['agentname'] }} {% endif %} - {{ contactlog['date_creation'] }} + {{ contactlog['date_creation']|formatted_datetime }} {% endfor %} {{ tableheader }} {% endif %} {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %}