5@phan-var-force DolibarrModules $this
9if (empty($keyforclass) || empty($keyforclassfile) || empty($keyforelement)) {
11 dol_print_error(
null,
'include of file commonfieldsinexport.inc.php was done but var $keyforclass or $keyforclassfile or $keyforelement was not set');
14if (empty($keyforalias)) {
19if (class_exists($keyforclass)) {
20 $tmpobject =
new $keyforclass($this->db);
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->export_fields_array[$r][$fieldname] = $fieldlabel;
61 $this->export_TypeFields_array[$r][$fieldname] = $typeFilter;
62 $this->export_entities_array[$r][$fieldname] = $keyforelement;
63 $this->export_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...