From c2590b9c7eb47d444910556b3f6966edeaa4e5c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Feb 2018 17:07:38 +0100 Subject: [PATCH] Fix: complete labels of operation if bank journal Conflicts: htdocs/compta/tva/class/tva.class.php --- htdocs/accountancy/journal/bankjournal.php | 57 +++++++++++-------- .../compta/paiement/class/paiement.class.php | 32 +++++++++-- htdocs/compta/tva/class/tva.class.php | 6 +- 3 files changed, 65 insertions(+), 30 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index fcb24f7757a..8b9215f5c4c 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -271,7 +271,8 @@ if ($result) { if ($links[$key]['type'] == 'payment') { $paymentstatic->id = $links[$key]['url_id']; - $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2); + $paymentstatic->ref = $links[$key]['url_id']; + $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this $tabpay[$obj->rowid]["paymentid"] = $paymentstatic->id; } else if ($links[$key]['type'] == 'payment_supplier') { $paymentsupplierstatic->id = $links[$key]['url_id']; @@ -320,11 +321,12 @@ if ($result) { } } else if ($links[$key]['type'] == 'payment_donation') { $paymentdonstatic->id = $links[$key]['url_id']; + $paymentdonstatic->ref = $links[$key]['url_id']; $paymentdonstatic->fk_donation = $links[$key]['url_id']; $tabpay[$obj->rowid]["lib"] .= ' ' . $paymentdonstatic->getNomUrl(2); $tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id; $tabtp[$obj->rowid][$account_pay_donation] += $obj->amount; - } else if ($links[$key]['type'] == 'payment_vat') { + } else if ($links[$key]['type'] == 'payment_vat') { // Payment VAT $paymentvatstatic->id = $links[$key]['url_id']; $paymentvatstatic->ref = $links[$key]['url_id']; $paymentvatstatic->label = $links[$key]['label']; @@ -428,11 +430,10 @@ if (! $error && $action == 'writebookkeeping') { { if ($mt) { - $reflabel = $langs->trans("Bank"); - $reflabel.= ' '.$val['bank_account_ref']; - if (! empty($val['soclib'])) { - $reflabel .= " - " . dol_string_nohtmltag($val['soclib']); - } + $reflabel = ''; + if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; + $reflabel.= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']); + if (! empty($val['soclib'])) $reflabel .= " - " . dol_string_nohtmltag($val['soclib']); $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -486,7 +487,9 @@ if (! $error && $action == 'writebookkeeping') { foreach ( $tabtp[$key] as $k => $mt ) { if ($mt) { - $reflabel = dol_string_nohtmltag($val['soclib']); + $reflabel = ''; + if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib']?" - ":""); + $reflabel.= dol_string_nohtmltag($val['soclib']); $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -586,7 +589,9 @@ if (! $error && $action == 'writebookkeeping') { foreach ( $tabbq[$key] as $k => $mt ) { if ($mt) { - $reflabel = 'WaitingAccount'; + $reflabel = ''; + if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; + $reflabel.= dol_string_nohtmltag('WaitingAccount'); $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; @@ -717,11 +722,10 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! foreach ( $tabbq[$key] as $k => $mt ) { if ($mt) { - $reflabel = $langs->trans("Bank"); - $reflabel.= ' '.$val['bank_account_ref']; - if (! empty($val['soclib'])) { - $reflabel .= " - " . dol_string_nohtmltag($val['soclib']); - } + $reflabel = ''; + if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; + $reflabel.= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']); + if (! empty($val['soclib'])) $reflabel .= " - " . dol_string_nohtmltag($val['soclib']); print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; @@ -743,7 +747,9 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! foreach ( $tabtp[$key] as $k => $mt ) { if ($mt) { - $reflabel = dol_string_nohtmltag($val['soclib']); + $reflabel = ''; + if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . ($val['soclib']?" - ":""); + $reflabel.= dol_string_nohtmltag($val['soclib']); print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; @@ -773,7 +779,9 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! foreach ( $tabbq[$key] as $k => $mt ) { if ($mt) { - $reflabel = 'WaitingAccount'; + $reflabel = ''; + if (! empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']) . " - "; + $reflabel.= dol_string_nohtmltag('WaitingAccount'); print '"' . $key . '"' . $sep; print '"' . $date . '"' . $sep; @@ -904,11 +912,10 @@ if (empty($action) || $action == 'view') { { if ($mt) { - $reflabel = $langs->trans("Bank"); - $reflabel.= ' '.$val['bank_account_ref']; - if (! empty($val['soclib'])) { - $reflabel .= " - " . $val['soclib']; - } + $reflabel = ''; + if (! empty($val['lib'])) $reflabel .= $val['lib'] . " - "; + $reflabel.= $langs->trans("Bank").' '.$val['bank_account_ref']; + if (! empty($val['soclib'])) $reflabel .= " - " . $val['soclib']; //var_dump($tabpay[$key]); print ''; @@ -949,7 +956,9 @@ if (empty($action) || $action == 'view') { foreach ( $tabtp[$key] as $k => $mt ) { if ($mt) { - $reflabel = $val['soclib']; + $reflabel = ''; + if (! empty($val['lib'])) $reflabel .= $val['lib'] . ($val['soclib']?" - ":""); + $reflabel.= $val['soclib']; print ''; print ''; @@ -1024,7 +1033,9 @@ if (empty($action) || $action == 'view') { foreach ( $tabbq[$key] as $k => $mt ) { if ($mt) { - $reflabel = 'WaitingAccount'; + $reflabel = ''; + if (! empty($val['lib'])) $reflabel .= $val['lib'] . " - "; + $reflabel.= 'WaitingAccount'; print ''; print ''; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 00ae831dc3a..fdcfc89c4e0 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -1042,12 +1042,15 @@ class Paiement extends CommonObject * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto * @param string $option Sur quoi pointe le lien * @param string $mode 'withlistofinvoices'=Include list of invoices into tooltip + * @param int $notooltip 1=Disable tooltip * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$option='',$mode='withlistofinvoices') + function getNomUrl($withpicto=0, $option='', $mode='withlistofinvoices', $notooltip=0) { global $langs; + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips + $result=''; $label = $langs->trans("ShowPayment").': '.$this->ref; if ($mode == 'withlistofinvoices') @@ -1064,12 +1067,31 @@ class Paiement extends CommonObject } } } - $link = ''; + + $linkclose=''; + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowMyObject"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } + else $linkclose = ($morecss?' class="'.$morecss.'"':''); + + $url = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$this->id; + + $linkstart = ''; $linkend=''; - if ($withpicto) $result.=($link.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$linkend); - if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$link.($this->ref?$this->ref:$this->id).$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 && $withpicto != 2) $result.= $this->ref; + $result .= $linkend; + return $result; } diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index a3fc0d319e1..689e5d8fed3 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -654,9 +654,11 @@ class Tva extends CommonObject * @param int $notooltip 1=Disable tooltip * @return string Chaine with URL */ - function getNomUrl($withpicto=0, $option='', $notooltip=0) + function getNomUrl($withpicto=0, $option='', $notooltip=0) { - global $langs; + global $langs, $conf; + + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips $result=''; $label=$langs->trans("ShowVatPayment").': '.$this->ref;