2011-11-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* godmode/massive/massive_add_alerts.php
	godmode/massive/massive_delete_agents.php
	godmode/massive/massive_enable_disable_alerts.php
	godmode/massive/massive_operations.php
	godmode/massive/massive_delete_profiles.php
	godmode/massive/massive_edit_agents.php
	godmode/massive/massive_delete_action_alerts.php
	godmode/massive/massive_delete_modules.php
	godmode/massive/massive_add_profiles.php
	godmode/massive/massive_delete_alerts.php
	godmode/massive/massive_edit_modules.php
	godmode/massive/massive_standby_alerts.php
	godmode/massive/massive_add_action_alerts.php: Added spinner while
	waiting to massive operations result and added check of PHP conf.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5126 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2011-11-10 19:19:38 +00:00
parent 10ee98cb4a
commit d6ad746367
14 changed files with 109 additions and 14 deletions

View File

@ -1,3 +1,20 @@
2011-11-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_agents.php
godmode/massive/massive_enable_disable_alerts.php
godmode/massive/massive_operations.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.php
godmode/massive/massive_delete_action_alerts.php
godmode/massive/massive_delete_modules.php
godmode/massive/massive_add_profiles.php
godmode/massive/massive_delete_alerts.php
godmode/massive/massive_edit_modules.php
godmode/massive/massive_standby_alerts.php
godmode/massive/massive_add_action_alerts.php: Added spinner while
waiting to massive operations result and added check of PHP conf.
2011-11-08 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* operation/reporting/reporting_viewer.php: Added begin date control

View File

@ -203,7 +203,7 @@ $table->data[4][1] .= html_print_input_text ('fires_max', 0, '', 4, 10, true);
$table->data[4][1] .= ui_print_help_icon ("alert-matches", true);
$table->data[4][1] .= '</span>';
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_action_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_action_alerts">';
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';

View File

@ -143,7 +143,7 @@ $table->data[2][1] = html_print_select (index_array ($templates, 'id', 'name'),
$table->data[2][2] = '';
$table->data[2][3] = '';
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=add_alerts">';
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';

View File

@ -93,7 +93,7 @@ $table->size[1] = '33%';
$table->size[2] = '33%';
$data = array ();
$data[0] = '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_users&option=add_profiles">';
$data[0] = '<form method="post" id="form_profiles" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_users&option=add_profiles">';
$data[0] .= html_print_select (profile_get_profiles (), 'profiles_id[]', '', '', '',
'', true, true, false, '', false, 'width: 100%');
$data[1] = html_print_select_groups($config['id_user'], "UM", true,

View File

@ -202,7 +202,7 @@ $actions = alerts_get_alert_actions ();
$table->data[4][0] = __('Action');
$table->data[4][1] = html_print_select ($actions, 'action', '', '', __('None'), 0, true);
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_action_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
echo '<form method="post" id="form_alert" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_action_alerts">';
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';

View File

@ -110,7 +110,7 @@ $table->data[1][0] .= '</span>';
$table->data[1][1] = html_print_select (agents_get_group_agents ($id_group, false, "none"),
'id_agents[]', 0, false, '', '', true, true);
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_agents" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
echo '<form method="post" id="form_agents" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_agents">';
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';

View File

@ -161,10 +161,10 @@ $table->data[2][1] = html_print_select (index_array ($agents_alerts, 'id_agente'
$table->data[2][2] = __('Modules');
$table->data[2][3] = html_print_select (array(), 'module[]', '', false, '', '', true, true, false);
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
echo '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_alerts" >';
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden ('delete', 1);
html_print_submit_button (__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';

View File

@ -140,7 +140,7 @@ $agents = modules_get_agents_with_module_name ($module_name, $id_group,
$table->data[2][1] = html_print_select (index_array ($agents, 'id_agente', 'nombre'),
'id_agents[]', 0, false, __('None'), 0, true, true, true, '', empty ($module_name));
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
echo '<form method="post" id="form_modules" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_modules" >';
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';

View File

@ -109,7 +109,7 @@ $table->size[1] = '33%';
$table->size[2] = '33%';
$data = array ();
$data[0] = '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_users&option=delete_profiles">';
$data[0] = '<form method="post" id="form_profiles" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_users&option=delete_profiles">';
$data[0] .= html_print_select (profile_get_profiles (), 'profiles_id[]', '', '', '',
'', true, false, false, '', false, 'width: 100%');
$data[1] = html_print_select_groups($config['id_user'], "UM", true,

View File

@ -208,7 +208,8 @@ $all_agents = agents_get_group_agents ($id_group, array('disabled' => 1), "none"
$table->data[1][1] = html_print_select ($all_agents,
'id_agents[]', 0, false, '', '', true, true);
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_agents" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
echo '<form method="post" id="form_agents" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_agents">';
//echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_agents">';
html_print_table ($table);
$nombre_agente = "";

View File

@ -364,7 +364,7 @@ $table->data['edit8'][2] = __('Tags');
$table->data['edit8'][3] = html_print_select_from_sql ('SELECT id_tag, name FROM ttag ORDER BY name',
'id_tag[]', $id_tag, '',__('None'),'0', true, true, false, false);
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit">';
html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';

View File

@ -1,4 +1,4 @@
<?php
F<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
@ -123,7 +123,7 @@ $table->size[3] = '15%';
$table->data = array ();
$table->data[0][0] = '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts&option=enable_disable_alerts&action=disable_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
$table->data[0][0] = '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts&option=enable_disable_alerts&action=disable_alerts">';
$table->data[0][0] .= html_print_input_hidden('id_alert_template_enabled', $id_alert_templates, true);
$table->data[0][0] .= __('Group');

View File

@ -131,6 +131,83 @@ $onheader['policies'] = $policiestab;
ui_print_page_header (__('Massive operations'). ' &raquo; '. $options[$option], "images/sitemap_color.png", false, "", true, $onheader);
// Checks if the PHP configuration is correctly
if ((get_cfg_var("max_execution_time") != 0) or (get_cfg_var("max_input_time") != -1)){
echo '<div id="notify_conf" class="notify">';
echo __("In order to perform massive operations, PHP needs a correct configuration in timeout parameters. Please, open your PHP configuration file (php.ini) for example: <i>sudo vi /etc/php5/apache2/php.ini;</i><br> And set your timeout parameters to a correct value: <br><i> max_execution_time = 0</i> and <i>max_input_time = -1</i>");
echo '</div>';
}
// Catch all submit operations in this view to display Wait banner
$submit_action = get_parameter('go');
$submit_update = get_parameter('updbutton');
$submit_del = get_parameter('del');
$submit_template_disabled = get_parameter('id_alert_template_disabled');
$submit_template_enabled = get_parameter('id_alert_template_enabled');
$submit_template_not_standby = get_parameter('id_alert_template_not_standby');
$submit_template_standby = get_parameter('id_alert_template_standby');
$submit_add = get_parameter('crtbutton');
/*if (!empty($submit_action) or !empty($submit_update) or !empty($submit_del)
or !empty($submit_template_disabled) or !empty($submit_template_enabled)
or !empty($submit_template_not_standby) or !empty($submit_template_standby)
or !empty($submit_add)){*/
echo '<div id="loading" display="none">';
echo html_print_image("images/wait.gif", true, array("border" => '0')) . '<br />';
echo '<strong>'.__('Please wait').'...</strong>';
echo '</div>';
//}
?>
<script language="javascript" type="text/javascript">
$(document).ready (function (){
$('#manage_config_form').submit( function(){
confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
if (confirm)
$("#loading").css("display", "");
else
return false;
});
$('#form_edit').submit( function(){
$("#loading").css("display", "");
});
$('[id^=form]').submit( function(){
confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
if (confirm)
$("#loading").css("display", "");
else
return false;
});
// $('[id^=submit-]').click( function(){
// $("#loading").css("display", "");
// });
$("#loading").css("display", "none");
});
// $("#loading").slideUp ();
//$('[id^=submit]').click( function() {
// console.log("DERER");
// $("#loading").show ();
//});
</script>
<?php
echo '<form method="post" id="form_options" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations">';
echo '<table border="0"><tr><td>';
echo '</td><td>';

View File

@ -125,7 +125,7 @@ $table->size[3] = '15%';
$table->data = array ();
$templates = alerts_get_alert_templates (false, array ('id', 'name'));
$table->data[0][0] = '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts&option=standby_alerts&action=set_standby_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
$table->data[0][0] = '<form method="post" id="form_alerts" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts&option=standby_alerts&action=set_standby_alerts">';
$table->data[0][0] .= html_print_input_hidden('id_alert_template_not_standby', $id_alert_templates, true);
$table->data[0][0] .= __('Group');
$table->data[0][1] = html_print_select_groups(false, "AR", true, 'id_group', $id_group,