mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2011-02-15 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora.js, operation/agentes/ver_agente.php, godmode/reporting/visual_console_builder.wizard.php, godmode/reporting/visual_console_builder.php: fixed when the agent haven't any module and fixed when to try to create items without modules selected. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3865 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b6812ef82f
commit
bf8e33789b
@ -1,3 +1,10 @@
|
|||||||
|
2011-02-15 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/javascript/pandora.js, operation/agentes/ver_agente.php,
|
||||||
|
godmode/reporting/visual_console_builder.wizard.php,
|
||||||
|
godmode/reporting/visual_console_builder.php: fixed when the agent haven't
|
||||||
|
any module and fixed when to try to create items without modules selected.
|
||||||
|
|
||||||
2011-02-15 Miguel de Dios <miguel.dedios@artica.es>
|
2011-02-15 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* operation/visual_console/render_view.php: fixed the link to edit
|
* operation/visual_console/render_view.php: fixed the link to edit
|
||||||
|
@ -165,26 +165,32 @@ switch ($activeTab) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$message = '';
|
$message = '';
|
||||||
if ($name_modules[0] == '0')
|
|
||||||
$message .= process_wizard_add ($id_agents, $image, $idVisualConsole, $range, $width, $height);
|
if (empty($name_modules)) {
|
||||||
else{
|
$statusProcessInDB = array('flag' => true, 'message' => print_error_message (__('No modules selected'), '', true));
|
||||||
$id_modules = array();
|
}
|
||||||
$cont_dest = 1;
|
else {
|
||||||
$cont_mod = 1;
|
if ($name_modules[0] == '0')
|
||||||
foreach($name_modules as $mod){
|
$message .= process_wizard_add ($id_agents, $image, $idVisualConsole, $range, $width, $height);
|
||||||
$cont_ag = 1;
|
else{
|
||||||
foreach($id_agents as $ag){
|
$id_modules = array();
|
||||||
$sql = "SELECT id_agente_modulo FROM tagente_modulo WHERE delete_pending = 0 AND id_agente = ".$ag." AND nombre = '".$mod."'";
|
$cont_dest = 1;
|
||||||
$result = get_db_row_sql ($sql);
|
$cont_mod = 1;
|
||||||
$id_modules[$cont_dest] = $result['id_agente_modulo'];
|
foreach($name_modules as $mod){
|
||||||
$cont_ag = $cont_ag + 1;
|
$cont_ag = 1;
|
||||||
$cont_dest = $cont_dest + 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."'";
|
||||||
$cont_mod = $cont_mod + 1;
|
$result = get_db_row_sql ($sql);
|
||||||
}
|
$id_modules[$cont_dest] = $result['id_agente_modulo'];
|
||||||
$message .= process_wizard_add_modules ($id_modules, $image, $idVisualConsole, $range, $width, $height);
|
$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);
|
||||||
|
}
|
||||||
|
$statusProcessInDB = array('flag' => true, 'message' => $message);
|
||||||
}
|
}
|
||||||
$statusProcessInDB = array('flag' => true, 'message' => $message);
|
|
||||||
$action = 'edit';
|
$action = 'edit';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -78,11 +78,11 @@ echo '</form>';
|
|||||||
|
|
||||||
//Trick for it have a traduct text for javascript.
|
//Trick for it have a traduct text for javascript.
|
||||||
echo '<span id="any_text" style="display: none;">' . __('Any') . '</span>';
|
echo '<span id="any_text" style="display: none;">' . __('Any') . '</span>';
|
||||||
|
echo '<span id="none_text" style="display: none;">' . __('None') . '</span>';
|
||||||
?>
|
?>
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
var show_only_enabled_modules = true;
|
var show_only_enabled_modules = true;
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
//$("#id_agents").change (agent_changed);
|
|
||||||
$("#id_agents").change (agent_changed_by_multiple_agents);
|
$("#id_agents").change (agent_changed_by_multiple_agents);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -108,6 +108,22 @@ function agent_changed (event, id_agent, selected) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Util for check is empty object
|
||||||
|
*
|
||||||
|
* @param obj the object to check
|
||||||
|
* @returns {Boolean} True it is empty
|
||||||
|
*/
|
||||||
|
function isEmptyObject(obj) {
|
||||||
|
for(var prop in obj) {
|
||||||
|
if(obj.hasOwnProperty(prop))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill up select box with id "module" with modules after agent has been selected, but this not empty the select box.s
|
* Fill up select box with id "module" with modules after agent has been selected, but this not empty the select box.s
|
||||||
*
|
*
|
||||||
@ -144,6 +160,18 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) {
|
|||||||
function (data) {
|
function (data) {
|
||||||
$('#module').empty ();
|
$('#module').empty ();
|
||||||
|
|
||||||
|
if (isEmptyObject(data)) {
|
||||||
|
var noneText = $("#none_text").html(); //Trick for catch the translate text.
|
||||||
|
|
||||||
|
if (anyText == null) {
|
||||||
|
anyText = 'None';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#module').append ($('<option></option>').html (anyText).attr ("None", "").attr('selected', true));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof($(document).data('text_for_module')) != 'undefined') {
|
if (typeof($(document).data('text_for_module')) != 'undefined') {
|
||||||
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).attr('selected', true));
|
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).attr('selected', true));
|
||||||
}
|
}
|
||||||
|
@ -95,6 +95,10 @@ if (is_ajax ()) {
|
|||||||
|
|
||||||
$nameModules = get_db_all_rows_sql('SELECT DISTINCT(nombre) FROM tagente_modulo t1, talert_template_modules t2 WHERE t2.id_agent_module = t1.id_agente_modulo AND delete_pending = 0 AND id_agente IN (' . implode(',', $idAgents) . ') AND (SELECT count(nombre) FROM tagente_modulo t3, talert_template_modules t4 WHERE t4.id_agent_module = t3.id_agente_modulo AND delete_pending = 0 AND t1.nombre = t3.nombre AND id_agente IN (' . implode(',', $idAgents) . ')) = (' . count($idAgents) . ')');
|
$nameModules = get_db_all_rows_sql('SELECT DISTINCT(nombre) FROM tagente_modulo t1, talert_template_modules t2 WHERE t2.id_agent_module = t1.id_agente_modulo AND delete_pending = 0 AND id_agente IN (' . implode(',', $idAgents) . ') AND (SELECT count(nombre) FROM tagente_modulo t3, talert_template_modules t4 WHERE t4.id_agent_module = t3.id_agente_modulo AND delete_pending = 0 AND t1.nombre = t3.nombre AND id_agente IN (' . implode(',', $idAgents) . ')) = (' . count($idAgents) . ')');
|
||||||
|
|
||||||
|
if ($nameModules == false) {
|
||||||
|
$nameModules = array();
|
||||||
|
}
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach($nameModules as $nameModule) {
|
foreach($nameModules as $nameModule) {
|
||||||
$result[] = $nameModule['nombre'];
|
$result[] = $nameModule['nombre'];
|
||||||
@ -121,6 +125,10 @@ if (is_ajax ()) {
|
|||||||
FROM tagente_modulo t1
|
FROM tagente_modulo t1
|
||||||
WHERE ' . $enabled . ' AND 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) . ')');
|
WHERE ' . $enabled . ' AND 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) . ')');
|
||||||
|
|
||||||
|
if ($nameModules == false) {
|
||||||
|
$nameModules = array();
|
||||||
|
}
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach($nameModules as $nameModule) {
|
foreach($nameModules as $nameModule) {
|
||||||
$result[] = safe_output($nameModule['nombre']);
|
$result[] = safe_output($nameModule['nombre']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user