Skip to content

Commit

Permalink
fix(form,category): obey show count on tabs parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed May 31, 2023
1 parent db9986f commit f4ebf9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inc/category.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function getTypeName($nb = 1) {
public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
$env = new self;
$found_env = $env->find([static::getForeignKeyField() => $item->getID()]);
$nb = count($found_env);
$nb = $_SESSION['glpishow_count_on_tabs'] ? count($found_env) : 0;
return self::createTabEntry(self::getTypeName($nb), $nb);
}

Expand Down
2 changes: 1 addition & 1 deletion inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
return [
1 => self::createTabEntry(
_n('Target', 'Targets', $nb, 'formcreator'),
$item->countTargets()
$nb
),
2 => __('Preview'),
3 => __('Form answer properties', 'formcreator'),
Expand Down

0 comments on commit f4ebf9e

Please sign in to comment.