diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index b488949538d..0a25bbf8028 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -965,7 +965,7 @@ class Contact extends CommonObject
function LibStatutcontact($statut)
{
global $langs;
- if ($statut==1) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('StatusContactDraftShort'),'statut0');
+ if ($statut==0) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('StatusContactDraftShort'),'statut0');
else return ''.$langs->trans('Enabled').' '.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
}
diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php
index 3443405ca82..7f587500cbe 100644
--- a/htdocs/contact/fiche.php
+++ b/htdocs/contact/fiche.php
@@ -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 ''.$langs->trans('Delete').'';
}
// Activer
- if ($object->statut == 1 && $user->rights->societe->contact->creer)
+ if ($object->statut == 0 && $user->rights->societe->contact->creer)
{
print ''.$langs->trans("Reactivate").'';
}
// Desactiver
- if ($object->statut == 0 && $user->rights->societe->contact->creer)
+ if ($object->statut == 1 && $user->rights->societe->contact->creer)
{
print ''.$langs->trans("DisableUser").'';
}
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index a3382975929..19b389cc192 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -340,7 +340,7 @@ if ($result)
{
$obj = $db->fetch_object($result);
- if ($obj->statut == 0)
+ if ($obj->statut == 1)
{
$var=!$var;
print "
";
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 5267ad3520b..331ab1c3b98 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -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;
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 2d100529a69..2bd863b263f 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -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 '';
- if ($obj->statut==1) print '| '.$langs->trans('Disabled').' '.img_picto($langs->trans('StatusContactDraftShort'),'statut0').' | ';
- elseif ($obj->statut==0) print ''.$langs->trans('Enabled').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut1').' | ';
+ if ($obj->statut==0) print ''.$langs->trans('Disabled').' '.img_picto($langs->trans('StatusContactDraftShort'),'statut0').' | ';
+ elseif ($obj->statut==1) print ''.$langs->trans('Enabled').' '.img_picto($langs->trans('StatusContactValidatedShort'),'statut1').' | ';
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{
print '';
diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql
index a87a80d7d52..9afc2da09b0 100755
--- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql
+++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql
@@ -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,
diff --git a/htdocs/install/mysql/tables/llx_socpeople.sql b/htdocs/install/mysql/tables/llx_socpeople.sql
index d06e91e5395..04be54ba06c 100644
--- a/htdocs/install/mysql/tables/llx_socpeople.sql
+++ b/htdocs/install/mysql/tables/llx_socpeople.sql
@@ -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;
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 918ff20dd5f..9127adc3a8f 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -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))." <".$property.">";
|