add admin extrafields count
This commit is contained in:
parent
7e97c611f8
commit
3f82f3f7f4
@ -110,9 +110,13 @@ function reception_prepare_head(Reception $object)
|
|||||||
*/
|
*/
|
||||||
function reception_admin_prepare_head()
|
function reception_admin_prepare_head()
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf, $user, $db;
|
||||||
$langs->load("receptions");
|
$langs->load("receptions");
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$extrafields->fetch_name_optionals_label('reception');
|
||||||
|
$extrafields->fetch_name_optionals_label('commande_fournisseur_dispatch');
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
@ -126,6 +130,10 @@ function reception_admin_prepare_head()
|
|||||||
if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION)) {
|
if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION)) {
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/admin/reception_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/admin/reception_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFields");
|
$head[$h][1] = $langs->trans("ExtraFields");
|
||||||
|
$nbExtrafields = $extrafields->attributes['reception']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributes_reception';
|
$head[$h][2] = 'attributes_reception';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
@ -133,6 +141,10 @@ function reception_admin_prepare_head()
|
|||||||
if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION)) {
|
if (!empty($conf->global->MAIN_SUBMODULE_RECEPTION)) {
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/admin/commande_fournisseur_dispatch_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||||
|
$nbExtrafields = $extrafields->attributes['commande_fournisseur_dispatch']['count'];
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributeslines_reception';
|
$head[$h][2] = 'attributeslines_reception';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user