Skip to content

Commit f4ebf9e

Browse files
committed
fix(form,category): obey show count on tabs parameter
1 parent db9986f commit f4ebf9e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

inc/category.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function getTypeName($nb = 1) {
5353
public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
5454
$env = new self;
5555
$found_env = $env->find([static::getForeignKeyField() => $item->getID()]);
56-
$nb = count($found_env);
56+
$nb = $_SESSION['glpishow_count_on_tabs'] ? count($found_env) : 0;
5757
return self::createTabEntry(self::getTypeName($nb), $nb);
5858
}
5959

inc/form.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
570570
return [
571571
1 => self::createTabEntry(
572572
_n('Target', 'Targets', $nb, 'formcreator'),
573-
$item->countTargets()
573+
$nb
574574
),
575575
2 => __('Preview'),
576576
3 => __('Form answer properties', 'formcreator'),

0 commit comments

Comments
 (0)