FIX #5549 getNomUrl tooltips show Order info even if user has no rights to read them

This commit is contained in:
Marcos García de La Fuente 2016-07-26 17:07:56 +02:00
parent fc1c38420c
commit 1ef27913d7

View File

@ -3081,17 +3081,29 @@ class Commande extends CommonOrder
if ($short) return $url; if ($short) return $url;
$picto = 'order'; $picto = 'order';
$label = '<u>' . $langs->trans("ShowOrder") . '</u>'; $label = '';
if (! empty($this->ref))
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref; if ($user->rights->commande->lire) {
if (! empty($this->ref_client)) $label = '<u>'.$langs->trans("ShowOrder").'</u>';
$label.= '<br><b>' . $langs->trans('RefCustomer') . ':</b> ' . $this->ref_client; if (!empty($this->ref)) {
if (! empty($this->total_ht)) $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); }
if (! empty($this->total_tva)) if (!empty($this->ref_client)) {
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
if (! empty($this->total_ttc)) }
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); 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">'; $linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>'; $linkend='</a>';