Skip to content

Commit

Permalink
fix(form_language): obey show counter in tab setting
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jun 5, 2023
1 parent 5d6f1d3 commit 9dfc3b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions inc/form_language.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9dfc3b8

Please sign in to comment.