NEW: Show into badge on tab head the number of dedicated contacts for

objects.
This commit is contained in:
Laurent Destailleur 2016-03-10 11:16:12 +01:00
parent ba5b0efb53
commit d0441fa05f
6 changed files with 20 additions and 6 deletions

View File

@ -42,8 +42,10 @@ function contract_prepare_head(Contrat $object)
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id;
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT.'/contrat/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans("ContactsAddresses");
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}

View File

@ -45,8 +45,10 @@ function fichinter_prepare_head($object)
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$object->id;
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT.'/fichinter/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('InterventionContact');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}

View File

@ -45,8 +45,10 @@ function facturefourn_prepare_head($object)
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/contact.php?facid='.$object->id;
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT.'/fourn/facture/contact.php?facid='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}
@ -119,8 +121,10 @@ function ordersupplier_prepare_head($object)
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/contact.php?id='.$object->id;
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}

View File

@ -45,8 +45,10 @@ function facture_prepare_head($object)
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id;
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/contact.php?facid='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}

View File

@ -70,8 +70,10 @@ function commande_prepare_head(Commande $object)
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id;
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT.'/commande/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}

View File

@ -64,8 +64,10 @@ function propal_prepare_head($object)
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}