diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index 1a4ddf4d335..21076122903 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -73,9 +73,11 @@ function expedition_prepare_head(Expedition $object) */ function expedition_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf, $user, $db; $langs->load("sendings"); + $extrafields = new ExtraFields($db); + $h = 0; $head = array(); @@ -87,23 +89,29 @@ function expedition_admin_prepare_head() */ if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { + $extrafields->fetch_name_optionals_label('expedition'); + $extrafields->fetch_name_optionals_label('expeditiondet'); + $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; $head[$h][1] = $langs->trans("Shipment"); $head[$h][2] = 'shipment'; $h++; - } - - if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { $head[$h][0] = DOL_URL_ROOT.'/admin/expedition_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['expedition']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes_shipment'; $h++; - } - if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { $head[$h][0] = DOL_URL_ROOT.'/admin/expeditiondet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['expeditiondet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributeslines_shipment'; $h++; } @@ -114,15 +122,24 @@ function expedition_admin_prepare_head() $h++; if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { + $extrafields->fetch_name_optionals_label('delivery'); + $extrafields->fetch_name_optionals_label('deliverydet'); + $head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); + $nbExtrafields = $extrafields->attributes['delivery']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributes_receivings'; $h++; - } - if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { $head[$h][0] = DOL_URL_ROOT.'/admin/deliverydet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); + $nbExtrafields = $extrafields->attributes['deliverydet']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'attributeslines_receivings'; $h++; } diff --git a/htdocs/recruitment/lib/recruitment.lib.php b/htdocs/recruitment/lib/recruitment.lib.php index acc7160f282..6fa58cc64f5 100644 --- a/htdocs/recruitment/lib/recruitment.lib.php +++ b/htdocs/recruitment/lib/recruitment.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2022 Frédéric France * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +29,11 @@ */ function recruitmentAdminPrepareHead() { - global $langs, $conf; + global $langs, $conf, $db; + + $extrafields = new ExtraFields($db); + $extrafields->fetch_name_optionals_label('recruitment_recruitmentjobposition'); + $extrafields->fetch_name_optionals_label('recruitment_recruitmentcandidature'); $langs->load("recruitment"); @@ -52,11 +57,19 @@ function recruitmentAdminPrepareHead() $head[$h][0] = dol_buildpath("/recruitment/admin/jobposition_extrafields.php", 1); $head[$h][1] = $langs->trans("ExtrafieldsJobPosition"); + $nbExtrafields = $extrafields->attributes['recruitment_recruitmentjobposition']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'jobposition_extrafields'; $h++; $head[$h][0] = dol_buildpath("/recruitment/admin/candidature_extrafields.php", 1); $head[$h][1] = $langs->trans("ExtrafieldsApplication"); + $nbExtrafields = $extrafields->attributes['recruitment_recruitmentcandidature']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } $head[$h][2] = 'candidature_extrafields'; $h++;