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()
|
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;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
@@ -126,11 +130,19 @@ function contract_admin_prepare_head()
|
|||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFields");
|
$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';
|
$head[$h][2] = 'attributes';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contractdet_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contractdet_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFieldsLines");
|
$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';
|
$head[$h][2] = 'attributeslines';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,10 @@
|
|||||||
*/
|
*/
|
||||||
function donation_admin_prepare_head()
|
function donation_admin_prepare_head()
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf, $db;
|
||||||
|
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$extrafields->fetch_name_optionals_label('donation');
|
||||||
|
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
@@ -46,6 +49,10 @@ function donation_admin_prepare_head()
|
|||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/don/admin/donation_extrafields.php';
|
$head[$h][0] = DOL_URL_ROOT.'/don/admin/donation_extrafields.php';
|
||||||
$head[$h][1] = $langs->trans("ExtraFields");
|
$head[$h][1] = $langs->trans("ExtraFields");
|
||||||
|
$nbExtrafields = is_countable($extrafields->attributes['donation']['label']) ? count($extrafields->attributes['donation']['label']) : 0;
|
||||||
|
if ($nbExtrafields > 0) {
|
||||||
|
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
|
||||||
|
}
|
||||||
$head[$h][2] = 'attributes';
|
$head[$h][2] = 'attributes';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user