Skip to content

Commit 9dfc3b8

Browse files
committed
fix(form_language): obey show counter in tab setting
1 parent 5d6f1d3 commit 9dfc3b8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

inc/form_language.class.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ public function defineTabs($options = []) {
6464

6565
public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
6666
if ($item instanceof PluginFormcreatorForm) {
67-
$nb = (new DbUtils())->countElementsInTable(self::getTable(), [
68-
'plugin_formcreator_forms_id' => $item->getID(),
69-
]);
67+
$nb = 0;
68+
if ($_SESSION['glpishow_count_on_tabs']) {
69+
$nb = (new DbUtils())->countElementsInTable(self::getTable(), [
70+
'plugin_formcreator_forms_id' => $item->getID(),
71+
]);
72+
}
7073
return self::createTabEntry(
7174
self::getTypeName(Session::getPluralNumber()),
7275
$nb

0 commit comments

Comments
 (0)