Fix bad param of getNomUrl
This commit is contained in:
parent
949ef8d7d8
commit
91f87d6834
@ -672,27 +672,27 @@ if (!empty($date_start) && !empty($date_stop))
|
|||||||
} elseif ($data['item'] == 'ExpenseReport') {
|
} elseif ($data['item'] == 'ExpenseReport') {
|
||||||
$expensereport->id = $data['id'];
|
$expensereport->id = $data['id'];
|
||||||
$expensereport->ref = $data['ref'];
|
$expensereport->ref = $data['ref'];
|
||||||
print $expensereport->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
|
print $expensereport->getNomUrl(1, 0, 0, '', 0, 0);
|
||||||
} elseif ($data['item'] == 'SalaryPayment') {
|
} elseif ($data['item'] == 'SalaryPayment') {
|
||||||
$salary_payment->id = $data['id'];
|
$salary_payment->id = $data['id'];
|
||||||
$salary_payment->ref = $data['ref'];
|
$salary_payment->ref = $data['ref'];
|
||||||
print $salary_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
|
print $salary_payment->getNomUrl(1, '', 0, '', 0);
|
||||||
} elseif ($data['item'] == 'Donation') {
|
} elseif ($data['item'] == 'Donation') {
|
||||||
$don->id = $data['id'];
|
$don->id = $data['id'];
|
||||||
$don->ref = $data['ref'];
|
$don->ref = $data['ref'];
|
||||||
print $don->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
|
print $don->getNomUrl(1, 0, '', 0);
|
||||||
} elseif ($data['item'] == 'SocialContributions') {
|
} elseif ($data['item'] == 'SocialContributions') {
|
||||||
$charge_sociales->id = $data['id'];
|
$charge_sociales->id = $data['id'];
|
||||||
$charge_sociales->ref = $data['ref'];
|
$charge_sociales->ref = $data['ref'];
|
||||||
print $charge_sociales->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
|
print $charge_sociales->getNomUrl(1, 0, 0, 0, 0);
|
||||||
} elseif ($data['item'] == 'VariousPayment') {
|
} elseif ($data['item'] == 'VariousPayment') {
|
||||||
$various_payment->id = $data['id'];
|
$various_payment->id = $data['id'];
|
||||||
$various_payment->ref = $data['ref'];
|
$various_payment->ref = $data['ref'];
|
||||||
print $various_payment->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
|
print $various_payment->getNomUrl(1, '', 0, 0);
|
||||||
} elseif ($data['item'] == 'LoanPayment') {
|
} elseif ($data['item'] == 'LoanPayment') {
|
||||||
$payment_loan->id = $data['id'];
|
$payment_loan->id = $data['id'];
|
||||||
$payment_loan->ref = $data['ref'];
|
$payment_loan->ref = $data['ref'];
|
||||||
print $payment_loan->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
|
print $payment_loan->getNomUrl(1, 0, 0, '', 0);
|
||||||
} else {
|
} else {
|
||||||
print $data['ref'];
|
print $data['ref'];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -916,11 +916,13 @@ class Don extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Return clicable name (with picto eventually)
|
* Return clicable name (with picto eventually)
|
||||||
*
|
*
|
||||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||||
* @param int $notooltip 1=Disable tooltip
|
* @param int $notooltip 1=Disable tooltip
|
||||||
* @return string Chaine avec URL
|
* @param string $moretitle Add more text to title tooltip
|
||||||
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
|
* @return string Chaine avec URL
|
||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0, $notooltip = 0)
|
public function getNomUrl($withpicto = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@ -928,10 +930,18 @@ class Don extends CommonObject
|
|||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
$label = '<u>'.$langs->trans("Donation").'</u>';
|
$label = '<u>'.$langs->trans("Donation").'</u>';
|
||||||
if (!empty($this->id))
|
if (!empty($this->id)) {
|
||||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->id;
|
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->id;
|
||||||
|
}
|
||||||
|
if ($moretitle) $label .= ' - '.$moretitle;
|
||||||
|
|
||||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/don/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
$url = DOL_URL_ROOT.'/don/card.php?id='.$this->id;
|
||||||
|
|
||||||
|
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||||
|
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
|
||||||
|
if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
|
||||||
|
|
||||||
|
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||||
$linkend = '</a>';
|
$linkend = '</a>';
|
||||||
|
|
||||||
$result .= $linkstart;
|
$result .= $linkstart;
|
||||||
|
|||||||
@ -507,25 +507,39 @@ class PaymentLoan extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Return clicable name (with eventually a picto)
|
* Return clicable name (with eventually a picto)
|
||||||
*
|
*
|
||||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=No picto
|
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=No picto
|
||||||
* @param int $maxlen Max length label
|
* @param int $maxlen Max length label
|
||||||
* @return string Chaine with URL
|
* @param int $notooltip 1=Disable tooltip
|
||||||
|
* @param string $moretitle Add more text to title tooltip
|
||||||
|
* @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
|
||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0, $maxlen = 0)
|
public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $moretitle = '', $save_lastsearch_value = -1)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs, $conf;
|
||||||
|
|
||||||
|
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
|
$label = '<u>'.$langs->trans("Loan").'</u>';
|
||||||
if (!empty($this->id))
|
if (!empty($this->id)) {
|
||||||
{
|
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->id;
|
||||||
$link = '<a href="'.DOL_URL_ROOT.'/loan/payment/card.php?id='.$this->id.'">';
|
|
||||||
$linkend = '</a>';
|
|
||||||
|
|
||||||
if ($withpicto) $result .= ($link.img_object($langs->trans("ShowPayment").': '.$this->ref, 'payment').$linkend.' ');
|
|
||||||
if ($withpicto && $withpicto != 2) $result .= ' ';
|
|
||||||
if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
|
|
||||||
}
|
}
|
||||||
|
if ($moretitle) $label .= ' - '.$moretitle;
|
||||||
|
|
||||||
|
$url = DOL_URL_ROOT.'/loan/payment/card.php?id='.$this->id;
|
||||||
|
|
||||||
|
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||||
|
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
|
||||||
|
if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
|
||||||
|
|
||||||
|
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||||
|
$linkend = '</a>';
|
||||||
|
|
||||||
|
$result .= $linkstart;
|
||||||
|
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||||
|
if ($withpicto != 2) $result .= $this->ref;
|
||||||
|
$result .= $linkend;
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user