diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php
index 6733039e7e1..946b28cb058 100644
--- a/htdocs/adherents/ldap.php
+++ b/htdocs/adherents/ldap.php
@@ -118,6 +118,8 @@ print '
| LDAP '.$langs->trans("LDAPMemberDn").' | '.$
print ' |
| LDAP '.$langs->trans("LDAPNamingAttribute").' | '.$conf->global->LDAP_KEY_MEMBERS." |
\n";
// LDAP Server
+print '| LDAP '.$langs->trans("Type").' | '.$conf->global->LDAP_SERVER_TYPE." |
\n";
+print '| LDAP '.$langs->trans("Version").' | '.$conf->global->LDAP_SERVER_PROTOCOLVERSION." |
\n";
print '| LDAP '.$langs->trans("LDAPPrimaryServer").' | '.$conf->global->LDAP_SERVER_HOST." |
\n";
print '| LDAP '.$langs->trans("LDAPSecondaryServer").' | '.$conf->global->LDAP_SERVER_HOST_SLAVE." |
\n";
print '| LDAP '.$langs->trans("LDAPServerPort").' | '.$conf->global->LDAP_SERVER_PORT." |
\n";
@@ -154,7 +156,7 @@ if ($result > 0)
{
if (! is_array($records))
{
- print '| '.$langs->trans("ErrorFailedToReadLDAP").' |
';
+ print '| '.$langs->trans("ErrorFailedToReadLDAP").' |
';
}
else
{
@@ -164,7 +166,7 @@ if ($result > 0)
}
else
{
- print '| '.$langs->trans("LDAPRecordNotFound").' |
';
+ print '| '.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.') |
';
}
$ldap->unbind();
diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php
index 96cf2a4bcfa..efc4108df56 100644
--- a/htdocs/facture.class.php
+++ b/htdocs/facture.class.php
@@ -2259,8 +2259,8 @@ class Facture extends CommonObject
/**
\brief Renvoi liste des factures remplacables
- Statut validee + aucun paiement + non paye + pas deja remplacées
- \param socid Id societe
+ Statut validée + aucun paiement + non payée + pas deja remplacée
+ \param socid Id societe
\return array Tableau des factures ('id'=>id, 'ref'=>ref, 'statut'=>status)
*/
function list_replacable_invoices($socid=0)
@@ -2274,9 +2274,10 @@ class Facture extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON f.rowid = ff.fk_facture_source";
- $sql.= " WHERE f.fk_statut = 1 AND f.paye = 0 AND pf.fk_paiement IS NULL";
- $sql.= " AND ff.fk_statut IS NULL"; // Renvoie vrai si pas de jointure
- //$sql.= " AND IFNULL(ff.fk_statut,0) = 0"; // Renvoie vrai si pas de jointure ou si jointure vers statut à 0
+ $sql.= " WHERE f.fk_statut = 1";
+ $sql.= " AND f.paye = 0"; // Pas classée payée complètement
+ $sql.= " AND pf.fk_paiement IS NULL"; // Aucun paiement deja fait
+ $sql.= " AND ff.fk_statut IS NULL"; // Renvoi vrai si pas facture de remplacement
if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid;
$sql.= " ORDER BY f.facnumber";
@@ -2304,7 +2305,7 @@ class Facture extends CommonObject
/**
* \brief Renvoi liste des factures qualifiables pour avoir
- * Statut >= validee + pas classé payée completement + pas classé payée partiellement + pas deja remplacée
+ * Statut >= validée + classée payée completement ou classée payée partiellement + pas deja remplacée
* \param socid Id societe
* \return array Tableau des factures ($id => $ref)
*/
@@ -2319,9 +2320,9 @@ class Facture extends CommonObject
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid = pf.fk_facture";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as ff ON (f.rowid = ff.fk_facture_source AND ff.type=1)";
$sql.= " WHERE f.fk_statut >= 1";
- $sql.= " AND f.paye = 0"; // Pas classé payé complètement
- $sql.= " AND f.close_code IS NULL"; // Pas classé payé partiellement
- $sql.= " AND ff.type IS NULL"; // Renvoi vrai si pas facture de remplacement
+ $sql.= " AND (f.paye = 1"; // Classée payée complètement
+ $sql.= " OR f.close_code IS NOT NULL)"; // Classée payée partiellement
+ $sql.= " AND ff.type IS NULL"; // Renvoi vrai si pas facture de remplacement
if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid;
$sql.= " ORDER BY f.facnumber";
diff --git a/htdocs/includes/modules/modAdherent.class.php b/htdocs/includes/modules/modAdherent.class.php
index fc9720f5713..cc0c9643025 100644
--- a/htdocs/includes/modules/modAdherent.class.php
+++ b/htdocs/includes/modules/modAdherent.class.php
@@ -84,7 +84,7 @@ class modAdherent extends DolibarrModules
$this->const[2]= array("ADHERENT_MAIL_EDIT","texte","Voici le rappel des coordonnees que vous avez modifiees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l'adresse suivante :\r\n%SERVEUR%public/adherents/","Mail d'edition");
$this->const[3] = array("ADHERENT_MAIL_RESIL","texte","Votre adhesion sur %SERVEUR% vient d'etre resilie.\r\nNous esperons vous revoir tres bientot","Mail de résiliation");
$this->const[4] = array("ADHERENT_MAIL_NEW","texte","Merci de votre inscription. Votre adhesion devrait etre rapidement validee.^M\nVoici le rappel des coordonnees que vous avez rentrees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l'adresse suivante :\r\n%SERVEUR%public/adherents/","Mail de nouvel inscription");
- $this->const[5] = array("ADHERENT_MAIL_VALID_SUBJECT","chaine"," Votre adhsion a ete valide sur %SERVEUR%","sujet du mail de validation");
+ $this->const[5] = array("ADHERENT_MAIL_VALID_SUBJECT","chaine"," Votre adhesion a ete validee sur %SERVEUR%","sujet du mail de validation");
$this->const[6] = array("ADHERENT_MAIL_RESIL_SUBJECT","chaine","Resiliation de votre adhesion sur %SERVEUR% ","sujet du mail de resiliation");
$this->const[7] = array("ADHERENT_MAIL_NEW_SUBJECT","chaine","Bienvenue sur %SERVEUR%","Sujet du mail de nouvelle adhesion");
$this->const[8] = array("ADHERENT_MAIL_EDIT_SUBJECT","chaine","Votre fiche a ete editee sur %SERVEUR%","Sujet du mail d'edition");
@@ -101,7 +101,7 @@ class modAdherent extends DolibarrModules
$this->const[19] = array("ADHERENT_SPIP_SERVEUR","chaine","","serveur spip");
$this->const[20] = array("ADHERENT_SPIP_DB","chaine","","db spip");
$this->const[21] = array("ADHERENT_MAIL_FROM","chaine","","From des mails");
- $this->const[22] = array("ADHERENT_MAIL_COTIS","texte","Bonjour %PRENOM%,^M\n^M\nCet email confirme que votre cotisation a ete recue\r\net enregistree","Mail de validation de cotisation");
+ $this->const[22] = array("ADHERENT_MAIL_COTIS","texte","Bonjour %PRENOM%,\r\nCet email confirme que votre cotisation a ete recue\r\net enregistree","Mail de validation de cotisation");
$this->const[23] = array("ADHERENT_MAIL_COTIS_SUBJECT","chaine"," Recu de votre cotisation","sujet du mail de validation de cotisation");
$this->const[24] = array("ADHERENT_TEXT_NEW_ADH","texte","","Texte d'entete du formulaire d'adhesion en ligne");
$this->const[25] = array("ADHERENT_CARD_HEADER_TEXT","chaine","%ANNEE%","Texte imprime sur le haut de la carte adherent");
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 7d4cef8a721..14654960225 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -531,7 +531,7 @@ LDAPServerUseTLSExample=Your LDAP server use TLS
LDAPServerDn=Server DN
LDAPAdminDn=Administrator DN
LDAPAdminDnExample=Complete DN (ex: cn=adminldap,dc=society,dc=com)
-LDAPPassword=administrator password
+LDAPPassword=Administrator password
LDAPUserDn=Users' DN
LDAPUserDnExample=Complete DN (ex: ou=users,dc=society,dc=com)
LDAPGroupDn=Groups' DN
@@ -559,7 +559,7 @@ LDAPTestSynchroGroup=Test group's synchronization
LDAPTestSynchroMember=Test member's synchronization
LDAPSynchroOK=Synchronization test successful
LDAPSynchroKO=Failed synchronization test
-LDAPSynchroKOMayBePermissions=Failed synchronization test. Chack that connexion to server is correctly configured and allows LDAP udpates
+LDAPSynchroKOMayBePermissions=Failed synchronization test. Check that connexion to server is correctly configured and allows LDAP udpates
LDAPTCPConnectOK=TCP connect to LDAP server successful (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, Password=%s)
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index cdc85f815e2..7bf23a92af6 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -16,7 +16,7 @@ InvoiceReplacementAsk=Replacement invoice for invoice
InvoiceReplacementDesc=Replacement invoice is used to cancel and replace completely an invoice with no paiement already recevided.
Reference of canceled invoice is required.
InvoiceAvoir=Credit note
InvoiceAvoirAsk=Credit note to correct invoice
-InvoiceAvoirDesc=The credit note is a negative invoice used to solve fact that an invoice has an higher amount that amount that was or will be payed (all possible reasons).
+InvoiceAvoirDesc=The credit note is a negative invoice used to solve fact that an invoice has an higher amount that should be (all possible reasons) or a product returned after invoice was payed.
ReplaceInvoice=Replace invoice %s
ReplacedByInvoice=Replaced by invoice %s
CorrectInvoice=Correct invoice %s
@@ -85,7 +85,7 @@ BillShortStatusValidated=Validated
BillShortStatusStarted=Started
BillShortStatusNotPayed=Not payed
BillShortStatusClosedUnpayed=Closed
-BillShortStatusClosedPayedPartially=Payed (part)
+BillShortStatusClosedPayedPartially=Payed (partially)
PaymentStatusToValidShort=To validate
ErrorVATIntraNotConfigured=Intracommunautary VAT number not yet defined
ErrorNoPaiementModeConfigured=No paiment mode yet defined
diff --git a/htdocs/langs/en_US/ldap.lang b/htdocs/langs/en_US/ldap.lang
index 2d9a20eac5e..97c087ad216 100644
--- a/htdocs/langs/en_US/ldap.lang
+++ b/htdocs/langs/en_US/ldap.lang
@@ -17,4 +17,4 @@ LDAPGroups=Groups in LDAP database
SynchronizeDolibarr2Ldap=Synchronize user (Dolibarr -> LDAP)
UserSynchronized=User synchronized
ForceSynchronize=Force synchronizing Dolibarr -> LDAP
-ErrorFailedToReadLDAP=Failed to read LDAP database.Check LDAP module setup and database accessibility.
+ErrorFailedToReadLDAP=Failed to read LDAP database. Check LDAP module setup and database accessibility.
diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang
index fd8dd3a3a20..a2be5f555c8 100644
--- a/htdocs/langs/fr_FR/bills.lang
+++ b/htdocs/langs/fr_FR/bills.lang
@@ -16,7 +16,7 @@ InvoiceReplacementAsk=Facture de remplacement de la facture
InvoiceReplacementDesc=La facture de remplacement sert à annuler et remplacer une facture existante sur laquelle aucun paiement n'a encore eu lieu.
La référence de la facture qui doit être annulée est obligatoire.
InvoiceAvoir=Facture avoir
InvoiceAvoirAsk=Facture avoir pour correction de la facture
-InvoiceAvoirDesc=La facture d'avoir est une facture négative destinée à compenser une facture comportant un montant supérieur à ce qui a été ou sera réellement payé (toutes causes possibles).
+InvoiceAvoirDesc=La facture d'avoir est une facture négative destinée à compenser une facture comportant un montant supérieur à ce qui aurait du (toutes causes possibles) ou parce qu'un produit a été retourné après que la facture soit payée.
ReplaceInvoice=Remplace la facture %s
ReplacedByInvoice=Remplacée par la facture %s
CorrectInvoice=Corrige facture %s
diff --git a/htdocs/lib/ldap.class.php b/htdocs/lib/ldap.class.php
index 67ce8555bff..2c0fe3ded33 100644
--- a/htdocs/lib/ldap.class.php
+++ b/htdocs/lib/ldap.class.php
@@ -213,8 +213,18 @@ class Ldap
if ($this->serverType == "activedirectory")
{
- $this->setReferrals();
- $connected=2;
+ $result=$this->setReferrals();
+ if ($result)
+ {
+ //$this->bind=???? Comment positionne-t-on bind avec activedirectory ?
+ //si bind non défini, les autres fonctions échouent
+ $connected=2;
+ break;
+ }
+ else
+ {
+ $this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
+ }
}
else
{
@@ -656,6 +666,9 @@ class Ldap
$fp=fopen($file,"w");
if ($fp)
{
+ fputs($fp,"# ldapadd -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapinput.in\n");
+ fputs($fp,"# ldapmodify -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapinput.in\n");
+ fputs($fp,"# ldapdelete -c -v -D cn=Manager,dc=my-domain,dc=com -W -f ldapinput.in\n");
fputs($fp, "dn: ".$dn."\n");
foreach($info as $key => $value)
{
@@ -817,11 +830,19 @@ class Ldap
return -1;
}
- $entry = ldap_first_entry($this->connection, $ldapSearchResult);
- $ldapBinary = ldap_get_values_len ($this->connection, $entry, "objectsid");
- $SIDText = $this->binSIDtoText($ldapBinary[0]);
- return $SIDText;
- return $ldapBinary;
+ $entry = ldap_first_entry($this->connection, $ldapSearchResult);
+ if ($entry)
+ {
+ $ldapBinary = ldap_get_values_len ($this->connection, $entry, "objectsid");
+ $SIDText = $this->binSIDtoText($ldapBinary[0]);
+ return $SIDText;
+ //return $ldapBinary;
+ }
+ else
+ {
+ return '?';
+ }
+
}
/**
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index 8d703c178f1..943b2a9a860 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -729,7 +729,14 @@ else
// Ref
print '| '.$langs->trans("Ref").' | ';
- print ''.$fuser->id.' | ';
+ print '';
+
+ if ($previous_ref || $next_ref) print '| ';
+ print $fuser->id;
+ if ($previous_ref || $next_ref) print ' | '.$previous_ref.' | '.$next_ref.' | ';
+
+ print ' | ';
+
print '';
if (file_exists($conf->users->dir_output."/".$fuser->id.".jpg"))
{
diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php
index e6a3f0aaae0..1710b66f0c8 100644
--- a/htdocs/user/ldap.php
+++ b/htdocs/user/ldap.php
@@ -61,14 +61,13 @@ if ($_GET["action"] == 'dolibarr2ldap')
$db->begin();
$ldap=new Ldap();
- $ldap->connect_bind();
+ $result=$ldap->connect_bind();
$info=$fuser->_load_ldap_info();
$dn=$fuser->_load_ldap_dn($info);
-
- $ret=$ldap->update($dn,$info,$user); // Marche en creation LDAP et mise a jour
+ $result=$ldap->update($dn,$info,$user); // Marche en creation LDAP et mise a jour
- if ($ret >= 0)
+ if ($result >= 0)
{
$message.=' '.$langs->trans("UserSynchronized").' ';
$db->commit();
@@ -153,6 +152,8 @@ print ' |
| LDAP '.$langs->trans("LDAPUserDn").' | '.$co
print ' |
| LDAP '.$langs->trans("LDAPNamingAttribute").' | '.$conf->global->LDAP_KEY_USERS." |
\n";
// LDAP Server
+print '| LDAP '.$langs->trans("Type").' | '.$conf->global->LDAP_SERVER_TYPE." |
\n";
+print '| LDAP '.$langs->trans("Version").' | '.$conf->global->LDAP_SERVER_PROTOCOLVERSION." |
\n";
print '| LDAP '.$langs->trans("LDAPPrimaryServer").' | '.$conf->global->LDAP_SERVER_HOST." |
\n";
print '| LDAP '.$langs->trans("LDAPSecondaryServer").' | '.$conf->global->LDAP_SERVER_HOST_SLAVE." |
\n";
print '| LDAP '.$langs->trans("LDAPServerPort").' | '.$conf->global->LDAP_SERVER_PORT." |
\n";
@@ -199,21 +200,26 @@ if ($result > 0)
$info=$fuser->_load_ldap_info();
$dn=$fuser->_load_ldap_dn($info,1);
$search = "(".$fuser->_load_ldap_dn($info,2).")";
- $result=$ldap->search($dn,$search);
- if ($result < 0)
- {
- dolibarr_print_error($db,$ldap->error);
- }
-
+ $records=$ldap->search($dn,$search);
+
+ //print_r($records);
+
// Affichage arbre
- if (sizeof($result))
+ if (sizeof($records) && (! isset($records['count']) || $records['count'] > 0))
{
- $html=new Form($db);
- $html->show_ldap_content($result,0,0,true);
+ if (! is_array($records))
+ {
+ print '| '.$langs->trans("ErrorFailedToReadLDAP").' |
';
+ }
+ else
+ {
+ $html=new Form($db);
+ $result=$html->show_ldap_content($records,0,0,true);
+ }
}
else
{
- print '| '.$langs->trans("LDAPRecordNotFound").' |
';
+ print '| '.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.') |
';
}
$ldap->unbind();