Merge branch 'ent-2588-service-like-visual-console-status' into 'develop'

Bugfixes

See merge request artica/pandorafms!1780
This commit is contained in:
vgilc 2018-09-18 16:08:48 +02:00
commit ae37205388
3 changed files with 12 additions and 5 deletions

View File

@ -1544,11 +1544,14 @@ function loadFieldsFromDB(item) {
if (key == 'linked_layout_status_type')
$("select[name=linked_map_status_calculation_type]").val(val).change();
if (key == 'id_layout_linked') {
if (data['linked_layout_node_id'] == null)
if (data['linked_layout_node_id'] == null) {
$("select[name=map_linked]").val(val).change();
else
$("select[name=map_linked] > option[data-node-id=" + data['linked_layout_node_id'] + "][value=" + val + "]")
.prop("selected", true).change();
}
else {
var $option = $("select[name=map_linked] > option[data-node-id=" + data['linked_layout_node_id'] + "][value=" + val + "]");
if ($option.length === 0) $option = $("select[name=map_linked] > option[value=" + val + "]");
$option.prop("selected", true).parent().change();
}
}
if (key == 'linked_layout_node_id')
$("input[name=linked_map_node_id]").val(val);

View File

@ -101,7 +101,7 @@ $height = get_parameter('height', null);
$parent = get_parameter('parent', null);
$map_linked = get_parameter('map_linked', null);
$linked_map_node_id = get_parameter('linked_map_node_id', null);
$linked_map_status_calculation_type = get_parameter('linked_map_status_calculation_type', 'default');
$linked_map_status_calculation_type = get_parameter('linked_map_status_calculation_type', null);
$map_linked_weight = get_parameter('map_linked_weight', null);
if ($map_linked_weight !== null) {

View File

@ -773,6 +773,10 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items_advance['map_linked_row']['html'] .= ob_get_clean();
}
else {
$visual_maps = array_reduce($visual_maps, function ($all, $item) {
$all[$item["id"]] = $item["name"];
return $all;
}, array());
$form_items_advance['map_linked_row']['html'] .= html_print_select(
$visual_maps, 'map_linked', 0, 'onLinkedMapChange(event)', __('None'), 0, true
);