Delete the contact who are gone,in the email list

This commit is contained in:
lalaina rasamoelina 2013-07-10 14:03:25 +02:00
parent 83d5c1a441
commit 5ed186e178
3 changed files with 16 additions and 10 deletions

View File

@ -340,7 +340,6 @@ if ($result)
{
$obj = $db->fetch_object($result);
if ($obj->statut == 0)
{
@ -402,6 +401,7 @@ if ($result)
print "</tr>\n";
}
$i++;
}

View File

@ -552,7 +552,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
}
print "</tr>";
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays, p.poste, p.phone, p.phone_mobile, p.fax, p.email ";
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.note ";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".$object->id;
$sql .= " ORDER by p.datec";
@ -568,6 +569,8 @@ 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].">";
@ -618,8 +621,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print img_edit();
print '</a></td>';
}
print "</tr>\n";
}
$i++;
}
}

View File

@ -1580,7 +1580,10 @@ class Societe extends CommonObject
{
$contact_property = array();
$sql = "SELECT rowid, email, phone_mobile, lastname, poste, firstname";
$sql = "SELECT rowid, email, statut, phone_mobile, lastname, firstname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople";
$sql.= " WHERE fk_soc = '".$this->id."'";
@ -1596,12 +1599,12 @@ class Societe extends CommonObject
$obj = $this->db->fetch_object($resql);
if ($mode == 'email') $property=$obj->email;
else if ($mode == 'mobile') $property=$obj->phone_mobile;
if(!empty($obj->poste)){
$contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." (".$obj->poste.")"." &lt;".$property."&gt;";
}
else
{
$contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." &lt;".$property."&gt;";
if ($obj->statut == 0)
{
$contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." &lt;".$property."&gt;";
}
$i++;
}