diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php
index fc1c8d017cd..2f7d31625d9 100644
--- a/htdocs/contact.class.php
+++ b/htdocs/contact.class.php
@@ -775,6 +775,7 @@ class Contact
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowContact"),'contact').$lienfin.' ');
$result.=$lien.$this->name.' '.$this->firstname.$lienfin;
return $result;
- }
+ }
+
}
?>
diff --git a/htdocs/user.class.php b/htdocs/user.class.php
index f8ea10d1448..291df1f3750 100644
--- a/htdocs/user.class.php
+++ b/htdocs/user.class.php
@@ -98,10 +98,11 @@ class User
}
- /**
- * \brief Charge un objet user avec toutes ces caractéristiques depuis un id ou login
- * \param login Si défini, login a utiliser pour recherche
- */
+ /**
+ * \brief Charge un objet user avec toutes ces caractéristiques depuis un id ou login
+ * \param login Si défini, login a utiliser pour recherche
+ * \return int <0 si ko, >0 si ok
+ */
function fetch($login='')
{
// Recupere utilisateur
@@ -163,7 +164,8 @@ class User
}
else
{
- dolibarr_print_error($this->db);
+ $this->error=$this->db->error();
+ return -1;
}
// Recupere parametrage global propre à l'utilisateur
@@ -187,7 +189,8 @@ class User
}
else
{
- dolibarr_print_error($this->db);
+ $this->error=$this->db->error();
+ return -1;
}
// Recupere parametrage propre à la page et à l'utilisateur
@@ -217,9 +220,12 @@ class User
}
else
{
- dolibarr_print_error($this->db);
+ $this->error=$this->db->error();
+ return -1;
}
}
+
+ return 1;
}
/**
@@ -1083,7 +1089,33 @@ class User
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowUser"),'user').$lienfin.' ');
$result.=$lien.$this->nom.' '.$this->prenom.$lienfin;
return $result;
- }
+ }
+
+ /**
+ * \brief Renvoie login clicable (avec eventuellement le picto)
+ * \param withpicto Inclut le picto dans le lien
+ * \param option Sur quoi pointe le lien
+ * \return string Chaine avec URL
+ */
+ function getLoginUrl($withpicto=0,$option='')
+ {
+ global $langs;
+
+ $result='';
+
+ $lien = '';
+ $lienfin='';
+
+ if ($option == 'xxx')
+ {
+ $lien = '';
+ $lienfin='';
+ }
+
+ if ($withpicto) $result.=($lien.img_object($langs->trans("ShowUser"),'user').$lienfin.' ');
+ $result.=$lien.$this->login.$lienfin;
+ return $result;
+ }
}
?>
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index c9c3ae6897f..9785fda1777 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -1196,7 +1196,7 @@ else
if ($conf->fckeditor->enabled)
{
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
- $doleditor=new DolEditor('note','',180,'dolibarr_notes','',false);
+ $doleditor=new DolEditor('note',$fuser->note,180,'dolibarr_notes','',false);
$doleditor->Create();
}
else