2'@phan-var-force DolibarrModules $this';
4if (empty($keyforclass) || empty($keyforclassfile) || empty($keyforelement)) {
6 dol_print_error(
null,
'include of file commonfieldsinexport.inc.php was done but var $keyforclass or $keyforclassfile or $keyforelement was not set');
9if (empty($keyforalias)) {
14if (class_exists($keyforclass)) {
15 $tmpobject =
new $keyforclass($this->db);
18 foreach ($tmpobject->fields as $keyfield => $valuefield) {
19 $fieldname = $keyforalias.
'.'.$keyfield;
20 $fieldlabel = ucfirst($valuefield[
'label']);
22 $typefield = preg_replace(
'/\(.*$/',
'', $valuefield[
'type']);
28 $typeFilter =
"Numeric";
36 $typeFilter =
"Boolean";
51 if (!empty($valuefield[
'help'])) {
52 $helpfield = preg_replace(
'/\(.*$/',
'', $valuefield[
'help']);
54 if ($valuefield[
'enabled']) {
55 $this->export_fields_array[$r][$fieldname] = $fieldlabel;
56 $this->export_TypeFields_array[$r][$fieldname] = $typeFilter;
57 $this->export_entities_array[$r][$fieldname] = $keyforelement;
58 $this->export_help_array[$r][$fieldname] = $helpfield;
62 dol_print_error($this->db,
'Failed to find class '.$keyforclass.
', even after the include of '.$keyforclassfile);
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...