From c2d4c73b65ef61d4d46a49d9ab90bda419f6e16d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 24 Jun 2006 20:37:32 +0000 Subject: [PATCH] Bugfix --- htdocs/expedition/commande.php | 2 +- htdocs/expedition/fiche.php | 2 +- htdocs/html.form.class.php | 2 +- .../modules/propale/modules_propale.php | 2 +- htdocs/livraison/fiche.php | 2 +- htdocs/user/fiche.php | 51 +++++++++++-------- 6 files changed, 34 insertions(+), 27 deletions(-) diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php index df105fae665..be82af95924 100644 --- a/htdocs/expedition/commande.php +++ b/htdocs/expedition/commande.php @@ -570,7 +570,7 @@ if ($_GET["id"] > 0) print ''; print ''.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.' - '.$product->libelle; - if ($objp->description) print nl2br($objp->description); + if ($objp->description) print '
'.nl2br($objp->description); print ''; } else diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 07621348ed4..1c622e3e08d 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -511,7 +511,7 @@ else print ''; print ''.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.' - '.$product->libelle; - if ($objp->description) print nl2br($objp->description); + if ($objp->description) print '
'.nl2br($objp->description); print ''; } else diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 055e7a8a483..749d8928955 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1770,7 +1770,7 @@ class Form if ($selected) { require_once(DOL_DOCUMENT_ROOT ."/comm/adresse_livraison.class.php"); - $livraison=new Livraison($this->db); + $livraison=new AdresseLivraison($this->db); $livraison->fetch_adresse($selected); print 'socid.'&idl='.$livraison->idl.'&action=edit&origin='.$origin.'&originid='.$originid.'>'.$livraison->label.''; } diff --git a/htdocs/includes/modules/propale/modules_propale.php b/htdocs/includes/modules/propale/modules_propale.php index 075bef9dca7..c20a08dc2eb 100644 --- a/htdocs/includes/modules/propale/modules_propale.php +++ b/htdocs/includes/modules/propale/modules_propale.php @@ -175,7 +175,7 @@ function propale_pdf_create($db, $id, $modele='', $outputlangs='') // Charge le modele if ($modelisok) { - $classname = "pdf_expedition_".$modele; + $classname = "pdf_propale_".$modele; require_once($dir.$file); $obj = new $classname($db); diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 3b6e1618e8e..f9a51a3914b 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -484,7 +484,7 @@ else print ''; print ''.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.' - '.$product->libelle; - if ($objp->description) print nl2br($objp->description); + if ($objp->description) print '
'.nl2br($objp->description); print ''; } else diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 173a5213388..588c8be99c0 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -317,11 +317,20 @@ if (($action == 'create') || ($action == 'adduserldap')) { if ($conf->global->LDAP_SERVER_HOST && $conf->global->LDAP_ADMIN_DN && $conf->global->LDAP_ADMIN_PASS) { + $name = $conf->global->LDAP_FIELD_NAME; + $firstname = $conf->global->LDAP_FIELD_FIRSTNAME; + $mail = $conf->global->LDAP_FIELD_MAIL; + $phone = $conf->global->LDAP_FIELD_PHONE; + $fax = $conf->global->LDAP_FIELD_FAX; + $mobile = $conf->global->LDAP_FIELD_MOBILE; + $login = $conf->global->LDAP_FIELD_LOGIN_SAMBA; + $SID = "objectsid"; + $ldap = new AuthLdap(); if ($ldap->connect()) { - $justthese = array( "sn", "givenname", "samaccountname"); + $justthese = array( $name, $firstname, $login); $ldapusers = $ldap->getUsers('*', $justthese); if ($ldapusers) @@ -330,8 +339,8 @@ if (($action == 'create') || ($action == 'adduserldap')) foreach ($ldapusers as $key => $ldapuser) { - if($ldapuser["sn"] != "") - $liste[$ldapuser["samaccountname"]] = utf8_decode($ldapuser["sn"])." ".utf8_decode($ldapuser["givenname"]); + if($ldapuser[$name] != "") + $liste[$ldapuser[$login]] = utf8_decode($ldapuser[$name])." ".utf8_decode($ldapuser[$firstname]); } print '
'; @@ -344,17 +353,15 @@ if (($action == 'create') || ($action == 'adduserldap')) if ($action == 'adduserldap') { - - - $selecteduser = $_POST['users']; - $justthese = array( "samaccountname", - "sn", - "givenname", - "mail", - "telephonenumber", - "facsimiletelephonenumber", - "mobile", - "objectsid"); + $selecteduser = $_POST['users']; + $justthese = array( $login, + $name, + $firstname, + $mail, + $phone, + $fax, + $mobile, + $SID); $selectedUser = $ldap->getUsers($selecteduser, $justthese); @@ -362,14 +369,14 @@ if (($action == 'create') || ($action == 'adduserldap')) { foreach ($selectedUser as $key => $attribute) { - $ldap_nom = utf8_decode($attribute["sn"]?$attribute["sn"]:''); - $ldap_prenom = utf8_decode($attribute["givenname"]?$attribute["givenname"]:''); - $ldap_login = utf8_decode($attribute["samaccountname"]?$attribute["samaccountname"]:''); - $ldap_phone = utf8_decode($attribute["telephonenumber"]?$attribute["telephonenumber"]:''); - $ldap_fax = utf8_decode($attribute["facsimiletelephonenumber"]?$attribute["facsimiletelephonenumber"]:''); - $ldap_mobile = utf8_decode($attribute["mobile"]?$attribute["mobile"]:''); - $ldap_mail = utf8_decode($attribute["mail"]?$attribute["mail"]:''); - $ldap_SID = bin2hex($attribute["objectsid"]); + $ldap_nom = utf8_decode($attribute[$name]?$attribute[$name]:''); + $ldap_prenom = utf8_decode($attribute[$firstname]?$attribute[$firstname]:''); + $ldap_login = utf8_decode($attribute[$login]?$attribute[$login]:''); + $ldap_phone = utf8_decode($attribute[$phone]?$attribute[$phone]:''); + $ldap_fax = utf8_decode($attribute[$fax]?$attribute[$fax]:''); + $ldap_mobile = utf8_decode($attribute[$mobile]?$attribute[$mobile]:''); + $ldap_mail = utf8_decode($attribute[$mail]?$attribute[$mail]:''); + $ldap_SID = bin2hex($attribute[$SID]); } } }