Merge branch 'ent-3365-Javascript_roto_en_creacion_de_modulos' into 'develop'

fixed error create modules network

See merge request artica/pandorafms!2117

Former-commit-id: c522eeb2ded1442adb9a1282d350c9514e9ffa3f
This commit is contained in:
daniel 2019-01-11 13:06:31 +01:00
commit c3481933f5
2 changed files with 22 additions and 10 deletions

View File

@ -250,23 +250,32 @@ else {
}
//Removed web analysis and log4x from select
$sql = sprintf ('SELECT id_tipo, descripcion
$sql = sprintf (
'SELECT id_tipo, descripcion, nombre
FROM ttipo_modulo
WHERE categoria IN (%s) AND id_tipo NOT IN (24, 25)
ORDER BY descripcion',
implode (',', $categories));
implode (',', $categories)
);
$table_simple->data[2][1] = html_print_select_from_sql ($sql, 'id_module_type',
$idModuleType, '', '', '', true, false, false, $disabledBecauseInPolicy, false, false, 100);
// Store the relation between id and name of the types on a hidden field
$type_names = db_get_all_rows_sql($sql);
$type_names_hash = array();
foreach ($type_names as $tn) {
$type_names_hash[$tn['id_tipo']] = $tn['nombre'];
$type_description_hash = array();
if (isset($type_names) && is_array($type_names)) {
foreach ($type_names as $tn) {
$type_names_hash[$tn['id_tipo']] = $tn['nombre'];
$type_description_hash[$tn['id_tipo']] = $tn['descripcion'];
}
}
$table_simple->data[2][1] = html_print_select (
$type_description_hash, 'id_module_type', $idModuleType,
$disabledBecauseInPolicy, '', 0, true,
false, true, '', false, false, false, 100
);
// Store the relation between id and name of the types on a hidden field
$table_simple->data[2][1] .= html_print_input_hidden('type_names',base64_encode(io_json_mb_encode($type_names_hash)),true);
}

View File

@ -735,8 +735,11 @@ function html_print_extended_select_for_post_process($name, $selected = '',
$selected_float = (float)$selected;
$found = false;
if (array_key_exists(number_format($selected, 14, '.', ','), $fields))
$found = true;
if($selected){
if (array_key_exists(number_format($selected, 14, '.', ','), $fields)) {
$found = true;
}
}
if (!$found) {
$fields[$selected] = floatval($selected);