From 90a57968097e9478b1edd9692c5909889d31d241 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Tue, 31 Jan 2023 08:16:18 +0100 Subject: [PATCH] feat(form_language): add items count in tab --- inc/form_language.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/form_language.class.php b/inc/form_language.class.php index 2ab688b2d..7da37de84 100644 --- a/inc/form_language.class.php +++ b/inc/form_language.class.php @@ -64,7 +64,13 @@ public function defineTabs($options = []) { public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { if ($item instanceof PluginFormcreatorForm) { - return self::getTypeName(Session::getPluralNumber()); + $nb = (new DbUtils())->countElementsInTable(self::getTable(), [ + 'plugin_formcreator_forms_id' => $item->getID(), + ]); + return self::createTabEntry( + self::getTypeName(Session::getPluralNumber()), + $nb + ); } if ($item->getType() == self::class) { $nb = 0;