2'@phan-var-force DolibarrModules $this';
4if (empty($keyforclass) || empty($keyforclassfile) || empty($keyforelement)) {
6 dol_print_error(
null,
'include of file commonfieldsinimport.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->import_fields_array[$r][$fieldname] = $fieldlabel;
56 $this->import_TypeFields_array[$r][$fieldname] = $typeFilter;
57 $this->import_entities_array[$r][$fieldname] = $keyforelement;
58 $this->import_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...