mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
add ajax tooltip on supplier_order
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2022 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2021 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
@@ -818,6 +818,49 @@ class CommandeFournisseur extends CommonOrder
|
||||
return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* getTooltipContentArray
|
||||
*
|
||||
* @param array $params ex option, infologin
|
||||
* @since v18
|
||||
* @return array
|
||||
*/
|
||||
public function getTooltipContentArray($params)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
|
||||
$langs->loadLangs(['bills', 'orders']);
|
||||
|
||||
$datas = [];
|
||||
if ($user->hasRight("fournisseur", "commande", "read")) {
|
||||
$datas['picto'] = '<u class="paddingrightonly">'.$langs->trans("SupplierOrder").'</u>';
|
||||
if (isset($this->statut)) {
|
||||
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||
}
|
||||
if (!empty($this->ref)) {
|
||||
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
}
|
||||
if (!empty($this->ref_supplier)) {
|
||||
$datas['refsupplier'] = '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier;
|
||||
}
|
||||
if (!empty($this->total_ht)) {
|
||||
$datas['totalht'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
if (!empty($this->total_tva)) {
|
||||
$datas['totaltva'] = '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
if (!empty($this->total_ttc)) {
|
||||
$datas['totalttc'] = '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
}
|
||||
if (!empty($this->date)) {
|
||||
$datas['date'] = '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->date, 'day');
|
||||
}
|
||||
if (!empty($this->delivery_date)) {
|
||||
$datas['deliverydate'] = '<br><b>'.$langs->trans('DeliveryDate').':</b> '.dol_print_date($this->delivery_date, 'dayhour');
|
||||
}
|
||||
}
|
||||
return $datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
@@ -880,13 +923,25 @@ class CommandeFournisseur extends CommonOrder
|
||||
}
|
||||
|
||||
$linkclose = '';
|
||||
$classfortooltip = 'classfortooltip';
|
||||
$dataparams = '';
|
||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||
$params = [
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option' => $option,
|
||||
];
|
||||
$classfortooltip = 'classforajaxtooltip';
|
||||
$dataparams = ' data-params='.json_encode($params);
|
||||
$label = $langs->trans('Loading');
|
||||
}
|
||||
if (empty($notooltip)) {
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$label = $langs->trans("ShowOrder");
|
||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' class="classfortooltip"';
|
||||
$linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose .= ' class="'.$classfortooltip.'"';
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
@@ -895,7 +950,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
$result .= $linkstart;
|
||||
if ($withpicto) {
|
||||
$result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||
$result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1);
|
||||
}
|
||||
if ($withpicto != 2) {
|
||||
$result .= $this->ref;
|
||||
|
||||
Reference in New Issue
Block a user