clean code

This commit is contained in:
Frédéric FRANCE 2023-02-12 21:06:39 +01:00
parent 85a594aa61
commit f043345706

View File

@ -2612,6 +2612,7 @@ class Societe extends CommonObject
$datas = [];
$option = $params['option'] ?? '';
$nofetch = empty($params['nofetch']) ? false : true;
$name = $this->name;
if (!empty($this->name_alias) && empty($noaliasinname)) {
@ -2724,6 +2725,12 @@ class Societe extends CommonObject
if (isModEnabled('accounting') && $this->fournisseur) {
$datas['accountancysuppliercode'] = '<br><b>'.$langs->trans('SupplierAccountancyCode').':</b> '.$this->code_compta_fournisseur;
}
// show categories for this record only in ajax to not overload lists
if (isModEnabled('categorie') && !$nofetch) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$form = new Form($this->db);
$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1);
}
$datas['divclose'] = '</div>';
@ -2789,6 +2796,7 @@ class Societe extends CommonObject
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
'nofetch' => 1,
];
$classfortooltip = 'classfortooltip';
$dataparams = '';