true, 'message' => __('Incidence type not fields'), ] ); } else { $output = '
'; foreach ($customFields as $field) { $options = [ 'name' => 'custom-fields['.$field['idIncidenceTypeField'].']', 'required' => $field['isRequired'], 'return' => true, 'value' => ($fieldsData[$field['idIncidenceTypeField']] ?? null), ]; $class = ''; switch ($field['type']) { case 'COMBO': $options['type'] = 'select'; $options['fields'] = explode(',', $field['comboValue']); break; case 'TEXT': $options['type'] = 'text'; break; case 'CHECKBOX': $options['type'] = 'checkbox'; break; case 'DATE': $options['type'] = 'text'; break; case 'NUMERIC': $options['type'] = 'number'; break; case 'TEXTAREA': $options['type'] = 'textarea'; $options['rows'] = 4; $options['columns'] = 0; $class = 'incidence-type-custom-fields-textarea'; break; default: // Not posible. break; } $output .= html_print_label_input_block( $field['label'], html_print_input($options), ['div_class' => $class] ); } $output .= '
'; echo $output; }