Skip to content

Commit

Permalink
Minor : In Type, show number of fields in database in Fields tab name
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Haguet authored and Walid committed Aug 20, 2016
1 parent 55be42d commit eb8e00d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions inc/type.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit eb8e00d

Please sign in to comment.