Put the status of contact in the list of contact
This commit is contained in:
parent
dc3ccf6373
commit
1295c8d27b
@ -901,9 +901,9 @@ class Contact extends CommonObject
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
function getLibStatutcontact($mode)
|
||||
function getLibStatutcontact()
|
||||
{
|
||||
return $this->LibStatutcontact($this->statut,$mode);
|
||||
return $this->LibStatutcontact($this->statut);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -962,10 +962,11 @@ class Contact extends CommonObject
|
||||
|
||||
}
|
||||
|
||||
function LibStatutcontact($mode)
|
||||
function LibStatutcontact($statut)
|
||||
{
|
||||
if ($statut==1) return img_picto($langs->trans('StatusContactDraft'),'statut0').' '.$langs->trans('Disabled');
|
||||
else return img_picto($langs->trans('StatusContactValidated'),'statut1').' '.$langs->trans('Enabled');
|
||||
global $langs;
|
||||
if ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('StatusContactDraftShort'),'statut0');
|
||||
else return '<span class="hideonsmartphone">'.$langs->trans('Enabled').' </span>'.img_picto($langs->trans('StatusContactValidatedShort'),'statut1');
|
||||
}
|
||||
/**
|
||||
* Return translated label of Public or Private
|
||||
|
||||
@ -951,7 +951,7 @@ class Form
|
||||
$out='';
|
||||
|
||||
// On recherche les societes
|
||||
$sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.poste";
|
||||
$sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste";
|
||||
if ($showsoc > 0) {
|
||||
$sql.= " , s.nom as company";
|
||||
}
|
||||
@ -991,7 +991,7 @@ class Form
|
||||
$contactstatic->id=$obj->rowid;
|
||||
$contactstatic->lastname=$obj->lastname;
|
||||
$contactstatic->firstname=$obj->firstname;
|
||||
|
||||
if ($obj->statut == 0){
|
||||
if ($htmlname != 'none')
|
||||
{
|
||||
$disabled=0;
|
||||
@ -1027,6 +1027,7 @@ class Form
|
||||
if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')';
|
||||
}
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -544,6 +544,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print '<td>'.$langs->trans("PhoneMobile").'</td>';
|
||||
print '<td>'.$langs->trans("Fax").'</td>';
|
||||
print '<td>'.$langs->trans("EMail").'</td>';
|
||||
print '<td>'.$langs->trans("Status").'</td>';
|
||||
print "<td> </td>";
|
||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||
{
|
||||
@ -569,8 +570,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
if($obj->statut == 0)
|
||||
{
|
||||
$var = !$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
@ -599,6 +598,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL');
|
||||
print '</td>';
|
||||
|
||||
if ($obj->statut==1) print '<td>'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('StatusContactDraftShort'),'statut0').'</td>';
|
||||
elseif ($obj->statut==0) print '<td>'.$langs->trans('Enabled').' </span>'.img_picto($langs->trans('StatusContactValidatedShort'),'statut1').'</td>';
|
||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||
{
|
||||
print '<td align="center">';
|
||||
@ -613,6 +614,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print '</a></td>';
|
||||
}
|
||||
|
||||
|
||||
if ($user->rights->societe->contact->creer)
|
||||
{
|
||||
print '<td align="right">';
|
||||
@ -620,8 +622,10 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user