4'@phan-var-force DolibarrModules $this';
7if (empty($keyforclass) || empty($keyforclassfile) || empty($keyforelement)) {
9 dol_print_error(
null,
'include of file commonfieldsinimport.inc.php was done but var $keyforclass or $keyforclassfile or $keyforelement was not set');
12if (empty($keyforalias)) {
17if (class_exists($keyforclass)) {
19 $tmpobject =
new $keyforclass($this->db);
20 '@phan-var-force CommonObject $tmpobject';
23 foreach ($tmpobject->fields as $keyfield => $valuefield) {
24 $fieldname = $keyforalias.
'.'.$keyfield;
25 $fieldlabel = ucfirst($valuefield[
'label']);
27 $typefield = preg_replace(
'/\(.*$/',
'', $valuefield[
'type']);
33 $typeFilter =
"Numeric";
41 $typeFilter =
"Boolean";
56 if (!empty($valuefield[
'help'])) {
57 $helpfield = preg_replace(
'/\(.*$/',
'', $valuefield[
'help']);
59 if ($valuefield[
'enabled']) {
60 $this->import_fields_array[$r][$fieldname] = $fieldlabel;
61 $this->import_TypeFields_array[$r][$fieldname] = $typeFilter;
62 $this->import_entities_array[$r][$fieldname] = $keyforelement;
63 $this->import_help_array[$r][$fieldname] = $helpfield;
67 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...