diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 9eb67cecc56a88930c382479be79455c554dd469..7c4176edac8d843fe5bbb277a10d3feab76c3766 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3071,7 +3071,7 @@ class Commande extends CommonOrder */ function getNomUrl($withpicto=0,$option=0,$max=0,$short=0) { - global $conf, $langs; + global $conf, $langs, $user; $result=''; @@ -3081,17 +3081,29 @@ class Commande extends CommonOrder if ($short) return $url; $picto = 'order'; - $label = '<u>' . $langs->trans("ShowOrder") . '</u>'; - if (! empty($this->ref)) - $label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; - if (! empty($this->ref_client)) - $label.= '<br><b>' . $langs->trans('RefCustomer') . ':</b> ' . $this->ref_client; - if (! empty($this->total_ht)) - $label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); - if (! empty($this->total_tva)) - $label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); - if (! empty($this->total_ttc)) - $label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); + $label = ''; + + if ($user->rights->commande->lire) { + $label = '<u>'.$langs->trans("ShowOrder").'</u>'; + if (!empty($this->ref)) { + $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; + } + if (!empty($this->ref_client)) { + $label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client; + } + if (!empty($this->total_ht)) { + $label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, + $conf->currency); + } + if (!empty($this->total_tva)) { + $label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, + $conf->currency); + } + if (!empty($this->total_ttc)) { + $label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, + $conf->currency); + } + } $linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkend='</a>';