This commit is contained in:
Frédéric France 2022-09-17 21:16:02 +02:00
parent 26720ca116
commit bafadb7991
2 changed files with 31 additions and 7 deletions

View File

@ -17,8 +17,8 @@
*/
/**
* \file htdocs/core/lib/stock.lib.php
* \brief Library file with function for stock module
* \file htdocs/core/lib/stock.lib.php
* \brief Library file with function for stock module
*/
/**
@ -88,7 +88,12 @@ function stock_prepare_head($object)
*/
function stock_admin_prepare_head()
{
global $langs, $conf, $user;
global $langs, $conf, $user, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('entrepot');
$extrafields->fetch_name_optionals_label('stock_mouvement');
$extrafields->fetch_name_optionals_label('inventory');
$h = 0;
$head = array();
@ -106,16 +111,28 @@ function stock_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['entrepot']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_mouvement_extrafields.php';
$head[$h][1] = $langs->trans("StockMouvementExtraFields");
$nbExtrafields = $extrafields->attributes['stock_mouvement']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'stockMouvementAttributes';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/product/admin/inventory_extrafields.php';
$head[$h][1] = $langs->trans("InventoryExtraFields");
$nbExtrafields = $extrafields->attributes['inventory']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'inventoryAttributes';
$h++;

View File

@ -18,9 +18,9 @@
*/
/**
* \file core/lib/ticket.lib.php
* \ingroup ticket
* \brief This file is a library for Ticket module
* \file core/lib/ticket.lib.php
* \ingroup ticket
* \brief This file is a library for Ticket module
*/
/**
@ -30,7 +30,10 @@
*/
function ticketAdminPrepareHead()
{
global $langs, $conf;
global $langs, $conf, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('ticket');
$langs->load("ticket");
@ -44,6 +47,10 @@ function ticketAdminPrepareHead()
$head[$h][0] = DOL_URL_ROOT.'/admin/ticket_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsTicket");
$nbExtrafields = $extrafields->attributes['ticket']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes';
$h++;