FIX #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them

This commit is contained in:
Marcos García de La Fuente 2016-11-09 11:28:05 +01:00
parent 75cc6bcf75
commit 0b594eab59

View File

@ -2734,20 +2734,31 @@ class Propal extends CommonObject
*/ */
function getNomUrl($withpicto=0,$option='', $get_params='') function getNomUrl($withpicto=0,$option='', $get_params='')
{ {
global $langs, $conf; global $langs, $conf, $user;
$result=''; $result='';
$label = '<u>' . $langs->trans("ShowPropal") . '</u>'; $label = '';
if (! empty($this->ref))
if ($user->rights->propal->lire) {
$label .= '<u>'.$langs->trans("ShowPropal").'</u>';
if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
if (! empty($this->ref_client)) }
if (!empty($this->ref_client)) {
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$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_ht)) {
if (! empty($this->total_tva)) $label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1,
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); $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); 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);
}
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == '') { if ($option == '') {
$link = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id.$get_params.$linkclose; $link = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id.$get_params.$linkclose;
@ -2762,6 +2773,7 @@ class Propal extends CommonObject
$link = '<a href="'.DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id.$get_params.$linkclose; $link = '<a href="'.DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id.$get_params.$linkclose;
} }
$linkend = '</a>'; $linkend = '</a>';
}
$picto='propal'; $picto='propal';