diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index 1cdc99633cd..cf58bb1d2c4 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -395,12 +395,18 @@ class Loan extends CommonObject $result=''; - $link = ''; - $linkend=''; + $tooltip = '' . $langs->trans("ShowLoan") . ''; + if (! empty($this->ref)) + $tooltip .= '
' . $langs->trans('Ref') . ': ' . $this->ref; + if (! empty($this->label)) + $tooltip .= '
' . $langs->trans('Label') . ': ' . $this->label; + $link = ''; + $linkend = ''; - if ($withpicto) $result.=($link.img_object($langs->trans("ShowLoan").': '.$this->label,'bill').$linkend.' '); + if ($withpicto) $result.=($link.$linkclose.img_object($langs->trans("ShowLoan").': '.$this->label,'bill', 'class="classfortooltip"').$linkend.' '); if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$link.($maxlen?dol_trunc($this->label,$maxlen):$this->label).$linkend; + if ($withpicto != 2) $result.=$link.$linkclose.($maxlen?dol_trunc($this->label,$maxlen):$this->label).$linkend; return $result; } diff --git a/htdocs/loan/index.php b/htdocs/loan/index.php index 082e5d0d0c2..924fa698364 100644 --- a/htdocs/loan/index.php +++ b/htdocs/loan/index.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2014 Alexandre Spangaro + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -117,12 +118,15 @@ if ($resql) while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); + $loan_static->id = $obj->rowid; + $loan_static->ref = $obj->rowid; + $loan_static->label = $obj->label; $var = !$var; print ""; // Ref - print ''.img_object($langs->trans("ShowLoan"),"label").' '.$obj->rowid.''; + print ''.$loan_static->getLinkUrl(1, 42).''; // Label print ''.dol_trunc($obj->label,42).''; @@ -150,4 +154,4 @@ else } llxFooter(); -$db->close(); \ No newline at end of file +$db->close();