Add options on getNomUrl
This commit is contained in:
parent
1dcf02af3a
commit
8909b4111d
@ -307,7 +307,7 @@ else
|
|||||||
'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id],
|
'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id],
|
||||||
'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]),
|
'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_list'][$id]),
|
||||||
'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id],
|
'vat' =>$x_paye[$my_paye_rate]['vat_list'][$id],
|
||||||
'link' =>img_object($langs->trans("ExpenseReports"),"trip").' '.$expensereport->getNomUrl(0,32));
|
'link' =>$expensereport->getNomUrl(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1165,24 +1165,55 @@ class ExpenseReport 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 $max Max length of shown ref
|
||||||
|
* @param int $short 1=Return just URL
|
||||||
|
* @param string $moretitle Add more text to title tooltip
|
||||||
|
* @param int $notooltip 1=Disable tooltip
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
function getNomUrl($withpicto=0)
|
function getNomUrl($withpicto=0,$max=0,$short=0,$moretitle='',$notooltip=0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs, $conf;
|
||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
|
|
||||||
$link = '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?id='.$this->id.'">';
|
$url = DOL_URL_ROOT.'/expensereport/card.php?id='.$this->id;
|
||||||
$linkend='</a>';
|
|
||||||
|
if ($short) return $url;
|
||||||
|
|
||||||
$picto='trip';
|
$picto='trip';
|
||||||
|
$label = '<u>' . $langs->trans("ShowExpenseReport") . '</u>';
|
||||||
|
if (! empty($this->ref))
|
||||||
|
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||||
|
if (! empty($this->total_ht))
|
||||||
|
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
|
if (! empty($this->total_tva))
|
||||||
|
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
|
if (! empty($this->total_ttc))
|
||||||
|
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||||
|
if ($moretitle) $label.=' - '.$moretitle;
|
||||||
|
|
||||||
$label=$langs->trans("Show").': '.$this->ref;
|
$ref=$this->ref;
|
||||||
|
if (empty($ref)) $ref=$this->id;
|
||||||
|
|
||||||
if ($withpicto) $result.=($link.img_object($label,$picto).$linkend);
|
$linkclose='';
|
||||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
if (empty($notooltip))
|
||||||
if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
|
{
|
||||||
|
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||||
|
{
|
||||||
|
$label=$langs->trans("ShowExpenseReport");
|
||||||
|
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
}
|
||||||
|
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
|
$linkclose.=' class="classfortooltip"';
|
||||||
|
}
|
||||||
|
|
||||||
|
$linkstart = '<a href="'.$url.'"';
|
||||||
|
$linkstart.=$linkclose.'>';
|
||||||
|
$linkend='</a>';
|
||||||
|
|
||||||
|
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend.' ');
|
||||||
|
$result.=$linkstart.($max?dol_trunc($ref,$max):$ref).$linkend;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
# Dolibarr language file - Source file is en_US - trips
|
# Dolibarr language file - Source file is en_US - trips
|
||||||
ExpenseReport=Expense report
|
ExpenseReport=Expense report
|
||||||
ExpenseReports=Expense reports
|
ExpenseReports=Expense reports
|
||||||
|
ShowExpenseReport=Show expense report
|
||||||
Trips=Expense reports
|
Trips=Expense reports
|
||||||
TripsAndExpenses=Expenses reports
|
TripsAndExpenses=Expenses reports
|
||||||
TripsAndExpensesStatistics=Expense reports statistics
|
TripsAndExpensesStatistics=Expense reports statistics
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user