mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +01:00
add badges
This commit is contained in:
@@ -108,7 +108,11 @@ function contract_prepare_head(Contrat $object)
|
||||
*/
|
||||
function contract_admin_prepare_head()
|
||||
{
|
||||
global $langs, $conf;
|
||||
global $langs, $conf, $db;
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extrafields->fetch_name_optionals_label('contract');
|
||||
$extrafields->fetch_name_optionals_label('contractdet');
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
@@ -126,11 +130,19 @@ function contract_admin_prepare_head()
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFields");
|
||||
$nbExtrafields = is_countable($extrafields->attributes['contract']['label']) ? count($extrafields->attributes['contract']['label']) : 0;
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributes';
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contractdet_extrafields.php';
|
||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
||||
$nbExtrafields = is_countable($extrafields->attributes['contractdet']['label']) ? count($extrafields->attributes['contractdet']['label']) : 0;
|
||||
if ($nbExtrafields > 0) {
|
||||
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'attributeslines';
|
||||
$h++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user