Fix bug reported by scrutinizer

This commit is contained in:
Laurent Destailleur 2017-07-08 19:05:51 +02:00
parent 00e1fab1af
commit 8a9c38114f

View File

@ -3372,14 +3372,14 @@ class Commande extends CommonOrder
* Return clicable link of object (with eventually picto) * Return clicable link of object (with eventually picto)
* *
* @param int $withpicto Add picto into link * @param int $withpicto Add picto into link
* @param int $option Where point the link (0=> main card, 1,2 => shipment) * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param int $max Max length to show * @param int $max Max length to show
* @param int $short ??? * @param int $short ???
* @param int $notooltip 1=Disable tooltip * @param int $notooltip 1=Disable tooltip
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL * @return string String with URL
*/ */
function getNomUrl($withpicto=0, $option=0, $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1) function getNomUrl($withpicto=0, $option='', $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1)
{ {
global $conf, $langs, $user; global $conf, $langs, $user;
@ -3387,7 +3387,7 @@ class Commande extends CommonOrder
$result=''; $result='';
if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; if (! empty($conf->expedition->enabled) && ($option == '1' || $option == '2')) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id;
else $url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id; else $url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id;
if ($option !== 'nolink') if ($option !== 'nolink')