From 648b2506abd78e7708df22e956fb3d0edfa2059a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 4 May 2019 11:45:31 +0200 Subject: [PATCH] FIX visible ref on contract link for old contract without ref --- htdocs/contrat/class/contrat.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9bd2d022ace..316983a5d0a 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1939,7 +1939,7 @@ class Contrat extends CommonObject if ($user->rights->contrat->lire) { $label = ''.$langs->trans("ShowContract").''; - $label .= '
'.$langs->trans('Ref').': '.$this->ref; + $label .= '
'.$langs->trans('Ref').': '.($this->ref?$this->ref:$this->id); $label .= '
'.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client); $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier; if (!empty($this->total_ht)) { @@ -1971,7 +1971,7 @@ class Contrat extends CommonObject $result .= $linkstart; if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); - if ($withpicto != 2) $result.= $this->ref; + if ($withpicto != 2) $result.= ($this->ref?$this->ref:$this->id); $result .= $linkend; return $result;