2013-09-25 Miguel de Dios <miguel.dedios@artica.es>

* godmode/modules/manage_network_components_form_common.php,
	godmode/modules/manage_network_components_form.php: fixed the
	javascript to configure the form of snmp.
	
	* godmode/agentes/module_manager_editor.php,
	godmode/agentes/configurar_agente.php,
	godmode/agentes/module_manager_editor_common.php: fixed the
	"module_macros" when it is fail when is not set for example.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8806 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-09-25 07:28:29 +00:00
parent 008f5b184d
commit 55e1f89f4d
6 changed files with 40 additions and 13 deletions

View File

@ -1,3 +1,14 @@
2013-09-25 Miguel de Dios <miguel.dedios@artica.es>
* godmode/modules/manage_network_components_form_common.php,
godmode/modules/manage_network_components_form.php: fixed the
javascript to configure the form of snmp.
* godmode/agentes/module_manager_editor.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/module_manager_editor_common.php: fixed the
"module_macros" when it is fail when is not set for example.
2013-09-24 Sergio Martin <sergio.martin@artica.es>
* godmode/reporting/reporting_builder.item_editor.php: Added

View File

@ -1089,7 +1089,8 @@ if ($create_module) {
$id_agent_module = false;
}
else {
$id_agent_module = modules_create_agent_module ($id_agente, $name, $values, false, $id_tag);
$id_agent_module = modules_create_agent_module (
$id_agente, $name, $values, false, $id_tag);
}
if (is_error($id_agent_module)) {

View File

@ -231,7 +231,10 @@ if ($id_agent_module) {
$wday = '*';
}
$module_macros = json_decode(base64_decode($module['module_macros']));
$module_macros = null;
if (isset($module['module_macros'])) {
$module_macros = json_decode(base64_decode($module['module_macros']));
}
}
else {
if (!isset ($moduletype)) {

View File

@ -483,13 +483,17 @@ $table_macros->style[5] = 'width: 10px';
$table_macros->colspan = array ();
$macro_count = 0;
foreach ($module_macros as $macro_name => $macro_value) {
$table_macros->data[$macro_count][0] = __('Name');
$table_macros->data[$macro_count][1] = html_print_input_text ('module_macro_names[]', $macro_name, '', 50, 60, true);
$table_macros->data[$macro_count][2] = __('Value');
$table_macros->data[$macro_count][3] = html_print_input_text ('module_macro_values[]', $macro_value, '', 50, 60, true);
$table_macros->data[$macro_count][4] = '<a href="javascript: delete_macro(' . $macro_count . ');">' . html_print_image('images/cross.png', true) . '</a>';
$macro_count++;
if (isset($module_macros)) {
if (is_array($module_macros)) {
foreach ($module_macros as $macro_name => $macro_value) {
$table_macros->data[$macro_count][0] = __('Name');
$table_macros->data[$macro_count][1] = html_print_input_text ('module_macro_names[]', $macro_name, '', 50, 60, true);
$table_macros->data[$macro_count][2] = __('Value');
$table_macros->data[$macro_count][3] = html_print_input_text ('module_macro_values[]', $macro_value, '', 50, 60, true);
$table_macros->data[$macro_count][4] = '<a href="javascript: delete_macro(' . $macro_count . ');">' . html_print_image('images/cross.png', true) . '</a>';
$macro_count++;
}
}
}
$table_macros->data[$macro_count][0] = '<span>'.__('Add module macro').'</span> <a href="javascript:add_macro();">'.html_print_image('images/add.png',true).'</a>';
$table_macros->colspan[$macro_count][0] = 5;

View File

@ -249,7 +249,7 @@ function type_change () {
document.component.tcp_rcv.disabled=true;
document.component.tcp_port.style.background="#ddd";
document.component.tcp_port.disabled=true;
document.component.snmp_version.style.background="#ddd";
document.component.snmp_version.disabled=true;
document.component.snmp3_auth_user.style.background="#ddd";
@ -279,7 +279,7 @@ function type_change () {
document.component.tcp_rcv.disabled=true;
document.component.tcp_port.style.background="#fff";
document.component.tcp_port.disabled=false;
document.component.snmp_version.style.background="#fff";
document.component.snmp_version.disabled=false;
document.component.snmp3_auth_user.style.background="#fff";
@ -294,6 +294,8 @@ function type_change () {
document.component.snmp3_auth_method.disabled=false;
document.component.snmp3_security_level.style.background="#fff";
document.component.snmp3_security_level.disabled=false;
$("#snmp_version" ).trigger("change");
}
// type 6-7 - ICMP
if ((document.component.type.value == 6) || (document.component.type.value == 7)) {
@ -398,6 +400,7 @@ $(document).ready (function () {
}
});
});
$("#left").click (function () {
jQuery.each($("select[name='id_tag_selected[]'] option:selected"), function (key, value) {
tag_name = $(value).html();
@ -412,16 +415,19 @@ $(document).ready (function () {
}
});
});
$("#submit-crt").click(function () {
$('#id_tag_selected option').map(function() {
$(this).attr('selected','selected');
});
});
$("#submit-upd").click(function () {
$('#id_tag_selected option').map(function() {
$(this).attr('selected','selected');
});
});
if ($("#snmp_version").value == "3") {
$("input[name=snmp3_auth_user]").css({backgroundColor: '#fff'});
$("input[name=snmp3_auth_user]").removeAttr('disabled');
@ -525,7 +531,7 @@ $(document).ready (function () {
});
$("#type"). change(function () {
if ($("#snmp_version").value == "3") {
if ($("#snmp_version").val() == "3") {
$("input[name=snmp3_auth_user]").css({backgroundColor: '#fff'});
$("input[name=snmp3_auth_user]").removeAttr('disabled');
@ -575,6 +581,8 @@ $(document).ready (function () {
$("input[name=snmp_community]").removeAttr('disabled');
}
});
$("#snmp_version" ).trigger("change");
});
<?php

View File

@ -71,7 +71,7 @@ $sql = sprintf ('SELECT id_tipo, descripcion
ORDER BY descripcion',
implode (',', $categories));
$table->data[1][1] = html_print_select_from_sql ($sql, 'type',
$type, '', '', '', true,
$type, 'javascript: type_change();', '', '', true,
false, false, false, true, false, false, false, 0);
// Store the relation between id and name of the types on a hidden field