clean code
This commit is contained in:
parent
43ac67c3d8
commit
e1ca6ef019
@ -2288,6 +2288,7 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
$datas = [];
|
$datas = [];
|
||||||
|
|
||||||
|
$nofetch = empty($params['nofetch']) ? false : true;
|
||||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
return ['optimize' => $langs->trans("ShowUser")];
|
return ['optimize' => $langs->trans("ShowUser")];
|
||||||
@ -2318,6 +2319,12 @@ class Adherent extends CommonObject
|
|||||||
$datas['email'] = '<br><b>'.$langs->trans("EMail").':</b> '.$this->email;
|
$datas['email'] = '<br><b>'.$langs->trans("EMail").':</b> '.$this->email;
|
||||||
}
|
}
|
||||||
$datas['address'] = '<br><b>'.$langs->trans("Address").':</b> '.dol_format_address($this, 1, ' ', $langs);
|
$datas['address'] = '<br><b>'.$langs->trans("Address").':</b> '.dol_format_address($this, 1, ' ', $langs);
|
||||||
|
// 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_MEMBER, 1);
|
||||||
|
}
|
||||||
$datas['divclose'] = '</div>';
|
$datas['divclose'] = '</div>';
|
||||||
|
|
||||||
return $datas;
|
return $datas;
|
||||||
@ -2353,6 +2360,7 @@ class Adherent extends CommonObject
|
|||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'objecttype' => $this->element,
|
'objecttype' => $this->element,
|
||||||
'option' => $option,
|
'option' => $option,
|
||||||
|
'nofetch' => 1,
|
||||||
];
|
];
|
||||||
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||||
$classfortooltip = 'classforajaxtooltip';
|
$classfortooltip = 'classforajaxtooltip';
|
||||||
|
|||||||
@ -1580,6 +1580,7 @@ class ActionComm extends CommonObject
|
|||||||
$langs->load('agenda');
|
$langs->load('agenda');
|
||||||
$datas = [];
|
$datas = [];
|
||||||
|
|
||||||
|
$nofetch = empty($params['nofetch']) ? false : true;
|
||||||
// Set label of type
|
// Set label of type
|
||||||
$labeltype = '';
|
$labeltype = '';
|
||||||
if ($this->type_code) {
|
if ($this->type_code) {
|
||||||
@ -1631,6 +1632,12 @@ class ActionComm extends CommonObject
|
|||||||
$datas['note'] .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '<br>', $texttoshow));
|
$datas['note'] .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '<br>', $texttoshow));
|
||||||
$datas['note'] .= '</div>';
|
$datas['note'] .= '</div>';
|
||||||
}
|
}
|
||||||
|
// 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_ACTIONCOMM, 1);
|
||||||
|
}
|
||||||
|
|
||||||
return $datas;
|
return $datas;
|
||||||
}
|
}
|
||||||
@ -1734,6 +1741,7 @@ class ActionComm extends CommonObject
|
|||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'objecttype' => $this->element,
|
'objecttype' => $this->element,
|
||||||
'option' => $option,
|
'option' => $option,
|
||||||
|
'nofetch' => 1,
|
||||||
];
|
];
|
||||||
$classfortooltip = 'classforajaxtooltip';
|
$classfortooltip = 'classforajaxtooltip';
|
||||||
$dataparams = ' data-params='.json_encode($params);
|
$dataparams = ' data-params='.json_encode($params);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user