add categories in warehouse ajax tooltip
This commit is contained in:
parent
60385ea6ca
commit
fbcab33519
@ -708,6 +708,10 @@ class Entrepot extends CommonObject
|
|||||||
$langs->load('stocks');
|
$langs->load('stocks');
|
||||||
|
|
||||||
$datas = [];
|
$datas = [];
|
||||||
|
|
||||||
|
$option = $params['option'] ?? '';
|
||||||
|
$nofetch = !empty($params['nofetch']);
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
return ['optimize' => $langs->trans("Warehouse")];
|
return ['optimize' => $langs->trans("Warehouse")];
|
||||||
}
|
}
|
||||||
@ -719,6 +723,12 @@ class Entrepot extends CommonObject
|
|||||||
if (!empty($this->lieu)) {
|
if (!empty($this->lieu)) {
|
||||||
$datas['locationsummary'] = '<br><b>'.$langs->trans('LocationSummary').':</b> '.$this->lieu;
|
$datas['locationsummary'] = '<br><b>'.$langs->trans('LocationSummary').':</b> '.$this->lieu;
|
||||||
}
|
}
|
||||||
|
// show categories for this record only in ajax to not overload lists
|
||||||
|
if (!$nofetch && isModEnabled('categorie')) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
|
||||||
|
$form = new Form($this->db);
|
||||||
|
$datas['categories_warehouse'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_WAREHOUSE, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
return $datas;
|
return $datas;
|
||||||
}
|
}
|
||||||
@ -752,13 +762,14 @@ class Entrepot extends CommonObject
|
|||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'objecttype' => $this->element,
|
'objecttype' => $this->element,
|
||||||
'option' => $option,
|
'option' => $option,
|
||||||
|
'nofetch' => 1,
|
||||||
];
|
];
|
||||||
$classfortooltip = 'classfortooltip';
|
$classfortooltip = 'classfortooltip';
|
||||||
$dataparams = '';
|
$dataparams = '';
|
||||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||||
$classfortooltip = 'classforajaxtooltip';
|
$classfortooltip = 'classforajaxtooltip';
|
||||||
$dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"';
|
$dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"';
|
||||||
$label = '';
|
$label = 'ToComplete';
|
||||||
} else {
|
} else {
|
||||||
$label = implode($this->getTooltipContentArray($params));
|
$label = implode($this->getTooltipContentArray($params));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user