Fix: Avoid duplicate tooltip
This commit is contained in:
parent
dd48942f1d
commit
1efa5bcabd
@ -631,17 +631,19 @@ class ProductFournisseur extends Product
|
|||||||
/**
|
/**
|
||||||
* Display supplier of product
|
* Display supplier of product
|
||||||
*
|
*
|
||||||
* @param int $withpicto Add picto
|
* @param int $withpicto Add picto
|
||||||
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
|
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
|
||||||
* @return string String with supplier price
|
* @param int $maxlen Max length of name
|
||||||
|
* @param integer $notooltip 1=Disable tooltip
|
||||||
|
* @return string String with supplier price
|
||||||
* TODO Remove this method. Use getNomUrl directly.
|
* TODO Remove this method. Use getNomUrl directly.
|
||||||
*/
|
*/
|
||||||
function getSocNomUrl($withpicto=0,$option='supplier')
|
function getSocNomUrl($withpicto=0,$option='supplier',$maxlen=0,$notooltip=0)
|
||||||
{
|
{
|
||||||
$thirdparty = new Fournisseur($this->db);
|
$thirdparty = new Fournisseur($this->db);
|
||||||
$thirdparty->fetch($this->fourn_id);
|
$thirdparty->fetch($this->fourn_id);
|
||||||
|
|
||||||
return $thirdparty->getNomUrl($withpicto,$option);
|
return $thirdparty->getNomUrl($withpicto,$option,$maxlen,$notooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -649,13 +651,15 @@ class ProductFournisseur extends Product
|
|||||||
*
|
*
|
||||||
* @param int $showunitprice Show "Unit price" into output string
|
* @param int $showunitprice Show "Unit price" into output string
|
||||||
* @param int $showsuptitle Show "Supplier" into output string
|
* @param int $showsuptitle Show "Supplier" into output string
|
||||||
|
* @param int $maxlen Max length of name
|
||||||
|
* @param integer $notooltip 1=Disable tooltip
|
||||||
* @return string String with supplier price
|
* @return string String with supplier price
|
||||||
*/
|
*/
|
||||||
function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1)
|
function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
$out=($showunitprice?price($this->fourn_unitprice).' '.$langs->trans("HT").' (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier').' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
|
$out=($showunitprice?price($this->fourn_unitprice).' '.$langs->trans("HT").' (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -476,8 +476,11 @@ else
|
|||||||
{
|
{
|
||||||
if ($product_fourn->product_fourn_price_id > 0)
|
if ($product_fourn->product_fourn_price_id > 0)
|
||||||
{
|
{
|
||||||
$htmltext=$product_fourn->display_price_product_fournisseur();
|
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
|
||||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext);
|
{
|
||||||
|
$htmltext=$product_fourn->display_price_product_fournisseur(1, 1, 0, 1);
|
||||||
|
print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext);
|
||||||
|
}
|
||||||
else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT");
|
else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1727,7 +1727,7 @@ class Societe extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only)
|
* @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only)
|
||||||
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
|
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
|
||||||
* @param int $maxlen Max length of text
|
* @param int $maxlen Max length of name
|
||||||
* @param integer $notooltip 1=Disable tooltip
|
* @param integer $notooltip 1=Disable tooltip
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user