Mise en facteur de nombreux code et uniformisation codage sur le LDAP
This commit is contained in:
parent
e69b80ac52
commit
7338936d4d
@ -28,15 +28,6 @@
|
|||||||
\ingroup ldap
|
\ingroup ldap
|
||||||
\brief Page d'administration/configuration du module Ldap
|
\brief Page d'administration/configuration du module Ldap
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
\remarks Exemple configuration :
|
|
||||||
LDAP_SERVER_HOST Serveur LDAP 192.168.1.50
|
|
||||||
LDAP_SERVER_PORT Port LDAP 389
|
|
||||||
LDAP_ADMIN_DN Administrateur LDAP cn=adminldap,dc=societe,dc=com
|
|
||||||
LDAP_ADMIN_PASS Mot de passe xxxxxxxx
|
|
||||||
LDAP_USER_DN DN des utilisateurs ou=users,dc=societe,dc=com
|
|
||||||
LDAP_GROUP_DN DN des groupes ou=groups,dc=societe,dc=com
|
|
||||||
LDAP_CONTACT_DN DN des contacts ou=contacts,dc=societe,dc=com
|
|
||||||
LDAP_SERVER_TYPE Type Openldap
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
@ -251,8 +242,8 @@ print '</td><td>'.$langs->trans("LDAPServerUseTLSExample").'</td></tr>';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
print '<tr '.$bc[$var].'><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -28,19 +28,11 @@
|
|||||||
\ingroup ldap
|
\ingroup ldap
|
||||||
\brief Page d'administration/configuration du module Ldap
|
\brief Page d'administration/configuration du module Ldap
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
\remarks Exemple configuration :
|
|
||||||
LDAP_SERVER_HOST Serveur LDAP 192.168.1.50
|
|
||||||
LDAP_SERVER_PORT Port LDAP 389
|
|
||||||
LDAP_ADMIN_DN Administrateur LDAP cn=adminldap,dc=societe,dc=com
|
|
||||||
LDAP_ADMIN_PASS Mot de passe xxxxxxxx
|
|
||||||
LDAP_USER_DN DN des utilisateurs ou=users,dc=societe,dc=com
|
|
||||||
LDAP_GROUP_DN DN des groupes ou=groups,dc=societe,dc=com
|
|
||||||
LDAP_CONTACT_DN DN des contacts ou=contacts,dc=societe,dc=com
|
|
||||||
LDAP_SERVER_TYPE Type Openldap
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/authldap.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/authldap.lib.php");
|
||||||
|
require_once (DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
@ -137,13 +129,13 @@ $html=new Form($db);
|
|||||||
|
|
||||||
// DN Pour les contacts
|
// DN Pour les contacts
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPContactDn").'</td><td>';
|
print '<tr '.$bc[$var].'><td><b>'.$langs->trans("LDAPContactDn").picto_required().'</b></td><td>';
|
||||||
print '<input size="38" type="text" name="contactdn" value="'.$conf->global->LDAP_CONTACT_DN.'">';
|
print '<input size="38" type="text" name="contactdn" value="'.$conf->global->LDAP_CONTACT_DN.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPContactDnExample").'</td></tr>';
|
print '</td><td>'.$langs->trans("LDAPContactDnExample").'</td></tr>';
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldName").'</td><td>';
|
print '<tr '.$bc[$var].'><td><b>'.$langs->trans("LDAPFieldName").picto_required().'</b></td><td>';
|
||||||
print '<input size="25" type="text" name="fieldname" value="'.$conf->global->LDAP_FIELD_NAME.'">';
|
print '<input size="25" type="text" name="fieldname" value="'.$conf->global->LDAP_FIELD_NAME.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldNameExample").'</td></tr>';
|
print '</td><td>'.$langs->trans("LDAPFieldNameExample").'</td></tr>';
|
||||||
|
|
||||||
@ -179,7 +171,8 @@ print '<input size="25" type="text" name="fieldmobile" value="'.$conf->global->L
|
|||||||
print '</td><td>'.$langs->trans("LDAPFieldMobileExample").'</td></tr>';
|
print '</td><td>'.$langs->trans("LDAPFieldMobileExample").'</td></tr>';
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
$var=!$var;
|
||||||
|
print '<tr '.$bc[$var].'><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -188,6 +181,44 @@ print '</div>';
|
|||||||
|
|
||||||
print info_admin($langs->trans("LDAPDescValues"));
|
print info_admin($langs->trans("LDAPDescValues"));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Test de la connexion
|
||||||
|
*/
|
||||||
|
if (function_exists("ldap_connect"))
|
||||||
|
{
|
||||||
|
if ($conf->global->LDAP_SERVER_HOST)
|
||||||
|
{
|
||||||
|
print '<br>';
|
||||||
|
print '<a class="tabAction" href="'.$_SERVER["PHP_SELF"].'?action=test">'.$langs->trans("LDAPTestSynchroContact").'</a><br><br>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($_GET["action"] == 'test')
|
||||||
|
{
|
||||||
|
// Creation contact
|
||||||
|
$contact=new Contact($db);
|
||||||
|
$contact->initAsSpecimen();
|
||||||
|
|
||||||
|
// Test synchro
|
||||||
|
$result1=$contact->delete_ldap($user);
|
||||||
|
$result2=$contact->update_ldap($user);
|
||||||
|
$result3=$contact->delete_ldap($user);
|
||||||
|
|
||||||
|
if ($result2 > 0)
|
||||||
|
{
|
||||||
|
print img_picto('','info').' ';
|
||||||
|
print '<font class="ok">'.$langs->trans("LDAPSynchroOK").'</font><br>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_picto('','error').' ';
|
||||||
|
print '<font class="warning">'.$langs->trans("LDAPSynchroKO");
|
||||||
|
print ': '.$contact->error;
|
||||||
|
print '</font><br>';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|||||||
@ -28,15 +28,6 @@
|
|||||||
\ingroup ldap
|
\ingroup ldap
|
||||||
\brief Page d'administration/configuration du module Ldap
|
\brief Page d'administration/configuration du module Ldap
|
||||||
\version $Revision$
|
\version $Revision$
|
||||||
\remarks Exemple configuration :
|
|
||||||
LDAP_SERVER_HOST Serveur LDAP 192.168.1.50
|
|
||||||
LDAP_SERVER_PORT Port LDAP 389
|
|
||||||
LDAP_ADMIN_DN Administrateur LDAP cn=adminldap,dc=societe,dc=com
|
|
||||||
LDAP_ADMIN_PASS Mot de passe xxxxxxxx
|
|
||||||
LDAP_USER_DN DN des utilisateurs ou=users,dc=societe,dc=com
|
|
||||||
LDAP_GROUP_DN DN des groupes ou=groups,dc=societe,dc=com
|
|
||||||
LDAP_CONTACT_DN DN des contacts ou=contacts,dc=societe,dc=com
|
|
||||||
LDAP_SERVER_TYPE Type Openldap
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
@ -141,19 +132,19 @@ print "</tr>\n";
|
|||||||
|
|
||||||
// DN Pour les utilisateurs
|
// DN Pour les utilisateurs
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPUserDn").'</td><td>';
|
print '<tr '.$bc[$var].'><td><b>'.$langs->trans("LDAPUserDn").picto_required().'</b></td><td>';
|
||||||
print '<input size="38" type="text" name="user" value="'.$conf->global->LDAP_USER_DN.'">';
|
print '<input size="38" type="text" name="user" value="'.$conf->global->LDAP_USER_DN.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPUserDnExample").'</td></tr>';
|
print '</td><td>'.$langs->trans("LDAPUserDnExample").'</td></tr>';
|
||||||
|
|
||||||
// DN pour les groupes
|
// DN pour les groupes
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPGroupDn").'</td><td>';
|
print '<tr '.$bc[$var].'><td><b>'.$langs->trans("LDAPGroupDn").picto_required().'</b></td><td>';
|
||||||
print '<input size="38" type="text" name="group" value="'.$conf->global->LDAP_GROUP_DN.'">';
|
print '<input size="38" type="text" name="group" value="'.$conf->global->LDAP_GROUP_DN.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPGroupDnExample").'</td></tr>';
|
print '</td><td>'.$langs->trans("LDAPGroupDnExample").'</td></tr>';
|
||||||
|
|
||||||
// Filtre de connexion
|
// Filtre de connexion
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
|
print '<tr '.$bc[$var].'><td><b>'.$langs->trans("LDAPFilterConnection").picto_required().'</b></td><td>';
|
||||||
print '<input size="38" type="text" name="filterconnection" value="'.$conf->global->LDAP_FILTER_CONNECTION.'">';
|
print '<input size="38" type="text" name="filterconnection" value="'.$conf->global->LDAP_FILTER_CONNECTION.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFilterConnectionExample").'</td></tr>';
|
print '</td><td>'.$langs->trans("LDAPFilterConnectionExample").'</td></tr>';
|
||||||
|
|
||||||
@ -171,7 +162,7 @@ print '</td><td>'.$langs->trans("LDAPFieldLoginSambaExample").'</td></tr>';
|
|||||||
|
|
||||||
// Name
|
// Name
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldName").'</td><td>';
|
print '<tr '.$bc[$var].'><td><b>'.$langs->trans("LDAPFieldName").picto_required().'</b></td><td>';
|
||||||
print '<input size="25" type="text" name="fieldname" value="'.$conf->global->LDAP_FIELD_NAME.'">';
|
print '<input size="25" type="text" name="fieldname" value="'.$conf->global->LDAP_FIELD_NAME.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldNameExample").'</td></tr>';
|
print '</td><td>'.$langs->trans("LDAPFieldNameExample").'</td></tr>';
|
||||||
|
|
||||||
@ -205,8 +196,8 @@ print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPFieldMobile").'</td><td>';
|
|||||||
print '<input size="25" type="text" name="fieldmobile" value="'.$conf->global->LDAP_FIELD_MOBILE.'">';
|
print '<input size="25" type="text" name="fieldmobile" value="'.$conf->global->LDAP_FIELD_MOBILE.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldMobileExample").'</td></tr>';
|
print '</td><td>'.$langs->trans("LDAPFieldMobileExample").'</td></tr>';
|
||||||
|
|
||||||
|
$var=!$var;
|
||||||
print '<tr><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
print '<tr '.$bc[$var].'><td colspan="3" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -53,6 +53,7 @@ class Contact
|
|||||||
var $cp;
|
var $cp;
|
||||||
var $ville;
|
var $ville;
|
||||||
var $fk_pays;
|
var $fk_pays;
|
||||||
|
var $fk_soc;
|
||||||
|
|
||||||
var $code;
|
var $code;
|
||||||
var $email;
|
var $email;
|
||||||
@ -83,49 +84,60 @@ class Contact
|
|||||||
*/
|
*/
|
||||||
function create($user)
|
function create($user)
|
||||||
{
|
{
|
||||||
|
// Nettoyage parametres
|
||||||
$this->name=trim($this->name);
|
$this->name=trim($this->name);
|
||||||
if (! $this->socid)
|
if (! $this->socid)$this->socid = 0;
|
||||||
{
|
|
||||||
$this->socid = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (datec, fk_soc, name, fk_user)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (datec, fk_soc, name, fk_user)";
|
||||||
$sql.= " VALUES (now(),";
|
$sql.= " VALUES (now(),";
|
||||||
if ($this->socid > 0) $sql.= " $this->socid,";
|
if ($this->socid > 0) $sql.= " $this->socid,";
|
||||||
else $sql.= "null,";
|
else $sql.= "null,";
|
||||||
$sql.= "'$this->name',$user->id)";
|
$sql.= "'$this->name',$user->id)";
|
||||||
|
dolibarr_syslog("Contact.class::create sql=".$sql);
|
||||||
if ($this->db->query($sql) )
|
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
{
|
{
|
||||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."socpeople");
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."socpeople");
|
||||||
|
|
||||||
$ret=$this->update($id, $user);
|
$result=$this->update($this->id, $user, 0);
|
||||||
if ($ret < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
return $id;
|
|
||||||
|
// Appel des triggers
|
||||||
|
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
||||||
|
$interface=new Interfaces($this->db);
|
||||||
|
$result=$interface->run_triggers('CONTACT_CREATE',$this,$user,$langs,$conf);
|
||||||
|
// Fin appel triggers
|
||||||
|
|
||||||
|
// \todo Mettre en trigger
|
||||||
|
$this->create_ldap($user);
|
||||||
|
|
||||||
|
return $this->id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
|
dolibarr_syslog("Contact.class::create ".$this->error);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Mise à jour des infos
|
* \brief Mise à jour des infos
|
||||||
* \param id id du contact à mettre à jour
|
* \param id Id du contact à mettre à jour
|
||||||
* \param user Utilisateur qui effectue la mise à jour
|
* \param user Objet utilisateur qui effectue la mise à jour
|
||||||
* \return int <0 si erreur, >0 si ok
|
* \param call_trigger 0=non, 1=oui
|
||||||
|
* \return int <0 si erreur, >0 si ok
|
||||||
*/
|
*/
|
||||||
function update($id, $user=0)
|
function update($id, $user=0, $call_trigger=1)
|
||||||
{
|
{
|
||||||
dolibarr_syslog("Contact::Update id=".$id,LOG_DEBUG);
|
|
||||||
|
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
|
|
||||||
|
// Nettoyage parametres
|
||||||
$this->name=trim($this->name);
|
$this->name=trim($this->name);
|
||||||
$this->firstname=trim($this->firstname);
|
$this->firstname=trim($this->firstname);
|
||||||
$this->email=trim($this->email);
|
$this->email=trim($this->email);
|
||||||
@ -158,6 +170,7 @@ class Contact
|
|||||||
$sql .= ", jabberid = '".addslashes($this->jabberid)."'";
|
$sql .= ", jabberid = '".addslashes($this->jabberid)."'";
|
||||||
if ($user) $sql .= ", fk_user_modif=".$user->id;
|
if ($user) $sql .= ", fk_user_modif=".$user->id;
|
||||||
$sql .= " WHERE idp=".$id;
|
$sql .= " WHERE idp=".$id;
|
||||||
|
dolibarr_syslog("Contact.class::update sql=".$sql,LOG_DEBUG);
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if (! $result)
|
if (! $result)
|
||||||
@ -165,32 +178,99 @@ class Contact
|
|||||||
$this->error=$this->db->error().' sql='.$sql;
|
$this->error=$this->db->error().' sql='.$sql;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->ldap->enabled)
|
if ($call_trigger)
|
||||||
{
|
{
|
||||||
if ($conf->global->LDAP_CONTACT_ACTIVE)
|
// Appel des triggers
|
||||||
{
|
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
||||||
$this->update_ldap($user);
|
$interface=new Interfaces($this->db);
|
||||||
}
|
$result=$interface->run_triggers('CONTACT_UPDATE',$this,$user,$langs,$conf);
|
||||||
|
// Fin appel triggers
|
||||||
}
|
|
||||||
|
// \todo Mettre en trigger
|
||||||
|
$this->update_ldap($user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Mise à jour de l'arbre LDAP
|
* \brief Mise à jour de l'arbre LDAP
|
||||||
|
* \param user Utilisateur qui efface
|
||||||
|
* \return int <0 si ko, >0 si ok
|
||||||
|
*/
|
||||||
|
function delete_ldap($user)
|
||||||
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
|
if (! $conf->ldap->enabled || ! $conf->global->LDAP_CONTACT_ACTIVE) return 0;
|
||||||
|
|
||||||
|
dolibarr_syslog("Contact.class::delete_ldap this->id=".$this->id,LOG_DEBUG);
|
||||||
|
|
||||||
|
$ldap=new AuthLdap();
|
||||||
|
$result=$ldap->connect();
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
$bind='';
|
||||||
|
if ($conf->global->LDAP_ADMIN_DN && $conf->global->LDAP_ADMIN_PASS)
|
||||||
|
{
|
||||||
|
dolibarr_syslog("Contact.class::delete_ldap authBind user=".$conf->global->LDAP_ADMIN_DN,LOG_DEBUG);
|
||||||
|
$bind=$ldap->authBind($conf->global->LDAP_ADMIN_DN,$conf->global->LDAP_ADMIN_PASS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_syslog("Contact.class::delete_ldap bind",LOG_DEBUG);
|
||||||
|
$bind=$ldap->bind();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($bind)
|
||||||
|
{
|
||||||
|
$info["cn"] = utf8_encode(trim($this->firstname." ".$this->name));
|
||||||
|
$dn = "cn=".$info["cn"].",".$conf->global->LDAP_CONTACT_DN;
|
||||||
|
|
||||||
|
$result=$ldap->delete($dn);
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error="Failed to connect to LDAP server !";
|
||||||
|
dolibarr_syslog("Contact.class::update_ldap Connexion failed",LOG_DEBUG);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Creation d'un contact dans l'arbre LDAP
|
||||||
|
* \param user Utilisateur qui effectue la creation
|
||||||
|
* \return int <0 si ko, >0 si ok
|
||||||
|
*/
|
||||||
|
function create_ldap($user)
|
||||||
|
{
|
||||||
|
dolibarr_syslog("Contact.class::create_ldap this->id=".$this->id,LOG_DEBUG);
|
||||||
|
return $this->update_ldap($user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Mise à jour du contact dans l'arbre LDAP
|
||||||
* \param user Utilisateur qui effectue la mise à jour
|
* \param user Utilisateur qui effectue la mise à jour
|
||||||
* \return int <0 si ko, >0 si ok
|
* \return int <0 si ko, >0 si ok
|
||||||
*/
|
*/
|
||||||
function update_ldap($user)
|
function update_ldap($user)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
|
if (! $conf->ldap->enabled || ! $conf->global->LDAP_CONTACT_ACTIVE) return 0;
|
||||||
|
|
||||||
$info = array();
|
$info = array();
|
||||||
|
|
||||||
dolibarr_syslog("Contact.class::update_ldap",LOG_DEBUG);
|
dolibarr_syslog("Contact.class::update_ldap this->id=".$this->id,LOG_DEBUG);
|
||||||
|
|
||||||
$this->fetch($this->id);
|
|
||||||
|
|
||||||
$ldap=new AuthLdap();
|
$ldap=new AuthLdap();
|
||||||
$result=$ldap->connect();
|
$result=$ldap->connect();
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -211,19 +291,24 @@ class Contact
|
|||||||
if ($conf->global->LDAP_SERVER_TYPE == 'activedirectory')
|
if ($conf->global->LDAP_SERVER_TYPE == 'activedirectory')
|
||||||
{
|
{
|
||||||
// Pas de conversion utf8 pour etre compatible Windows
|
// Pas de conversion utf8 pour etre compatible Windows
|
||||||
|
$info["objectclass"]=array("top",
|
||||||
$info["objectclass"][0] = "top";
|
"person",
|
||||||
$info["objectclass"][1] = "person";
|
"organizationalPerson",
|
||||||
$info["objectclass"][2] = "organizationalPerson";
|
"user");
|
||||||
//$info["objectclass"][3] = "inetOrgPerson";
|
|
||||||
$info["objectclass"][3] = "user";
|
|
||||||
|
|
||||||
|
// Champs obligatoires
|
||||||
$info["cn"] = trim($this->firstname." ".$this->name);
|
$info["cn"] = trim($this->firstname." ".$this->name);
|
||||||
$info["sn"] = $this->name;
|
if ($this->name) $info[$conf->global->LDAP_FIELD_NAME] = $this->name;
|
||||||
$info["givenName"] = $this->firstname;
|
else
|
||||||
|
{
|
||||||
|
$langs->load("other");
|
||||||
|
$this->error=$langs->trans("ErrorFieldRequired",$langs->trans("Name"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Champs optionnels
|
||||||
|
if ($this->firstname && $conf->global->LDAP_FIELD_FIRSTNAME) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = utf8_encode($this->firstname);
|
||||||
if ($this->poste) $info["title"] = $this->poste;
|
if ($this->poste) $info["title"] = $this->poste;
|
||||||
|
|
||||||
if ($this->socid > 0)
|
if ($this->socid > 0)
|
||||||
{
|
{
|
||||||
$soc = new Societe($this->db);
|
$soc = new Societe($this->db);
|
||||||
@ -259,45 +344,16 @@ class Contact
|
|||||||
$info["l"] = $soc->ville;
|
$info["l"] = $soc->ville;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($this->phone_pro && $conf->global->LDAP_FIELD_PHONE) $info[$conf->global->LDAP_FIELD_PHONE] = $this->phone_pro;
|
||||||
if ($this->phone_pro)
|
if ($this->phone_perso) $info["homePhone"] = $this->phone_perso;
|
||||||
$info["telephoneNumber"] = dolibarr_print_phone($this->phone_pro);
|
if ($this->phone_mobile && $conf->global->LDAP_FIELD_MOBILE) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->phone_mobile;
|
||||||
|
if ($this->fax && $conf->global->LDAP_FIELD_FAX) $info[$conf->global->LDAP_FIELD_FAX] = $this->fax;
|
||||||
if ($this->phone_perso)
|
if ($this->note) $info["description"] = $this->note;
|
||||||
$info["homePhone"] = dolibarr_print_phone($this->phone_perso);
|
if ($this->email && $conf->global->LDAP_FIELD_MAIL) $info[$conf->global->LDAP_FIELD_MAIL] = $this->email;
|
||||||
|
|
||||||
if ($this->phone_mobile)
|
|
||||||
$info["mobile"] = dolibarr_print_phone($this->phone_mobile);
|
|
||||||
|
|
||||||
if ($this->fax)
|
|
||||||
$info["facsimileTelephoneNumber"] = dolibarr_print_phone($this->fax);
|
|
||||||
|
|
||||||
if ($this->note)
|
|
||||||
$info["description"] = $this->note;
|
|
||||||
|
|
||||||
if ($this->email)
|
|
||||||
$info["mail"] = $this->email;
|
|
||||||
|
|
||||||
$dn = "cn=".$info["cn"].",".$conf->global->LDAP_CONTACT_DN;
|
|
||||||
|
|
||||||
// On supprime et on insère
|
|
||||||
dolibarr_syslog("Contact.class::update_ldap dn=".$dn." info=".$info);
|
|
||||||
$r = @ldap_delete($ldap->connection, $dn);
|
|
||||||
if (! @ldap_add($ldap->connection, $dn, $info))
|
|
||||||
{
|
|
||||||
$this->error = ldap_err2str(ldap_errno($ldap->connection));
|
|
||||||
dolibarr_syslog("Contact.class::update_ldap ldap_add ".$this->error);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_syslog("Contact.class::update_ldap rowid=".$this->rowid." added in LDAP");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// OpenLDAP. On encode les param en utf8
|
// OpenLDAP. On encode les param en utf8
|
||||||
|
|
||||||
$info["objectclass"]=array("top",
|
$info["objectclass"]=array("top",
|
||||||
"person",
|
"person",
|
||||||
"organizationalPerson",
|
"organizationalPerson",
|
||||||
@ -314,10 +370,8 @@ class Contact
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Champs optionnels
|
// Champs optionnels
|
||||||
if ($this->firstname) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = utf8_encode($this->firstname);
|
if ($this->firstname && $conf->global->LDAP_FIELD_FIRSTNAME) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = utf8_encode($this->firstname);
|
||||||
|
|
||||||
if ($this->poste) $info["title"] = utf8_encode($this->poste);
|
if ($this->poste) $info["title"] = utf8_encode($this->poste);
|
||||||
|
|
||||||
if ($this->socid > 0)
|
if ($this->socid > 0)
|
||||||
{
|
{
|
||||||
$soc = new Societe($this->db);
|
$soc = new Societe($this->db);
|
||||||
@ -332,18 +386,12 @@ class Contact
|
|||||||
if ($soc->cp) $info["postalCode"] = utf8_encode($soc->cp);
|
if ($soc->cp) $info["postalCode"] = utf8_encode($soc->cp);
|
||||||
if ($soc->ville) $info["l"] = utf8_encode($soc->ville);
|
if ($soc->ville) $info["l"] = utf8_encode($soc->ville);
|
||||||
}
|
}
|
||||||
|
if ($this->phone_pro && $conf->global->LDAP_FIELD_PHONE) $info[$conf->global->LDAP_FIELD_PHONE] = utf8_encode($this->phone_pro);
|
||||||
if ($this->phone_pro) $info[$conf->global->LDAP_FIELD_PHONE] = utf8_encode($this->phone_pro);
|
|
||||||
|
|
||||||
if ($this->phone_perso) $info["homePhone"] = utf8_encode($this->phone_perso);
|
if ($this->phone_perso) $info["homePhone"] = utf8_encode($this->phone_perso);
|
||||||
|
if ($this->phone_mobile && $conf->global->LDAP_FIELD_MOBILE) $info[$conf->global->LDAP_FIELD_MOBILE] = utf8_encode($this->phone_mobile);
|
||||||
if ($this->phone_mobile) $info[$conf->global->LDAP_FIELD_MOBILE] = utf8_encode($this->phone_mobile);
|
if ($this->fax && $conf->global->LDAP_FIELD_FAX) $info[$conf->global->LDAP_FIELD_FAX] = utf8_encode($this->fax);
|
||||||
|
|
||||||
if ($this->fax) $info[$conf->global->LDAP_FIELD_FAX] = utf8_encode($this->fax);
|
|
||||||
|
|
||||||
if ($this->note) $info["description"] = utf8_encode($this->note);
|
if ($this->note) $info["description"] = utf8_encode($this->note);
|
||||||
|
if ($this->email && $conf->global->LDAP_FIELD_MAIL) $info[$conf->global->LDAP_FIELD_MAIL] = utf8_encode($this->email);
|
||||||
if ($this->email) $info[$conf->global->LDAP_FIELD_MAIL] = utf8_encode($this->email);
|
|
||||||
|
|
||||||
if ($conf->global->LDAP_SERVER_TYPE == 'egroupware')
|
if ($conf->global->LDAP_SERVER_TYPE == 'egroupware')
|
||||||
{
|
{
|
||||||
@ -374,23 +422,23 @@ class Contact
|
|||||||
|
|
||||||
$info["uid"] = "Dolibarr ".$this->id. ": ".utf8_encode(trim($this->firstname." ".$this->name));
|
$info["uid"] = "Dolibarr ".$this->id. ": ".utf8_encode(trim($this->firstname." ".$this->name));
|
||||||
|
|
||||||
$dn = "cn=".$info["cn"].",".$conf->global->LDAP_CONTACT_DN;
|
}
|
||||||
|
|
||||||
// On supprime et on insère
|
// On supprime et on insère
|
||||||
dolibarr_syslog("Contact.class::update_ldap dn=".$dn." info=".$info);
|
$dn = "cn=".$info["cn"].",".$conf->global->LDAP_CONTACT_DN;
|
||||||
$result = $ldap->delete($dn);
|
dolibarr_syslog("Contact.class::update_ldap dn=".$dn." info=".$info);
|
||||||
$result = $ldap->add($dn, $info);
|
$result = $ldap->delete($dn);
|
||||||
if ($result <= 0)
|
$result = $ldap->add($dn, $info);
|
||||||
{
|
if ($result <= 0)
|
||||||
$this->error = $ldap->error." ".ldap_errno($ldap->connection)." ".ldap_error($ldap->connection);
|
{
|
||||||
dolibarr_syslog("Contact.class::update_ldap ".$this->error);
|
$this->error = $ldap->error." ".ldap_errno($ldap->connection)." ".ldap_error($ldap->connection);
|
||||||
print_r($info);
|
dolibarr_syslog("Contact.class::update_ldap ".$this->error);
|
||||||
return -1;
|
//print_r($info);
|
||||||
}
|
return -1;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
dolibarr_syslog("Contact.class::update_ldap rowid=".$this->rowid." added in LDAP");
|
{
|
||||||
}
|
dolibarr_syslog("Contact.class::update_ldap rowid=".$this->id." added in LDAP");
|
||||||
}
|
}
|
||||||
|
|
||||||
$ldap->unbind();
|
$ldap->unbind();
|
||||||
@ -407,7 +455,7 @@ class Contact
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error="Failed to connect to LDAP server !";
|
$this->error="Failed to connect to LDAP server !";
|
||||||
dolibarr_syslog("Contact::update_ldap Connexion failed",LOG_DEBUG);
|
dolibarr_syslog("Contact.class::update_ldap Connexion failed",LOG_DEBUG);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -608,7 +656,7 @@ class Contact
|
|||||||
$sql.=" AND fk_socpeople = ". $this->id;
|
$sql.=" AND fk_socpeople = ". $this->id;
|
||||||
$sql.=" GROUP BY tc.element";
|
$sql.=" GROUP BY tc.element";
|
||||||
|
|
||||||
dolibarr_syslog("Contact::load_ref_elements sql=".$sql);
|
dolibarr_syslog("Contact.class::load_ref_elements sql=".$sql);
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -629,7 +677,7 @@ class Contact
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->error()." - ".$sql;
|
$this->error=$this->db->error()." - ".$sql;
|
||||||
dolibarr_syslog("Contact::load_ref_elements Error ".$this->error);
|
dolibarr_syslog("Contact.class::load_ref_elements Error ".$this->error);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -660,50 +708,32 @@ class Contact
|
|||||||
$sql .= " WHERE idp=$id";
|
$sql .= " WHERE idp=$id";
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
if (! $result)
|
||||||
if (!$result)
|
|
||||||
{
|
{
|
||||||
print $this->db->error() . '<br>' . $sql;
|
$this->error=$this->db->error().' sql='.$sql;
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->ldap->enabled)
|
|
||||||
{
|
// Appel des triggers
|
||||||
if (defined('LDAP_CONTACT_ACTIVE') && LDAP_CONTACT_ACTIVE == 1)
|
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
||||||
{
|
$interface=new Interfaces($this->db);
|
||||||
$ldap = New AuthLdap();
|
$result=$interface->run_triggers('CONTACT_DELETE',$this,$user,$langs,$conf);
|
||||||
|
// Fin appel triggers
|
||||||
if ($ldap->connect())
|
|
||||||
{
|
|
||||||
if ($ldap->bind())
|
// \todo Mettre en trigger
|
||||||
{
|
|
||||||
// delete from ldap directory
|
// On modifie contact avec anciens noms
|
||||||
if (LDAP_SERVER_TYPE == 'activedirectory')
|
$savname=$this->name;
|
||||||
{
|
$savfirstname=$this->firstname;
|
||||||
$userdn = $this->old_firstname." ".$this->old_name; //enlever utf8 pour etre compatible Windows
|
$this->name=$this->old_name;
|
||||||
}
|
$this->firstname=$this->old_firstname;
|
||||||
else
|
|
||||||
{
|
$this->delete_ldap($user);
|
||||||
$userdn = utf8_encode($this->old_firstname." ".$this->old_name);
|
|
||||||
}
|
$this->name=$savname;
|
||||||
|
$this->firstname=$savfirstname;
|
||||||
$dn = "cn=".$userdn.",".$conf->global->LDAP_CONTACT_DN;
|
|
||||||
$r = @ldap_delete($ldap->connection, $dn);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo "LDAP bind failed...";
|
|
||||||
}
|
|
||||||
|
|
||||||
$ldap->close();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
echo "Unable to connect to LDAP server";
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -805,5 +835,47 @@ class Contact
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Initialise le contact avec valeurs fictives aléatoire
|
||||||
|
*/
|
||||||
|
function initAsSpecimen()
|
||||||
|
{
|
||||||
|
global $user,$langs;
|
||||||
|
|
||||||
|
// Charge tableau des id de société socids
|
||||||
|
$socids = array();
|
||||||
|
$sql = "SELECT idp FROM ".MAIN_DB_PREFIX."societe LIMIT 10";
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num_socs = $this->db->num_rows($resql);
|
||||||
|
$i = 0;
|
||||||
|
while ($i < $num_socs)
|
||||||
|
{
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
$row = $this->db->fetch_row($resql);
|
||||||
|
$socids[$i] = $row[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initialise paramètres
|
||||||
|
$this->id=0;
|
||||||
|
$this->specimen=1;
|
||||||
|
$this->fullname = 'DOLIBARR SPECIMEN';
|
||||||
|
$this->nom = 'DOLIBARR';
|
||||||
|
$this->name = $this->nom;
|
||||||
|
$this->prenom = 'SPECIMEN';
|
||||||
|
$this->firstname = $this->prenom;
|
||||||
|
$this->address = '61 jump street';
|
||||||
|
$this->cp = '75000';
|
||||||
|
$this->ville = 'Paris';
|
||||||
|
$this->fk_pays = 1;
|
||||||
|
$this->email = 'specimen@specimen.com';
|
||||||
|
$socid = rand(1, $num_socs);
|
||||||
|
$this->fk_soc = $socids[$socid];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
|
||||||
|
|
||||||
@ -608,7 +609,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit')
|
|||||||
|
|
||||||
|
|
||||||
// Historique des actions sur ce contact
|
// Historique des actions sur ce contact
|
||||||
print_titre ($langs->trans("TasksHistoryForThisContact"));
|
print_titre($langs->trans("TasksHistoryForThisContact"));
|
||||||
$histo=array();
|
$histo=array();
|
||||||
$numaction = 0 ;
|
$numaction = 0 ;
|
||||||
|
|
||||||
@ -680,11 +681,12 @@ if ($_GET["id"] && $_GET["action"] != 'edit')
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("Date").'</td>';
|
print '<td>'.$langs->trans("Date").'</td>';
|
||||||
print '<td align="center">'.$langs->trans("Status").'</td>';
|
|
||||||
print '<td>'.$langs->trans("Actions").'</td>';
|
print '<td>'.$langs->trans("Actions").'</td>';
|
||||||
print '<td>'.$langs->trans("Comments").'</td>';
|
print '<td>'.$langs->trans("Comments").'</td>';
|
||||||
print '<td>'.$langs->trans("Author").'</td></tr>';
|
print '<td>'.$langs->trans("Author").'</td>';
|
||||||
|
print '<td align="center">'.$langs->trans("Status").'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
foreach ($histo as $key=>$value)
|
foreach ($histo as $key=>$value)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
@ -693,14 +695,6 @@ if ($_GET["id"] && $_GET["action"] != 'edit')
|
|||||||
// Date
|
// Date
|
||||||
print "<td>". dolibarr_print_date($histo[$key]['date'],"%d %b %Y %H:%M") ."</td>";
|
print "<td>". dolibarr_print_date($histo[$key]['date'],"%d %b %Y %H:%M") ."</td>";
|
||||||
|
|
||||||
// Status/Percent
|
|
||||||
if ($histo[$key]['percent'] < 100) {
|
|
||||||
print "<td align=\"center\">".$histo[$key]['percent']."%</td>";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
print "<td align=\"center\">".$langs->trans("Done")."</td>";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($histo[$key]['type']=='action')
|
if ($histo[$key]['type']=='action')
|
||||||
@ -732,6 +726,13 @@ if ($_GET["id"] && $_GET["action"] != 'edit')
|
|||||||
}
|
}
|
||||||
else print " ";
|
else print " ";
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
|
// Status/Percent
|
||||||
|
print '<td align="right">';
|
||||||
|
$actionstatic=new ActionComm($db);
|
||||||
|
print $actionstatic->LibStatut($histo[$key]['percent'],5);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|||||||
@ -168,7 +168,7 @@ if ($socid > 0)
|
|||||||
|
|
||||||
// Affiche formulaire upload
|
// Affiche formulaire upload
|
||||||
$html=new Form($db);
|
$html=new Form($db);
|
||||||
$html->form_attach_new_file('docsoc.php?socid='.$socid,$langs->trans("AddPhoto"),1);
|
$html->form_attach_new_file('docsoc.php?socid='.$socid,$langs->trans("AddPhoto"),0);
|
||||||
|
|
||||||
// Affiche liste des documents existant
|
// Affiche liste des documents existant
|
||||||
print_titre($langs->trans("AttachedFiles"));
|
print_titre($langs->trans("AttachedFiles"));
|
||||||
|
|||||||
@ -527,6 +527,11 @@ LDAPDnContactActiveExample=Activated/Unactivated synchronization
|
|||||||
LDAPContactDn=Dolibarr contacts' DN
|
LDAPContactDn=Dolibarr contacts' DN
|
||||||
LDAPContactDnExample=Complete DN (ex: ou=contacts,dc=society,dc=com)
|
LDAPContactDnExample=Complete DN (ex: ou=contacts,dc=society,dc=com)
|
||||||
LDAPTestConnect=Test LDAP connection
|
LDAPTestConnect=Test LDAP connection
|
||||||
|
LDAPTestSynchroContact=Test contact's synchronization
|
||||||
|
LDAPTestSynchroUser=Test user's synchronization
|
||||||
|
LDAPTestSynchroMember=Test member's synchronization
|
||||||
|
LDAPSynchroOK=Synchronization test successful
|
||||||
|
LDAPSynchroKO=Failed synchronization test
|
||||||
LDAPTCPConnectOK=TCP connect to LDAP server successful (Server=%s, Port=%s)
|
LDAPTCPConnectOK=TCP connect to LDAP server successful (Server=%s, Port=%s)
|
||||||
LDAPTCPConnectKO=TCP connect to LDAP server failed (Server=%s, Port=%s)
|
LDAPTCPConnectKO=TCP connect to LDAP server failed (Server=%s, Port=%s)
|
||||||
LDAPBindOK=Connect/Authentificate to LDAP server sucessfull (Server=%s, Port=%s, Admin=%s)
|
LDAPBindOK=Connect/Authentificate to LDAP server sucessfull (Server=%s, Port=%s, Admin=%s)
|
||||||
|
|||||||
@ -47,7 +47,7 @@ NoRecordedProspects=No prospect recorded
|
|||||||
StatusActionToDo=To do
|
StatusActionToDo=To do
|
||||||
StatusActionDone=Done
|
StatusActionDone=Done
|
||||||
StatusActionInProcess=In process
|
StatusActionInProcess=In process
|
||||||
TasksHistoryForThisContact=Actions history for this contact
|
TasksHistoryForThisContact=Actions for this contact
|
||||||
LastProspectDoNotContact=Do not contact
|
LastProspectDoNotContact=Do not contact
|
||||||
LastProspectNeverContacted=Never contacted
|
LastProspectNeverContacted=Never contacted
|
||||||
LastProspectToContact=To contact
|
LastProspectToContact=To contact
|
||||||
|
|||||||
@ -105,7 +105,7 @@ Note=Note
|
|||||||
CurrentNote=Current note
|
CurrentNote=Current note
|
||||||
Title=Title
|
Title=Title
|
||||||
Label=Label
|
Label=Label
|
||||||
Info=Info
|
Info=Log
|
||||||
Family=Family
|
Family=Family
|
||||||
Description=Description
|
Description=Description
|
||||||
Designation=Description
|
Designation=Description
|
||||||
|
|||||||
@ -47,7 +47,7 @@ NoRecordedProspects=Pas de prospect enregistr
|
|||||||
StatusActionToDo=À faire
|
StatusActionToDo=À faire
|
||||||
StatusActionDone=Accompli
|
StatusActionDone=Accompli
|
||||||
StatusActionInProcess=En cours
|
StatusActionInProcess=En cours
|
||||||
TasksHistoryForThisContact=Historique des actions pour ce contact
|
TasksHistoryForThisContact=Actions vis à vis de ce contact
|
||||||
LastProspectDoNotContact=Ne pas contacter
|
LastProspectDoNotContact=Ne pas contacter
|
||||||
LastProspectNeverContacted=Jamais contacté
|
LastProspectNeverContacted=Jamais contacté
|
||||||
LastProspectToContact=À contacter
|
LastProspectToContact=À contacter
|
||||||
|
|||||||
@ -98,7 +98,7 @@ DefaultContact=Contact par d
|
|||||||
AddCompany=Créer société
|
AddCompany=Créer société
|
||||||
AddThirdParty=Ajouter un tiers
|
AddThirdParty=Ajouter un tiers
|
||||||
DeleteACompany=Supprimer une société
|
DeleteACompany=Supprimer une société
|
||||||
PersonalInformations=Informations personnelles
|
PersonalInformations=Infos personnelles
|
||||||
AccountancyCode=Code compta
|
AccountancyCode=Code compta
|
||||||
CustomerCode=Code client
|
CustomerCode=Code client
|
||||||
SupplierCode=Code fournisseur
|
SupplierCode=Code fournisseur
|
||||||
|
|||||||
@ -105,7 +105,7 @@ Note=Note
|
|||||||
CurrentNote=Note actuelle
|
CurrentNote=Note actuelle
|
||||||
Title=Titre
|
Title=Titre
|
||||||
Label=Libellé
|
Label=Libellé
|
||||||
Info=Info
|
Info=Suivi
|
||||||
Family=Famille
|
Family=Famille
|
||||||
Description=Description
|
Description=Description
|
||||||
Designation=Désignation
|
Designation=Désignation
|
||||||
|
|||||||
@ -527,6 +527,11 @@ LDAPDnContactActiveExample=Synchronisation activ
|
|||||||
LDAPContactDn=DN des contacts Dolibarr
|
LDAPContactDn=DN des contacts Dolibarr
|
||||||
LDAPContactDnExample=DN complet (ex: ou=contacts,dc=my-domain,dc=com)
|
LDAPContactDnExample=DN complet (ex: ou=contacts,dc=my-domain,dc=com)
|
||||||
LDAPTestConnect=Tester la connexion LDAP
|
LDAPTestConnect=Tester la connexion LDAP
|
||||||
|
LDAPTestSynchroContact=Tester synchronisation contacts
|
||||||
|
LDAPTestSynchroUser=Tester synchronisation utilisateur
|
||||||
|
LDAPTestSynchroMember=Tester synchronisation adhérent
|
||||||
|
LDAPSynchroOK=Test de synchronisation réalisé avec succès
|
||||||
|
LDAPSynchroKO=Echec du test de synchronisation
|
||||||
LDAPTCPConnectOK=Connexion TCP au serveur LDAP réussie (Serveur=%s, Port=%s)
|
LDAPTCPConnectOK=Connexion TCP au serveur LDAP réussie (Serveur=%s, Port=%s)
|
||||||
LDAPTCPConnectKO=Connexion TCP au serveur LDAP échouée (Serveur=%s, Port=%s)
|
LDAPTCPConnectKO=Connexion TCP au serveur LDAP échouée (Serveur=%s, Port=%s)
|
||||||
LDAPBindOK=Connection/Authentification au serveur LDAP réussie (Serveur=%s, Port=%s, Admin=%s)
|
LDAPBindOK=Connection/Authentification au serveur LDAP réussie (Serveur=%s, Port=%s, Admin=%s)
|
||||||
|
|||||||
@ -47,7 +47,7 @@ NoRecordedProspects=Aucun prospect enregistr
|
|||||||
StatusActionToDo=À faire
|
StatusActionToDo=À faire
|
||||||
StatusActionDone=Réalisé
|
StatusActionDone=Réalisé
|
||||||
StatusActionInProcess=En cours
|
StatusActionInProcess=En cours
|
||||||
TasksHistoryForThisContact=Historique des actions pour ce contact
|
TasksHistoryForThisContact=Actions vis à vis de contact
|
||||||
LastProspectDoNotContact=A ne pas contacter
|
LastProspectDoNotContact=A ne pas contacter
|
||||||
LastProspectNeverContacted=Non contactés
|
LastProspectNeverContacted=Non contactés
|
||||||
LastProspectToContact=A contacter
|
LastProspectToContact=A contacter
|
||||||
|
|||||||
@ -98,7 +98,7 @@ DefaultContact=Contact par d
|
|||||||
AddCompany=Créer société
|
AddCompany=Créer société
|
||||||
AddThirdParty=Créer tiers
|
AddThirdParty=Créer tiers
|
||||||
DeleteACompany=Supprimer une société
|
DeleteACompany=Supprimer une société
|
||||||
PersonalInformations=Informations personnelles
|
PersonalInformations=Infos personnelles
|
||||||
AccountancyCode=Code compta
|
AccountancyCode=Code compta
|
||||||
CustomerCode=Code client
|
CustomerCode=Code client
|
||||||
SupplierCode=Code fournisseur
|
SupplierCode=Code fournisseur
|
||||||
|
|||||||
@ -105,7 +105,7 @@ Note=Note
|
|||||||
CurrentNote=Note actuelle
|
CurrentNote=Note actuelle
|
||||||
Title=Titre
|
Title=Titre
|
||||||
Label=Libellé
|
Label=Libellé
|
||||||
Info=Info
|
Info=Suivi
|
||||||
Family=Famille
|
Family=Famille
|
||||||
Description=Description
|
Description=Description
|
||||||
Designation=Désignation
|
Designation=Désignation
|
||||||
|
|||||||
@ -50,7 +50,7 @@ Type=Het type
|
|||||||
Language=Taal
|
Language=Taal
|
||||||
Note=Aantekening
|
Note=Aantekening
|
||||||
Label=Het etiket
|
Label=Het etiket
|
||||||
Info=de info
|
Info=Log
|
||||||
Family=Famille
|
Family=Famille
|
||||||
Description=De beschrijving
|
Description=De beschrijving
|
||||||
Action=Actie
|
Action=Actie
|
||||||
|
|||||||
@ -69,7 +69,7 @@ Language=Idioma
|
|||||||
Note=Nota
|
Note=Nota
|
||||||
CurrentNote=Nota currente
|
CurrentNote=Nota currente
|
||||||
Label=Rótulo
|
Label=Rótulo
|
||||||
Info=Info
|
Info=Log
|
||||||
Family=Família
|
Family=Família
|
||||||
Description=Descrição
|
Description=Descrição
|
||||||
Designation=Designação
|
Designation=Designação
|
||||||
|
|||||||
@ -2107,8 +2107,8 @@ function dolibarr_dir_list($path, $types="all", $recursive=0, $filter="", $exclu
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne le numéro de la semaine par rapport a une date
|
* \brief Retourne le numéro de la semaine par rapport a une date
|
||||||
* \param time date au format 'timestamp'
|
* \param time Date au format 'timestamp'
|
||||||
* \return Numéro de semaine
|
* \return int Numéro de semaine
|
||||||
*/
|
*/
|
||||||
function numero_semaine($time)
|
function numero_semaine($time)
|
||||||
{
|
{
|
||||||
@ -2185,4 +2185,14 @@ function numero_semaine($time)
|
|||||||
return sprintf("%02d",$numeroSemaine);
|
return sprintf("%02d",$numeroSemaine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Retourne le picto champ obligatoire
|
||||||
|
* \return string Chaine avec picto obligatoire
|
||||||
|
*/
|
||||||
|
function picto_required()
|
||||||
|
{
|
||||||
|
return '<b>*</b>';
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -66,8 +66,9 @@ if ($resql)
|
|||||||
print $langs->trans("UpdateContact")." rowid=".$obj->rowid;
|
print $langs->trans("UpdateContact")." rowid=".$obj->rowid;
|
||||||
|
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
|
|
||||||
$contact->id = $obj->rowid;
|
$contact->id = $obj->rowid;
|
||||||
|
$contact->fetch($contact->id);
|
||||||
|
|
||||||
$result=$contact->update_ldap($user);
|
$result=$contact->update_ldap($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user