diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
index 3458e6bc82a..528b01477a6 100644
--- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
@@ -979,25 +979,56 @@ class RemiseCheque 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 string $option Sur quoi pointe le lien
- * @return string Chaine avec URL
+ * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
+ * @param string $option Sur quoi pointe le lien
+ * @param int $notooltip 1=Disable tooltip
+ * @param string $morecss Add more css on link
+ * @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
*/
- function getNomUrl($withpicto=0,$option='')
+ function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
{
- global $langs;
+ global $conf, $langs;
$result='';
- $label = $langs->trans("ShowCheckReceipt").': '.$this->ref;
- $link = '';
+ $label = ''.$langs->trans("ShowCheckReceipt").'';
+ $label.= '
';
+ $label.= '' . $langs->trans('Ref') . ': ' . $this->ref;
+
+ $url = DOL_URL_ROOT.'/compta/paiement/cheque/card.php?id='.$this->id;
+
+ if ($option != 'nolink')
+ {
+ // Add param to save lastsearch_values or not
+ $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';
+ }
+
+ $linkclose='';
+ if (empty($notooltip))
+ {
+ if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
+ {
+ $label=$langs->trans("ShowCheckReceipt");
+ $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
+ }
+ $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
+ }
+ else $linkclose = ($morecss?' class="'.$morecss.'"':'');
+
+ $linkstart = '';
$linkend='';
- if ($withpicto) $result.=($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend);
- if ($withpicto && $withpicto != 2) $result.=' ';
- if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
+ $result .= $linkstart;
+ if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($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;
}