diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php
index 8920808766a..736b200bea3 100644
--- a/htdocs/core/lib/bank.lib.php
+++ b/htdocs/core/lib/bank.lib.php
@@ -131,7 +131,12 @@ function bank_prepare_head(Account $object)
*/
function bank_admin_prepare_head($object)
{
- global $langs, $conf, $user;
+ global $langs, $conf, $user, $db;
+
+ $extrafields = new ExtraFields($db);
+ $extrafields->fetch_name_optionals_label('bank_account');
+ $extrafields->fetch_name_optionals_label('bank');
+
$h = 0;
$head = array();
@@ -154,11 +159,19 @@ function bank_admin_prepare_head($object)
$head[$h][0] = DOL_URL_ROOT.'/admin/bank_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankAccounts").')';
+ $nbExtrafields = $extrafields->attributes['bank_account']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ''.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/bankline_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields").' ('.$langs->trans("BankTransactions").')';
+ $nbExtrafields = $extrafields->attributes['bank']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ''.$nbExtrafields.'';
+ }
$head[$h][2] = 'bankline_extrafields';
$h++;
diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php
index eaa1f85d142..87c9ce4a3fc 100644
--- a/htdocs/core/lib/fichinter.lib.php
+++ b/htdocs/core/lib/fichinter.lib.php
@@ -139,7 +139,11 @@ function fichinter_prepare_head($object)
*/
function fichinter_admin_prepare_head()
{
- global $langs, $conf, $user;
+ global $langs, $conf, $user, $db;
+
+ $extrafields = new ExtraFields($db);
+ $extrafields->fetch_name_optionals_label('fichinter');
+ $extrafields->fetch_name_optionals_label('fichinterdet');
$h = 0;
$head = array();
@@ -159,19 +163,25 @@ function fichinter_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinter_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
+ $nbExtrafields = $extrafields->attributes['fichinter']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ''.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/admin/fichinterdet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");
+ $nbExtrafields = $extrafields->attributes['fichinterdet']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ''.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributesdet';
$h++;
-
-
complete_head_from_modules($conf, $langs, null, $head, $h, 'fichinter_admin', 'remove');
- return $head;
+ return $head;
}
/**
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index b98f17e46ee..bd02d7cca53 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2005-2012 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2013 Florian Henry
- * Copyright (C) 2015 Juanjo Menent
+ * Copyright (C) 2015 Juanjo Menent
* Copyright (C) 2017 Charlie Benke
* Copyright (C) 2017 ATM-CONSULTING
*
@@ -137,7 +137,13 @@ function facture_prepare_head($object)
*/
function invoice_admin_prepare_head()
{
- global $langs, $conf, $user;
+ global $langs, $conf, $user, $db;
+
+ $extrafields = new ExtraFields($db);
+ $extrafields->fetch_name_optionals_label('facture');
+ $extrafields->fetch_name_optionals_label('facturedet');
+ $extrafields->fetch_name_optionals_label('facture_rec');
+ $extrafields->fetch_name_optionals_label('facturedet_rec');
$h = 0;
$head = array();
@@ -160,25 +166,41 @@ function invoice_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices");
+ $nbExtrafields = $extrafields->attributes['facture']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ''.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_cust_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines");
+ $nbExtrafields = $extrafields->attributes['facturedet']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ''.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributeslines';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_rec_cust_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoicesRec");
+ $nbExtrafields = $extrafields->attributes['facture_rec']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ''.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributesrec';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facturedet_rec_cust_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLinesRec");
+ $nbExtrafields = $extrafields->attributes['facturedet_rec']['count'];
+ if ($nbExtrafields > 0) {
+ $head[$h][1] .= ''.$nbExtrafields.'';
+ }
$head[$h][2] = 'attributeslinesrec';
$h++;
- if ($conf->global->INVOICE_USE_SITUATION) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable
+ if (!empty($conf->global->INVOICE_USE_SITUATION)) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable
$head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php';
$head[$h][1] = $langs->trans("InvoiceSituation");
$head[$h][2] = 'situation';