diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 347fd606815..27a44269110 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -307,7 +307,7 @@ else 'ddate_end' =>$x_paye[$my_paye_rate]['ddate_end'][$id], 'totalht' =>price2num($x_paye[$my_paye_rate]['totalht_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 { diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 8a49983eccf..f65f0119a85 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -1164,25 +1164,56 @@ class ExpenseReport extends CommonObject /** * Return clicable name (with picto eventually) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @return string String with URL + * @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 */ - function getNomUrl($withpicto=0) + function getNomUrl($withpicto=0,$max=0,$short=0,$moretitle='',$notooltip=0) { - global $langs; + global $langs, $conf; $result=''; - $link = ''; - $linkend=''; + $url = DOL_URL_ROOT.'/expensereport/card.php?id='.$this->id; + + if ($short) return $url; $picto='trip'; + $label = '' . $langs->trans("ShowExpenseReport") . ''; + if (! empty($this->ref)) + $label .= '
' . $langs->trans('Ref') . ': ' . $this->ref; + if (! empty($this->total_ht)) + $label.= '
' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_tva)) + $label.= '
' . $langs->trans('VAT') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_ttc)) + $label.= '
' . $langs->trans('AmountTTC') . ': ' . 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); - if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$link.$this->ref.$linkend; + $linkclose=''; + if (empty($notooltip)) + { + 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 = ''; + $linkend=''; + + 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; } diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index 6a12588139d..900b424f3e7 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -1,6 +1,7 @@ # Dolibarr language file - Source file is en_US - trips ExpenseReport=Expense report ExpenseReports=Expense reports +ShowExpenseReport=Show expense report Trips=Expense reports TripsAndExpenses=Expenses reports TripsAndExpensesStatistics=Expense reports statistics