From 5f44ae141abc1bd159bb39a76f0b726a008cbc13 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Tue, 6 Jun 2023 10:39:56 +0200 Subject: [PATCH] #11443 Fixed SNMP token checkbox wizard --- .../include/class/AgentWizard.class.php | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index 2278cae9d4..44846ee4be 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -1645,13 +1645,13 @@ class AgentWizard extends HTML } else if (preg_match('/module-critical-max/', $k) > 0) { $result[$value]['criticalMax'] = $data[$k]; } else if (preg_match('/module-critical-inv/', $k) > 0) { - $result[$value]['criticalInv'] = $data[$k.'_sent']; + $result[$value]['criticalInv'] = $data[$k]; } else if (preg_match('/module-warning-inv/', $k) > 0) { - $result[$value]['warningInv'] = $data[$k.'_sent']; + $result[$value]['warningInv'] = $data[$k]; } else if (preg_match('/module-warning-perc/', $k) > 0) { - $result[$value]['warningPerc'] = $data[$k.'_sent']; + $result[$value]['warningPerc'] = $data[$k]; } else if (preg_match('/module-critical-perc/', $k) > 0) { - $result[$value]['criticalPerc'] = $data[$k.'_sent']; + $result[$value]['criticalPerc'] = $data[$k]; } else if (preg_match('/module-type/', $k) > 0) { $result[$value]['moduleType'] = $data[$k]; } else if (preg_match('/module-unit/', $k) > 0) { @@ -4360,7 +4360,7 @@ class AgentWizard extends HTML true, false, 'change_control(this, \''.$uniqueId.'\')', - false, + true, 'form="form-create-modules"' ), ], @@ -4376,7 +4376,7 @@ class AgentWizard extends HTML true, false, 'change_control(this, \''.$uniqueId.'\')', - false, + true, 'form="form-create-modules"' ), ], @@ -4442,7 +4442,7 @@ class AgentWizard extends HTML true, false, 'change_control(this, \''.$uniqueId.'\')', - false, + true, 'form="form-create-modules"' ), ], @@ -4459,7 +4459,7 @@ class AgentWizard extends HTML true, false, 'change_control(this,\''.$uniqueId.'\')', - false, + true, 'form="form-create-modules"' ), ], @@ -6240,22 +6240,24 @@ class AgentWizard extends HTML function change_control(checkbox, uniqueId) { var checkbox_name = $(checkbox).attr('name'); - if($(checkbox).prop('checked', true)) { - if(checkbox_name.match(/warning-inv/gm) !== null) { - $('#checkbox-module-warning-perc-'+uniqueId.replace('/','\\/')).prop('checked', false); - } + if(checkbox_name.match(/warning-inv/gm) !== null) { + $('#checkbox-module-warning-perc-'+uniqueId.replace('/','\\/')).prop('checked', false); + $('#checkbox-'+checkbox_name).val(1) + } - if(checkbox_name.match(/critical-inv/gm) !== null) { - $('#checkbox-module-critical-perc-'+uniqueId.replace('/','\\/')).prop('checked', false); - } + if(checkbox_name.match(/warning-perc/gm) !== null) { + $('#checkbox-module-warning-inv-'+uniqueId.replace('/','\\/')).prop('checked', false); + $('#checkbox-'+checkbox_name).val(1) + } - if(checkbox_name.match(/warning-perc/gm) !== null) { - $('#checkbox-module-warning-inv-'+uniqueId.replace('/','\\/')).prop('checked', false); - } + if(checkbox_name.match(/critical-inv/gm) !== null) { + $('#checkbox-module-critical-perc-'+uniqueId.replace('/','\\/')).prop('checked', false); + $('#checkbox-'+checkbox_name).val(1) + } - if(checkbox_name.match(/critical-perc/gm) !== null) { - $('#checkbox-module-critical-inv-'+uniqueId.replace('/','\\/')).prop('checked', false); - } + if(checkbox_name.match(/critical-perc/gm) !== null) { + $('#checkbox-module-critical-inv-'+uniqueId.replace('/','\\/')).prop('checked', false); + $('#checkbox-'+checkbox_name).val(1) } }