diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 67e27610c42..34a5aded138 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -2239,10 +2239,10 @@ class Form
/**
* Show a form to select a project
*
- * @param page Page
- * @param socid Id societe
- * @param selected Id projet pre-selectionne
- * @param htmlname Nom du formulaire select
+ * @param int $page Page
+ * @param int $socid Id third party
+ * @param int $selected Id pre-selected project
+ * @param string $htmlname Name of select field
* @return void
*/
function form_project($page, $socid, $selected='', $htmlname='projectid')
@@ -2267,12 +2267,15 @@ class Form
}
else
{
- if ($selected) {
+ if ($selected)
+ {
$projet = new Project($this->db);
$projet->fetch($selected);
//print ''.$projet->title.'';
- print $projet->getNomUrl(0);
- } else {
+ print $projet->getNomUrl(0,'',1);
+ }
+ else
+ {
print " ";
}
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index b12edb2fb37..4583e20a4a5 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -634,10 +634,11 @@ class Project extends CommonObject
* Renvoie nom clicable (avec eventuellement le picto)
*
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
- * @param string $option Variante ('', 'nolink')
+ * @param string $option Variant ('', 'nolink')
+ * @param int $addlabel 0=Default, 1=Add label into string
* @return string Chaine avec URL
*/
- function getNomUrl($withpicto=0,$option='')
+ function getNomUrl($withpicto=0,$option='',$addlabel=0)
{
global $langs;
@@ -658,7 +659,7 @@ class Project extends CommonObject
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
- if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
+ if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin.(($addlabel && $this->title)?' - '.$this->title:'');
return $result;
}