diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 78f5bac2fe7..1e6c675d6fe 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -1047,76 +1047,79 @@ class Project extends CommonObject
if ($option != 'nolink') $label = ''.$langs->trans("ShowProject").'';
$label .= ($label ? '
' : '').''.$langs->trans('Ref').': '.$this->ref; // The space must be after the : to not being explode when showing the title in img_picto
$label .= ($label ? '
' : '').''.$langs->trans('Label').': '.$this->title; // The space must be after the : to not being explode when showing the title in img_picto
- if (!empty($this->thirdparty_name))
+ if (!empty($this->thirdparty_name)) {
$label .= ($label ? '
' : '').''.$langs->trans('ThirdParty').': '.$this->thirdparty_name; // The space must be after the : to not being explode when showing the title in img_picto
- if (!empty($this->dateo))
- $label .= ($label ? '
' : '').''.$langs->trans('DateStart').': '.dol_print_date($this->dateo, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
- if (!empty($this->datee))
- $label .= ($label ? '
' : '').''.$langs->trans('DateEnd').': '.dol_print_date($this->datee, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
- if ($moreinpopup) $label .= '
'.$moreinpopup;
+ }
+ if (!empty($this->dateo)) {
+ $label .= ($label ? '
' : '').''.$langs->trans('DateStart').': '.dol_print_date($this->dateo, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
+ }
+ if (!empty($this->datee)) {
+ $label .= ($label ? '
' : '').''.$langs->trans('DateEnd').': '.dol_print_date($this->datee, 'day'); // The space must be after the : to not being explode when showing the title in img_picto
+ }
+ if ($moreinpopup) $label .= '
'.$moreinpopup;
- $url = '';
- if ($option != 'nolink')
- {
- if (preg_match('/\.php$/', $option)) {
- $url = dol_buildpath($option, 1).'?id='.$this->id;
- }
- elseif ($option == 'task')
- {
- $url = DOL_URL_ROOT.'/projet/tasks.php?id='.$this->id;
- }
- else
- {
- $url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id;
- }
- // Add param to save lastsearch_values or not
- $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
- if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
- if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
- }
+ $url = '';
+ if ($option != 'nolink')
+ {
+ if (preg_match('/\.php$/', $option)) {
+ $url = dol_buildpath($option, 1).'?id='.$this->id;
+ }
+ elseif ($option == 'task')
+ {
+ $url = DOL_URL_ROOT.'/projet/tasks.php?id='.$this->id;
+ }
+ else
+ {
+ $url = DOL_URL_ROOT.'/projet/card.php?id='.$this->id;
+ }
+ // Add param to save lastsearch_values or not
+ $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
+ if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
+ if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
+ }
- $linkclose = '';
- if (empty($notooltip) && $user->rights->projet->lire)
- {
- if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
- {
- $label = $langs->trans("ShowProject");
- $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
- }
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
- $linkclose .= ' class="classfortooltip"';
+ $linkclose = '';
+ if (empty($notooltip) && $user->rights->projet->lire)
+ {
+ if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
+ {
+ $label = $langs->trans("ShowProject");
+ $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
+ }
+ $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose .= ' class="classfortooltip"';
- /*
- $hookmanager->initHooks(array('projectdao'));
- $parameters=array('id'=>$this->id);
- // Note that $action and $object may have been modified by some hooks
- $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action);
- if ($reshook > 0)
- $linkclose = $hookmanager->resPrint;
- */
- }
+ /*
+ $hookmanager->initHooks(array('projectdao'));
+ $parameters=array('id'=>$this->id);
+ // Note that $action and $object may have been modified by some hooks
+ $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action);
+ if ($reshook > 0)
+ $linkclose = $hookmanager->resPrint;
+ */
+ }
- $picto = 'projectpub';
- if (!$this->public) $picto = 'project';
+ $picto = 'projectpub';
+ if (!$this->public) $picto = 'project';
- $linkstart = '';
- $linkend = '';
+ $linkstart = '';
+ $linkend = '';
- $result .= $linkstart;
- if ($withpicto) $result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
- if ($withpicto != 2) $result .= $this->ref;
- $result .= $linkend;
- if ($withpicto != 2) $result .= (($addlabel && $this->title) ? $sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)) : '');
+ $result .= $linkstart;
+ if ($withpicto) $result .= img_object(($notooltip ? '' : $label), $picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
+ if ($withpicto != 2) $result .= $this->ref;
+ $result .= $linkend;
+ if ($withpicto != 2) $result .= (($addlabel && $this->title) ? $sep.dol_trunc($this->title, ($addlabel > 1 ? $addlabel : 0)) : '');
- global $action;
- $hookmanager->initHooks(array('projectdao'));
- $parameters = array('id'=>$this->id, 'getnomurl'=>$result);
- $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
- if ($reshook > 0) $result = $hookmanager->resPrint;
- else $result .= $hookmanager->resPrint;
+ global $action;
+ $hookmanager->initHooks(array('projectdao'));
+ $parameters = array('id'=>$this->id, 'getnomurl'=>$result);
+ $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
+ if ($reshook > 0) $result = $hookmanager->resPrint;
+ else $result .= $hookmanager->resPrint;
- return $result;
+ return $result;
}
/**