1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dolibarr_ynh.git synced 2024-09-03 18:35:53 +02:00
dolibarr_ynh/sources/dolibarr/htdocs/societe/tpl/linesalesrepresentative.tpl.php
Laurent Peuch e6008fc691 init
2015-09-28 22:09:38 +02:00

38 lines
1.5 KiB
PHP

<?php
// Sale representative
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('SalesRepresentatives');
print '<td><td align="right">';
if ($user->rights->societe->creer && $user->rights->societe->client->voir)
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">'.img_edit().'</a>';
else
print '&nbsp;';
print '</td></tr></table>';
print '</td>';
print '<td colspan="3">';
$listsalesrepresentatives=$object->getSalesRepresentatives($user);
$nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number
{
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$object->id.'">';
print $nbofsalesrepresentative;
print '</a>';
}
else if ($nbofsalesrepresentative > 0)
{
$userstatic=new User($db);
$i=0;
foreach($listsalesrepresentatives as $val)
{
$userstatic->id=$val['id'];
$userstatic->lastname=$val['lastname'];
$userstatic->firstname=$val['firstname'];
print $userstatic->getNomUrl(1);
$i++;
if ($i < $nbofsalesrepresentative) print ', ';
}
}
else print $langs->trans("NoSalesRepresentativeAffected");
print '</td></tr>';