T975-develop Add an element (statut) in the table llx_socpeople

It's used to mark if the contact is gone or no(we can activate or desactivate the contact with this)
And if the contact is gone,we don't print her mail in the mail list,where we can send a mail
This commit is contained in:
lalaina rasamoelina 2013-08-22 10:06:57 +02:00
parent 1295c8d27b
commit 8a4041e534
8 changed files with 15 additions and 12 deletions

View File

@ -965,7 +965,7 @@ class Contact extends CommonObject
function LibStatutcontact($statut)
{
global $langs;
if ($statut==1) return '<span class="hideonsmartphone">'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('StatusContactDraftShort'),'statut0');
if ($statut==0) 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');
}
/**
@ -1066,7 +1066,7 @@ class Contact extends CommonObject
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('USER_ENABLEDISABLE',$this,$user,$langs,$conf);
$result=$interface->run_triggers('CONTACT_ENABLEDISABLE',$this,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
}

View File

@ -138,7 +138,7 @@ if (empty($reshook))
if ($action == 'disable')
{
$object->fetch($id);
$object->setstatus(1);
$object->setstatus(0);
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
exit;
}
@ -149,7 +149,7 @@ if (empty($reshook))
if ($action == 'enable')
{
$object->fetch($id);
$object->setstatus(0);
$object->setstatus(1);
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id);
exit;
@ -1025,12 +1025,12 @@ else
print '<a class="butActionDelete" href="fiche.php?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
}
// Activer
if ($object->statut == 1 && $user->rights->societe->contact->creer)
if ($object->statut == 0 && $user->rights->societe->contact->creer)
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=enable">'.$langs->trans("Reactivate").'</a>';
}
// Desactiver
if ($object->statut == 0 && $user->rights->societe->contact->creer)
if ($object->statut == 1 && $user->rights->societe->contact->creer)
{
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&amp;id='.$object->id.'">'.$langs->trans("DisableUser").'</a>';
}

View File

@ -340,7 +340,7 @@ if ($result)
{
$obj = $db->fetch_object($result);
if ($obj->statut == 0)
if ($obj->statut == 1)
{
$var=!$var;
print "<tr ".$bc[$var].">";

View File

@ -991,7 +991,7 @@ class Form
$contactstatic->id=$obj->rowid;
$contactstatic->lastname=$obj->lastname;
$contactstatic->firstname=$obj->firstname;
if ($obj->statut == 0){
if ($obj->statut == 1){
if ($htmlname != 'none')
{
$disabled=0;

View File

@ -598,8 +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 ($obj->statut==0) print '<td>'.$langs->trans('Disabled').' </span>'.img_picto($langs->trans('StatusContactDraftShort'),'statut0').'</td>';
elseif ($obj->statut==1) 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">';

View File

@ -22,6 +22,8 @@ DELETE FROM llx_menu where module='holiday';
ALTER TABLE llx_projet_task ADD COLUMN planned_workload real DEFAULT 0 NOT NULL AFTER duration_effective;
ALTER TABLE llx_socpeople ADD COLUMN statut tinyint(4) DEFAULT 1 NOT NULL after import_key;
create table llx_fichinter_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,

View File

@ -50,5 +50,6 @@ create table llx_socpeople
note_public text,
default_lang varchar(6),
canvas varchar(32), -- type of canvas if used (null by default)
import_key varchar(14)
import_key varchar(14),
statut tinyint(4)
)ENGINE=innodb;

View File

@ -1600,7 +1600,7 @@ class Societe extends CommonObject
else if ($mode == 'mobile') $property=$obj->phone_mobile;
if ($obj->statut == 0)
if ($obj->statut == 1)
{
$contact_property[$obj->rowid] = trim(dolGetFirstLastname($obj->firstname,$obj->lastname))." &lt;".$property."&gt;";