From 3298939851512204ad89f3263b52fd7efd9be12e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 30 May 2007 11:29:31 +0000 Subject: [PATCH] =?UTF-8?q?Add:=20champs=20suppl=E9mentaire=20pour=20la=20?= =?UTF-8?q?synchro=20ldap=20des=20contacts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/ldap_contacts.php | 18 ++++++++++++++++++ htdocs/contact.class.php | 3 ++- htdocs/langs/en_US/admin.lang | 6 ++++-- htdocs/langs/fr_FR/admin.lang | 4 +++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 5bf8b914820..a04dc980484 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -55,6 +55,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',$_POST["fieldfullname"])) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME',$_POST["fieldname"])) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_FIRSTNAME',$_POST["fieldfirstname"])) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_COMPANY',$_POST["fieldcompany"])) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL',$_POST["fieldmail"])) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE',$_POST["fieldphone"])) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',$_POST["fieldmobile"])) $error++; @@ -62,6 +63,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_FIELD_ADDRESS',$_POST["fieldaddress"])) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_ZIP',$_POST["fieldzip"])) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_TOWN',$_POST["fieldtown"])) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_COUNTRY',$_POST["fieldcountry"])) $error++; if ($error) { @@ -157,6 +159,14 @@ print ''.$langs->trans("LDAPFieldFirstNameExample").''; print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_FIRSTNAME?' checked="true"':'').">"; print ''; +// Company +$var=!$var; +print ''.$langs->trans("LDAPFieldCompany").''; +print ''; +print ''.$langs->trans("LDAPFieldCompanyExample").''; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_COMPANY?' checked="true"':'').">"; +print ''; + // Mail $var=!$var; print ''.$langs->trans("LDAPFieldMail").''; @@ -213,6 +223,14 @@ print ''.$langs->trans("LDAPFieldTownExample").''; print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_TOWN?' checked="true"':'').">"; print ''; +// Pays +$var=!$var; +print ''.$langs->trans("LDAPFieldCountry").''; +print ''; +print ''.$langs->trans("LDAPFieldCountryExample").''; +print 'global->LDAP_KEY_CONTACTS==$conf->global->LDAP_FIELD_COUNTRY?' checked="true"':'').">"; +print ''; + $var=!$var; print ''; diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index 4dd1d327814..3e55186bb66 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -247,7 +247,7 @@ class Contact $soc = new Societe($this->db); $soc->fetch($this->socid); - $info["o"] = $soc->nom; + $info[$conf->global->LDAP_FIELD_COMPANY] = $soc->nom; if ($soc->client == 1) $info["businessCategory"] = "Customers"; if ($soc->client == 2) $info["businessCategory"] = "Prospects"; if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers"; @@ -255,6 +255,7 @@ class Contact if ($this->address && $conf->global->LDAP_FIELD_ADDRESS) $info[$conf->global->LDAP_FIELD_ADDRESS] = $this->address; if ($this->cp && $conf->global->LDAP_FIELD_ZIP) $info[$conf->global->LDAP_FIELD_ZIP] = $this->cp; if ($this->ville && $conf->global->LDAP_FIELD_TOWN) $info[$conf->global->LDAP_FIELD_TOWN] = $this->ville; + if ($this->pays && $conf->global->LDAP_FIELD_COUNTRY) $info[$conf->global->LDAP_FIELD_COUNTRY] = $this->pays; if ($this->phone_pro && $conf->global->LDAP_FIELD_PHONE) $info[$conf->global->LDAP_FIELD_PHONE] = $this->phone_pro; if ($this->phone_perso && $conf->global->LDAP_FIELD_PHONE_PERSO) $info[$conf->global->LDAP_FIELD_PHONE_PERSO] = $this->phone_perso; if ($this->phone_mobile && $conf->global->LDAP_FIELD_MOBILE) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->phone_mobile; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 28e9fe19cd7..aa9785d8c8f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -635,11 +635,13 @@ LDAPFieldZipExample=Example : postalcode LDAPFieldTown=Town LDAPFieldTownExample=Example : l LDAPFieldCountry=Country -LDAPFieldCountryExample=Example : +LDAPFieldCountryExample=Example : co LDAPFieldDescription=Description LDAPFieldDescriptionExample=Example : description LDAPFieldBirthdate=Birthdate -LDAPFieldBirthdateExample=Exemple : +LDAPFieldBirthdateExample=Example : +LDAPFieldCompany=Company +LDAPFieldCompanyExample=Example : company LDAPFieldSid=SID LDAPFieldSidExample=Example : objectsid LDAPFieldEndLastSubscription=Date of subscription end diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 1c6945324b8..4e95bee6a7d 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -642,11 +642,13 @@ LDAPFieldZipExample=Exemple : postalcode LDAPFieldTown=Ville LDAPFieldTownExample=Exemple : l LDAPFieldCountry=Pays -LDAPFieldCountryExample=Exemple : +LDAPFieldCountryExample=Exemple : co LDAPFieldDescription=Description LDAPFieldDescriptionExample=Exemple : description LDAPFieldBirthdate=Date de naissance LDAPFieldBirthdateExample=Exemple : +LDAPFieldCompany=Société +LDAPFieldCompanyExample=Exemple : company LDAPFieldSid=SID LDAPFieldSidExample=Exemple : objectsid LDAPFieldEndLastSubscription=Date fin validité adhésion