2010-05-18 Sergio Martin <sergio.martin@artica.es>

* operation/agentes/ver_agente.php
	godmode/reporting/visual_console_builder.wizard.php
	godmode/reporting/visual_console_builder.php: Fixed the
	multiple agents selection on visual console wizard 
	for bug 2997750



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2744 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2010-05-18 12:10:39 +00:00
parent 1850cb9251
commit 91f35b72cf
4 changed files with 30 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2010-05-18 Sergio Martin <sergio.martin@artica.es>
* operation/agentes/ver_agente.php
godmode/reporting/visual_console_builder.wizard.php
godmode/reporting/visual_console_builder.php: Fixed the
multiple agents selection on visual console wizard
for bug 2997750
2010-05-18 Miguel de Dios <miguel.dedios@artica.es> 2010-05-18 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora.js: added function * include/javascript/pandora.js: added function

View File

@ -136,16 +136,32 @@ switch ($activeTab) {
switch ($action) { switch ($action) {
case 'update': case 'update':
$id_agents = get_parameter ('id_agents', array ()); $id_agents = get_parameter ('id_agents', array ());
$id_modules = get_parameter ('module', array ()); $name_modules = get_parameter ('module', array ());
$image = get_parameter ('image'); $image = get_parameter ('image');
$range = (int) get_parameter ("range", 50); $range = (int) get_parameter ("range", 50);
$width = (int) get_parameter ("width", 0); $width = (int) get_parameter ("width", 0);
$height = (int) get_parameter ("height", 0); $height = (int) get_parameter ("height", 0);
$message = ''; $message = '';
if ($id_modules[0] == 0) if ($name_modules[0] == '0')
$message .= process_wizard_add ($id_agents, $image, $idVisualConsole, $range, $width, $height); $message .= process_wizard_add ($id_agents, $image, $idVisualConsole, $range, $width, $height);
else else{
$id_modules = array();
$cont_dest = 1;
$cont_mod = 1;
foreach($name_modules as $mod){
$cont_ag = 1;
foreach($id_agents as $ag){
$sql = "SELECT id_agente_modulo FROM tagente_modulo WHERE delete_pending = 0 AND id_agente = ".$ag." AND nombre = '".$mod."'";
$result = get_db_row_sql ($sql);
$id_modules[$cont_dest] = $result['id_agente_modulo'];
$cont_ag = $cont_ag + 1;
$cont_dest = $cont_dest + 1;
}
$cont_mod = $cont_mod + 1;
}
$message .= process_wizard_add_modules ($id_modules, $image, $idVisualConsole, $range, $width, $height); $message .= process_wizard_add_modules ($id_modules, $image, $idVisualConsole, $range, $width, $height);
}
$statusProcessInDB = array('flag' => true, 'message' => $message); $statusProcessInDB = array('flag' => true, 'message' => $message);
$action = 'edit'; $action = 'edit';
break; break;

View File

@ -82,6 +82,6 @@ echo '<span id="any_text" style="display: none;">' . __('Any') . '</span>';
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
$(document).ready (function () { $(document).ready (function () {
//$("#id_agents").change (agent_changed); //$("#id_agents").change (agent_changed);
$("#id_agents").change (agent_changed_by_multiple_agents_id); $("#id_agents").change (agent_changed_by_multiple_agents);
}); });
</script> </script>

View File

@ -75,7 +75,7 @@ if (is_ajax ()) {
if ($get_agent_modules_json_for_multiple_agents) { if ($get_agent_modules_json_for_multiple_agents) {
$idAgents = get_parameter('id_agent'); $idAgents = get_parameter('id_agent');
$nameModules = get_db_all_rows_sql('SELECT DISTINCT(nombre) FROM tagente_modulo WHERE id_agente IN (' . implode(',', $idAgents) . ')'); $nameModules = get_db_all_rows_sql('SELECT DISTINCT(nombre) FROM tagente_modulo t1 WHERE delete_pending = 0 AND id_agente IN (' . implode(',', $idAgents) . ') AND (SELECT count(nombre) FROM tagente_modulo t2 WHERE delete_pending = 0 AND t1.nombre = t2.nombre AND id_agente IN (' . implode(',', $idAgents) . ')) = (' . count($idAgents) . ')');
$result = array(); $result = array();
foreach($nameModules as $nameModule) { foreach($nameModules as $nameModule) {