From 9dfc3b8dd409c48d162ef5f6dc7af687afa54e09 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Mon, 5 Jun 2023 09:30:55 +0200 Subject: [PATCH] fix(form_language): obey show counter in tab setting --- inc/form_language.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inc/form_language.class.php b/inc/form_language.class.php index fe4fa5840..29c692f21 100644 --- a/inc/form_language.class.php +++ b/inc/form_language.class.php @@ -64,9 +64,12 @@ public function defineTabs($options = []) { public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { if ($item instanceof PluginFormcreatorForm) { - $nb = (new DbUtils())->countElementsInTable(self::getTable(), [ - 'plugin_formcreator_forms_id' => $item->getID(), - ]); + $nb = 0; + if ($_SESSION['glpishow_count_on_tabs']) { + $nb = (new DbUtils())->countElementsInTable(self::getTable(), [ + 'plugin_formcreator_forms_id' => $item->getID(), + ]); + } return self::createTabEntry( self::getTypeName(Session::getPluralNumber()), $nb