Merge branch '1511-visual-console-elements-not-sorted-in-creation-dev' into 'develop'
Added changes to sort json in ajax return See merge request artica/pandorafms!1001
This commit is contained in:
commit
6ddf744163
|
@ -3029,7 +3029,10 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||
$javascript = $parameters['javascript'];
|
||||
}
|
||||
|
||||
|
||||
$get_order_json = false;
|
||||
if (isset($parameters['get_order_json'])) {
|
||||
$get_order_json = true;
|
||||
}
|
||||
|
||||
$javascript_is_function_select = false; //Default value
|
||||
if (isset($parameters['javascript_is_function_select'])) {
|
||||
|
@ -3117,6 +3120,10 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||
inputs.push ("force_local_modules=1");
|
||||
}
|
||||
|
||||
if (' . ((int) $get_order_json) . ') {
|
||||
inputs.push ("get_order_json=1");
|
||||
}
|
||||
|
||||
if (' . ((int)$metaconsole_enabled) . ') {
|
||||
if ((' . ((int)$use_input_server) . ')
|
||||
|| (' . ((int)$print_input_server) . ')) {
|
||||
|
|
|
@ -291,6 +291,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||
$params['use_hidden_input_idagent'] = true;
|
||||
$params['print_hidden_input_idagent'] = true;
|
||||
$params['hidden_input_idagent_name'] = 'id_agent';
|
||||
$params['get_order_json'] = true;
|
||||
if (defined('METACONSOLE')) {
|
||||
$params['javascript_ajax_page'] = '../../ajax.php';
|
||||
$params['disabled_javascript_on_blur_function'] = true;
|
||||
|
|
|
@ -703,6 +703,18 @@ if (is_ajax ()) {
|
|||
$agent_modules[$key]['nombre'] = io_safe_output($module['nombre']);
|
||||
}
|
||||
|
||||
$get_order_json = (bool)get_parameter('get_order_json', false);
|
||||
if ($get_order_json) {
|
||||
$new_elements = array();
|
||||
$index = 0;
|
||||
foreach ($agent_modules as $key => $module) {
|
||||
$new_elements[$index]['id_agente_modulo'] = $module['id_agente_modulo'];
|
||||
$new_elements[$index]['nombre'] = io_safe_output($module['nombre']);
|
||||
$index++;
|
||||
}
|
||||
$agent_modules = $new_elements;
|
||||
}
|
||||
|
||||
echo json_encode ($agent_modules);
|
||||
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue