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);
|
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');
|
global $langs;
|
||||||
else return img_picto($langs->trans('StatusContactValidated'),'statut1').' '.$langs->trans('Enabled');
|
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
|
* Return translated label of Public or Private
|
||||||
|
|||||||
@ -951,7 +951,7 @@ class Form
|
|||||||
$out='';
|
$out='';
|
||||||
|
|
||||||
// On recherche les societes
|
// 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) {
|
if ($showsoc > 0) {
|
||||||
$sql.= " , s.nom as company";
|
$sql.= " , s.nom as company";
|
||||||
}
|
}
|
||||||
@ -991,7 +991,7 @@ class Form
|
|||||||
$contactstatic->id=$obj->rowid;
|
$contactstatic->id=$obj->rowid;
|
||||||
$contactstatic->lastname=$obj->lastname;
|
$contactstatic->lastname=$obj->lastname;
|
||||||
$contactstatic->firstname=$obj->firstname;
|
$contactstatic->firstname=$obj->firstname;
|
||||||
|
if ($obj->statut == 0){
|
||||||
if ($htmlname != 'none')
|
if ($htmlname != 'none')
|
||||||
{
|
{
|
||||||
$disabled=0;
|
$disabled=0;
|
||||||
@ -1027,6 +1027,7 @@ class Form
|
|||||||
if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')';
|
if (($showsoc > 0) && $obj->company) $out.= ' - ('.$obj->company.')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -544,6 +544,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
print '<td>'.$langs->trans("PhoneMobile").'</td>';
|
print '<td>'.$langs->trans("PhoneMobile").'</td>';
|
||||||
print '<td>'.$langs->trans("Fax").'</td>';
|
print '<td>'.$langs->trans("Fax").'</td>';
|
||||||
print '<td>'.$langs->trans("EMail").'</td>';
|
print '<td>'.$langs->trans("EMail").'</td>';
|
||||||
|
print '<td>'.$langs->trans("Status").'</td>';
|
||||||
print "<td> </td>";
|
print "<td> </td>";
|
||||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
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)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
if($obj->statut == 0)
|
|
||||||
{
|
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
print "<tr ".$bc[$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 dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL');
|
||||||
print '</td>';
|
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)
|
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||||
{
|
{
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
@ -613,6 +614,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($user->rights->societe->contact->creer)
|
if ($user->rights->societe->contact->creer)
|
||||||
{
|
{
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
@ -620,8 +622,10 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a></td>';
|
print '</a></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user