Skip to content

Commit

Permalink
feat(form_language): add items count in tab
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jan 31, 2023
1 parent 24113a3 commit 90a5796
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion inc/form_language.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 90a5796

Please sign in to comment.