3if (empty($keyforclass) || empty($keyforclassfile) || empty($keyforelement)) {
5 dol_print_error(
'',
'include of file commonfieldsinimport.inc.php was done but var $keyforclass or $keyforclassfile or $keyforelement was not set');
8if (empty($keyforalias)) {
13if (class_exists($keyforclass)) {
14 $tmpobject =
new $keyforclass($this->db);
17 foreach ($tmpobject->fields as $keyfield => $valuefield) {
18 $fieldname = $keyforalias.
'.'.$keyfield;
19 $fieldlabel = ucfirst($valuefield[
'label']);
21 $typefield = preg_replace(
'/\(.*$/',
'', $valuefield[
'type']);
27 $typeFilter =
"Numeric";
35 $typeFilter =
"Boolean";
50 if (!empty($valuefield[
'help'])) {
51 $helpfield = preg_replace(
'/\(.*$/',
'', $valuefield[
'help']);
53 if ($valuefield[
'enabled']) {
54 $this->import_fields_array[$r][$fieldname] = $fieldlabel;
55 $this->import_TypeFields_array[$r][$fieldname] = $typeFilter;
56 $this->import_entities_array[$r][$fieldname] = $keyforelement;
57 $this->import_help_array[$r][$fieldname] = $helpfield;
61 dol_print_error($this->db,
'Failed to find class '.$keyforclass.
', even after the include of '.$keyforclassfile);
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.