Merge branch 'ent-4013-7999-Bug-custom-graph-en-consola-visual' into 'develop'

Fixed error window in visual console

See merge request artica/pandorafms!2412

Former-commit-id: 312950779bb4cd02938f1e825d86ab3c1fef01ff
This commit is contained in:
Daniel Rodriguez 2019-05-13 14:52:17 +02:00
commit f281dda622
2 changed files with 19 additions and 5 deletions

View File

@ -674,12 +674,17 @@ function update_button_palette_callback() {
return false; return false;
} }
} }
if (values["module"] == 0) { var radio_value = $("input[name='radio_choice']:checked").val();
if (values["agent"] == "" && radio_value == "module_graph") {
dialog_message("#message_alert_no_agent");
return false;
}
if (values["module"] == 0 && radio_value == "module_graph") {
dialog_message("#message_alert_no_module"); dialog_message("#message_alert_no_module");
return false; return false;
} }
if (values["agent"] == "") { if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") {
dialog_message("#message_alert_no_agent"); dialog_message("#message_alert_no_custom_graph");
return false; return false;
} }
if ($("input[name=width_module_graph]").val() == "") { if ($("input[name=width_module_graph]").val() == "") {
@ -1425,11 +1430,12 @@ function create_button_palette_callback() {
break; break;
case "module_graph": case "module_graph":
if (values["module"] == 0) { var radio_value = $("input[name='radio_choice']:checked").val();
if (values["module"] == 0 && radio_value == "module_graph") {
dialog_message("#message_alert_no_module"); dialog_message("#message_alert_no_module");
validate = false; validate = false;
} }
if (values["id_custom_graph"] == 0) { if (values["id_custom_graph"] == 0 && radio_value == "module_graph") {
if (values["agent"] == "") { if (values["agent"] == "") {
dialog_message("#message_alert_no_agent"); dialog_message("#message_alert_no_agent");
validate = false; validate = false;
@ -1439,6 +1445,10 @@ function create_button_palette_callback() {
validate = false; validate = false;
} }
} }
if (values["id_custom_graph"] == 0 && radio_value == "custom_graph") {
dialog_message("#message_alert_no_custom_graph");
validate = false;
}
if ( if (
values["height_module_graph"] == "" || values["height_module_graph"] == "" ||
values["height_module_graph"] == 0 values["height_module_graph"] == 0

View File

@ -1386,6 +1386,10 @@ function visual_map_editor_print_hack_translate_strings()
echo "<p style='text-align: center;font-weight: bold;'>".__('Could not be save.').'</p>'; echo "<p style='text-align: center;font-weight: bold;'>".__('Could not be save.').'</p>';
echo '</div>'; echo '</div>';
echo "<div id='message_alert_no_custom_graph' title='".__('Visual Console Builder Information')."' style='display:none;'>";
echo "<p style='text-align: center;font-weight: bold;'>".__('No custom graph defined.').'</p>';
echo '</div>';
} }