5'@phan-var-force DolibarrModules $this';
8if (empty($keyforclass) || empty($keyforclassfile) || empty($keyforelement) || empty($r)) {
10 dol_print_error(
null,
'include of file commonfieldsinimport.inc.php was done but var $keyforclass or $keyforclassfile or $keyforelement or $r was not set');
13if (empty($keyforalias)) {
18if (class_exists($keyforclass)) {
20 $tmpobject =
new $keyforclass($this->db);
21 '@phan-var-force CommonObject $tmpobject';
24 foreach ($tmpobject->fields as $keyfield => $valuefield) {
25 $fieldname = $keyforalias.
'.'.$keyfield;
26 $fieldlabel = ucfirst($valuefield[
'label']);
28 $typefield = preg_replace(
'/\(.*$/',
'', $valuefield[
'type']);
34 $typeFilter =
"Numeric";
42 $typeFilter =
"Boolean";
57 if (!empty($valuefield[
'help'])) {
58 $helpfield = preg_replace(
'/\(.*$/',
'', $valuefield[
'help']);
60 if ($valuefield[
'enabled']) {
61 $this->import_fields_array[$r][$fieldname] = $fieldlabel;
62 $this->import_TypeFields_array[$r][$fieldname] = $typeFilter;
63 $this->import_entities_array[$r][$fieldname] = $keyforelement;
64 $this->import_help_array[$r][$fieldname] = $helpfield;
68 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...