Skip to content

Commit 90a5796

Browse files
committed
feat(form_language): add items count in tab
1 parent 24113a3 commit 90a5796

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

inc/form_language.class.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ public function defineTabs($options = []) {
6464

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

0 commit comments

Comments
 (0)