From eb8e00d62f66e35d9c592f1076540c101524ee06 Mon Sep 17 00:00:00 2001 From: Emmanuel Haguet Date: Tue, 23 Feb 2016 17:29:46 +0100 Subject: [PATCH] Minor : In Type, show number of fields in database in Fields tab name --- inc/type.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/inc/type.class.php b/inc/type.class.php index 12709c9e..df36fdbf 100644 --- a/inc/type.class.php +++ b/inc/type.class.php @@ -127,9 +127,16 @@ function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { switch ($item->getType()) { case __CLASS__ : + // Number of fields in database + $itemtype = $item->fields['itemtype']; + $obj = new $itemtype(); + $obj->getEmpty(); + $nb_fields = count($obj->fields); + $tabs = array ( 1 => __("Main"), 3 => _n("Field", "Fields", 2), + 3 => self::createTabEntry(_n("Field", "Fields", Session::getPluralNumber()), $nb_fields), 5 => __("Preview") ); if ($item->canUseDirectConnections()) {