mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Set a data limit in the forms of massive operations. TICKET: #1700
This commit is contained in:
parent
f5e645ec03
commit
7628ddb5c6
33
pandora_console/godmode/massive/massive_add_action_alerts.php
Normal file → Executable file
33
pandora_console/godmode/massive/massive_add_action_alerts.php
Normal file → Executable file
@ -37,7 +37,7 @@ if (is_ajax ()) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_array($id_agents) && count($id_agents) == 1 && $id_agents[0] == '') {
|
if (is_array($id_agents) && count($id_agents) == 1 && $id_agents[0] == '') {
|
||||||
$id_agents = false;
|
$id_agents = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ $recursion = get_parameter ('recursion');
|
|||||||
$add = (bool) get_parameter_post ('add');
|
$add = (bool) get_parameter_post ('add');
|
||||||
|
|
||||||
if ($add) {
|
if ($add) {
|
||||||
if(empty($id_agents) || $id_agents[0] == 0)
|
if (empty($id_agents) || $id_agents[0] == 0)
|
||||||
ui_print_result_message (false, '', __('Could not be added').". ".__('No agents selected'));
|
ui_print_result_message (false, '', __('Could not be added').". ".__('No agents selected'));
|
||||||
else {
|
else {
|
||||||
$actions = get_parameter ('action');
|
$actions = get_parameter ('action');
|
||||||
@ -76,9 +76,9 @@ if ($add) {
|
|||||||
|
|
||||||
$options = array();
|
$options = array();
|
||||||
|
|
||||||
if($fires_min > 0)
|
if ($fires_min > 0)
|
||||||
$options['fires_min'] = $fires_min;
|
$options['fires_min'] = $fires_min;
|
||||||
if($fires_max > 0)
|
if ($fires_max > 0)
|
||||||
$options['fires_max'] = $fires_max;
|
$options['fires_max'] = $fires_max;
|
||||||
|
|
||||||
if (empty($agent_alerts_id)) {
|
if (empty($agent_alerts_id)) {
|
||||||
@ -87,9 +87,9 @@ if ($add) {
|
|||||||
else {
|
else {
|
||||||
$results = true;
|
$results = true;
|
||||||
foreach ($agent_alerts_id as $agent_alert_id) {
|
foreach ($agent_alerts_id as $agent_alert_id) {
|
||||||
foreach($actions as $action) {
|
foreach ($actions as $action) {
|
||||||
$result = alerts_add_alert_agent_module_action($agent_alert_id, $action, $options);
|
$result = alerts_add_alert_agent_module_action($agent_alert_id, $action, $options);
|
||||||
if($result === false)
|
if ($result === false)
|
||||||
$results = false;
|
$results = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,14 +169,14 @@ html_print_table ($table);
|
|||||||
$sql = 'SELECT id_agente FROM tagente_modulo WHERE id_agente_modulo IN (SELECT id_agent_module FROM talert_template_modules)';
|
$sql = 'SELECT id_agente FROM tagente_modulo WHERE id_agente_modulo IN (SELECT id_agent_module FROM talert_template_modules)';
|
||||||
$agents_with_templates = db_get_all_rows_sql($sql);
|
$agents_with_templates = db_get_all_rows_sql($sql);
|
||||||
$agents_with_templates_json = array();
|
$agents_with_templates_json = array();
|
||||||
foreach($agents_with_templates as $ag) {
|
foreach ($agents_with_templates as $ag) {
|
||||||
$agents_with_templates_json[] = $ag['id_agente'];
|
$agents_with_templates_json[] = $ag['id_agente'];
|
||||||
}
|
}
|
||||||
$agents_with_templates_json = json_encode($agents_with_templates_json);
|
$agents_with_templates_json = json_encode($agents_with_templates_json);
|
||||||
|
|
||||||
echo "<input type='hidden' id='hidden-agents_with_templates' value='$agents_with_templates_json'>";
|
echo "<input type='hidden' id='hidden-agents_with_templates' value='$agents_with_templates_json'>";
|
||||||
|
|
||||||
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 . '" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||||
html_print_input_hidden ('add', 1);
|
html_print_input_hidden ('add', 1);
|
||||||
html_print_submit_button (__('Add'), 'go', false, 'class="sub add"');
|
html_print_submit_button (__('Add'), 'go', false, 'class="sub add"');
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
@ -189,7 +189,24 @@ ui_require_jquery_file ('pandora.controls');
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
$("#form_alerts").submit(function() {
|
||||||
|
var get_parameters_count = window.location.href.slice(
|
||||||
|
window.location.href.indexOf('?') + 1).split('&').length;
|
||||||
|
var post_parameters_count = $("#form_alerts").serializeArray().length;
|
||||||
|
|
||||||
|
var count_parameters =
|
||||||
|
get_parameters_count + post_parameters_count;
|
||||||
|
|
||||||
|
if (count_parameters > limit_parameters_massive) {
|
||||||
|
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
update_alerts();
|
update_alerts();
|
||||||
|
|
||||||
var recursion;
|
var recursion;
|
||||||
|
17
pandora_console/godmode/massive/massive_add_alerts.php
Normal file → Executable file
17
pandora_console/godmode/massive/massive_add_alerts.php
Normal file → Executable file
@ -205,7 +205,24 @@ ui_require_jquery_file ('pandora.controls');
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
|
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
$("#form_alerts").submit(function() {
|
||||||
|
var get_parameters_count = window.location.href.slice(
|
||||||
|
window.location.href.indexOf('?') + 1).split('&').length;
|
||||||
|
var post_parameters_count = $("#form_alerts").serializeArray().length;
|
||||||
|
|
||||||
|
var count_parameters =
|
||||||
|
get_parameters_count + post_parameters_count;
|
||||||
|
|
||||||
|
if (count_parameters > limit_parameters_massive) {
|
||||||
|
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$("#checkbox-recursion").click(function () {
|
$("#checkbox-recursion").click(function () {
|
||||||
$("#id_group").trigger("change");
|
$("#id_group").trigger("change");
|
||||||
});
|
});
|
||||||
|
42
pandora_console/godmode/massive/massive_copy_modules.php
Normal file → Executable file
42
pandora_console/godmode/massive/massive_copy_modules.php
Normal file → Executable file
@ -38,6 +38,8 @@ $destiny_recursion = get_parameter ('destiny_recursion');
|
|||||||
|
|
||||||
$do_operation = (bool) get_parameter ('do_operation');
|
$do_operation = (bool) get_parameter ('do_operation');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($do_operation) {
|
if ($do_operation) {
|
||||||
$result = agents_process_manage_config($source_id_agent,
|
$result = agents_process_manage_config($source_id_agent,
|
||||||
$destiny_id_agents);
|
$destiny_id_agents);
|
||||||
@ -92,12 +94,20 @@ $agents = ( $source_id_group ?
|
|||||||
agents_get_group_agents (array_keys (users_get_groups ($config["id_user"], "AW", false))) );
|
agents_get_group_agents (array_keys (users_get_groups ($config["id_user"], "AW", false))) );
|
||||||
$table->data[0][7] = html_print_select ($agents, 'source_id_agent', $source_id_agent, false, __('Select'), 0, true);
|
$table->data[0][7] = html_print_select ($agents, 'source_id_agent', $source_id_agent, false, __('Select'), 0, true);
|
||||||
|
|
||||||
echo '<form action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=copy_modules" id="manage_config_form" method="post">';
|
echo '<form ' .
|
||||||
|
'action="index.php?' .
|
||||||
|
'sec=gmassive&' .
|
||||||
|
'sec2=godmode/massive/massive_operations&' .
|
||||||
|
'option=copy_modules" ' .
|
||||||
|
'id="manage_config_form" ' .
|
||||||
|
'method="post">';
|
||||||
|
|
||||||
echo '<fieldset id="fieldset_source">';
|
echo '<fieldset id="fieldset_source">';
|
||||||
echo '<legend><span>'.__('Source');
|
echo '<legend>';
|
||||||
ui_print_help_icon ('manageconfig');
|
echo '<span>' .
|
||||||
echo '</span></legend>';
|
__('Source') . ui_print_help_icon('manageconfig', true) .
|
||||||
|
'</span>';
|
||||||
|
echo '</legend>';
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
echo '</fieldset>';
|
echo '</fieldset>';
|
||||||
|
|
||||||
@ -166,12 +176,14 @@ $table->size[0] = '20%';
|
|||||||
$table->size[1] = '30%';
|
$table->size[1] = '30%';
|
||||||
$table->size[2] = '20%';
|
$table->size[2] = '20%';
|
||||||
$table->size[3] = '30%';
|
$table->size[3] = '30%';
|
||||||
|
|
||||||
$table->data[0][0] = __('Group');
|
$table->data[0][0] = __('Group');
|
||||||
$table->data[0][1] = html_print_select_groups(false, "AW", true, 'destiny_id_group',
|
$table->data[0][1] = html_print_select_groups(false, "AW", true, 'destiny_id_group',
|
||||||
$destiny_id_group, false, '', '', true);
|
$destiny_id_group, false, '', '', true);
|
||||||
$table->data[0][2] = __('Group recursion');
|
$table->data[0][2] = __('Group recursion');
|
||||||
$table->data[0][3] = html_print_checkbox ("destiny_recursion", 1,
|
$table->data[0][3] = html_print_checkbox ("destiny_recursion", 1,
|
||||||
$destiny_recursion, true, false);
|
$destiny_recursion, true, false);
|
||||||
|
|
||||||
$status_list = array ();
|
$status_list = array ();
|
||||||
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
|
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
|
||||||
$status_list[AGENT_STATUS_WARNING] = __('Warning');
|
$status_list[AGENT_STATUS_WARNING] = __('Warning');
|
||||||
@ -182,6 +194,7 @@ $status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
|||||||
$table->data[1][0] = __('Status');
|
$table->data[1][0] = __('Status');
|
||||||
$table->data[1][1] = html_print_select($status_list,
|
$table->data[1][1] = html_print_select($status_list,
|
||||||
'status_agents_destiny', 'selected', '', __('All'), AGENT_STATUS_ALL, true);
|
'status_agents_destiny', 'selected', '', __('All'), AGENT_STATUS_ALL, true);
|
||||||
|
|
||||||
$table->data[2][0] = __('Agent');
|
$table->data[2][0] = __('Agent');
|
||||||
$table->data[2][0] .= '<span id="destiny_agent_loading" class="invisible">';
|
$table->data[2][0] .= '<span id="destiny_agent_loading" class="invisible">';
|
||||||
$table->data[2][0] .= html_print_image ("images/spinner.png", true);
|
$table->data[2][0] .= html_print_image ("images/spinner.png", true);
|
||||||
@ -204,6 +217,7 @@ html_print_table ($table);
|
|||||||
echo '</fieldset>';
|
echo '</fieldset>';
|
||||||
|
|
||||||
echo '<div class="action-buttons" style="width: ' . $table->width . '">';
|
echo '<div class="action-buttons" style="width: ' . $table->width . '">';
|
||||||
|
|
||||||
html_print_input_hidden ('do_operation', 1);
|
html_print_input_hidden ('do_operation', 1);
|
||||||
html_print_submit_button (__('Copy'), 'go', false, 'class="sub wand"');
|
html_print_submit_button (__('Copy'), 'go', false, 'class="sub wand"');
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
@ -219,6 +233,9 @@ ui_require_jquery_file ('pandora.controls');
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
var module_alerts;
|
var module_alerts;
|
||||||
|
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||||
|
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
var source_recursion;
|
var source_recursion;
|
||||||
$("#checkbox-source_recursion").click(function () {
|
$("#checkbox-source_recursion").click(function () {
|
||||||
@ -394,7 +411,23 @@ $(document).ready (function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#manage_config_form").submit (function () {
|
$("#manage_config_form").submit (function () {
|
||||||
|
var get_parameters_count = window.location.href.slice(
|
||||||
|
window.location.href.indexOf('?') + 1).split('&').length;
|
||||||
|
var post_parameters_count = $("#manage_config_form").serializeArray().length;
|
||||||
|
|
||||||
|
var count_parameters =
|
||||||
|
get_parameters_count + post_parameters_count;
|
||||||
|
|
||||||
|
if (count_parameters > limit_parameters_massive) {
|
||||||
|
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("h3:not([id=message])").remove ();
|
$("h3:not([id=message])").remove ();
|
||||||
|
|
||||||
if ($("#source_id_agent").attr ("value") == 0) {
|
if ($("#source_id_agent").attr ("value") == 0) {
|
||||||
$("#message").showMessage ("<?php echo __('No source agent to copy') ?>");
|
$("#message").showMessage ("<?php echo __('No source agent to copy') ?>");
|
||||||
return false;
|
return false;
|
||||||
@ -419,6 +452,7 @@ $(document).ready (function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$("#message").hide ();
|
$("#message").hide ();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
17
pandora_console/godmode/massive/massive_delete_agents.php
Normal file → Executable file
17
pandora_console/godmode/massive/massive_delete_agents.php
Normal file → Executable file
@ -143,7 +143,24 @@ ui_require_jquery_file ('pandora.controls');
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
$("#form_agents").submit(function() {
|
||||||
|
var get_parameters_count = window.location.href.slice(
|
||||||
|
window.location.href.indexOf('?') + 1).split('&').length;
|
||||||
|
var post_parameters_count = $("#form_agents").serializeArray().length;
|
||||||
|
|
||||||
|
var count_parameters =
|
||||||
|
get_parameters_count + post_parameters_count;
|
||||||
|
|
||||||
|
if (count_parameters > limit_parameters_massive) {
|
||||||
|
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
var recursion;
|
var recursion;
|
||||||
|
|
||||||
$("#checkbox-recursion").click(function () {
|
$("#checkbox-recursion").click(function () {
|
||||||
|
18
pandora_console/godmode/massive/massive_delete_alerts.php
Normal file → Executable file
18
pandora_console/godmode/massive/massive_delete_alerts.php
Normal file → Executable file
@ -248,7 +248,25 @@ ui_require_jquery_file ('pandora.controls');
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
|
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||||
|
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
$("#form_alerts").submit(function() {
|
||||||
|
var get_parameters_count = window.location.href.slice(
|
||||||
|
window.location.href.indexOf('?') + 1).split('&').length;
|
||||||
|
var post_parameters_count = $("#form_alerts").serializeArray().length;
|
||||||
|
|
||||||
|
var count_parameters =
|
||||||
|
get_parameters_count + post_parameters_count;
|
||||||
|
|
||||||
|
if (count_parameters > limit_parameters_massive) {
|
||||||
|
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$("#id_agents").change(agent_changed_by_multiple_agents_with_alerts);
|
$("#id_agents").change(agent_changed_by_multiple_agents_with_alerts);
|
||||||
|
|
||||||
$("#id_alert_template").change (function () {
|
$("#id_alert_template").change (function () {
|
||||||
|
17
pandora_console/godmode/massive/massive_delete_modules.php
Normal file → Executable file
17
pandora_console/godmode/massive/massive_delete_modules.php
Normal file → Executable file
@ -372,6 +372,9 @@ else {
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
|
|
||||||
|
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||||
$("#module_name").change(module_changed_by_multiple_modules);
|
$("#module_name").change(module_changed_by_multiple_modules);
|
||||||
@ -542,6 +545,20 @@ $(document).ready (function () {
|
|||||||
$("#status_agents").change(function() {
|
$("#status_agents").change(function() {
|
||||||
$("#groups_select").trigger("change");
|
$("#groups_select").trigger("change");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#form_modules").submit(function() {
|
||||||
|
var get_parameters_count = window.location.href.slice(
|
||||||
|
window.location.href.indexOf('?') + 1).split('&').length;
|
||||||
|
var post_parameters_count = $("#form_modules").serializeArray().length;
|
||||||
|
|
||||||
|
var count_parameters =
|
||||||
|
get_parameters_count + post_parameters_count;
|
||||||
|
|
||||||
|
if (count_parameters > limit_parameters_massive) {
|
||||||
|
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
/* ]]> */
|
/* ]]> */
|
||||||
</script>
|
</script>
|
||||||
|
49
pandora_console/godmode/massive/massive_edit_agents.php
Normal file → Executable file
49
pandora_console/godmode/massive/massive_edit_agents.php
Normal file → Executable file
@ -404,8 +404,7 @@ foreach ($fields as $field) {
|
|||||||
$custom_value = '';
|
$custom_value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$data[1] = html_print_textarea ('customvalue_' . $field['id_field'],
|
$data[1] = html_print_textarea ('customvalue_'.$field['id_field'], 2, 65, $custom_value, 'style="min-height: 30px;"', true);
|
||||||
2, 65, $custom_value, 'style="min-height: 30px;"', true);
|
|
||||||
|
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
}
|
}
|
||||||
@ -434,14 +433,30 @@ ui_require_jquery_file ('pandora.controls');
|
|||||||
ui_require_jquery_file ('pandora.controls');
|
ui_require_jquery_file ('pandora.controls');
|
||||||
ui_require_jquery_file ('ajaxqueue');
|
ui_require_jquery_file ('ajaxqueue');
|
||||||
ui_require_jquery_file ('bgiframe');
|
ui_require_jquery_file ('bgiframe');
|
||||||
|
|
||||||
ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
|
|
||||||
|
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||||
|
|
||||||
//Use this function for change 3 icons when change the selectbox
|
//Use this function for change 3 icons when change the selectbox
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
|
||||||
|
$("#form_agent").submit(function() {
|
||||||
|
var get_parameters_count = window.location.href.slice(
|
||||||
|
window.location.href.indexOf('?') + 1).split('&').length;
|
||||||
|
var post_parameters_count = $("#form_agent").serializeArray().length;
|
||||||
|
|
||||||
|
var count_parameters =
|
||||||
|
get_parameters_count + post_parameters_count;
|
||||||
|
|
||||||
|
if (count_parameters > limit_parameters_massive) {
|
||||||
|
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$("#id_agents").change (function () {
|
$("#id_agents").change (function () {
|
||||||
var idAgents = Array();
|
var idAgents = Array();
|
||||||
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
||||||
@ -533,29 +548,7 @@ function changeIcons() {
|
|||||||
$("#icon_bad").attr("style", "");
|
$("#icon_bad").attr("style", "");
|
||||||
$("#icon_warning").attr("style", "");
|
$("#icon_warning").attr("style", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//$("#icon_default").attr("src", "<?php echo $path; ?>" + icon +
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
tinyMCE.init({
|
|
||||||
mode : "exact",
|
|
||||||
elements: <?php
|
|
||||||
|
|
||||||
$elements = array('description');
|
|
||||||
|
|
||||||
foreach ($fields as $field) {
|
|
||||||
$elements[] = 'customvalue_' . $field['id_field'];
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '"' . implode(', ', $elements) . '"';
|
|
||||||
?>,
|
|
||||||
width: 300,
|
|
||||||
theme : "advanced",
|
|
||||||
theme_advanced_path : false,
|
|
||||||
statusbar : false,
|
|
||||||
plugins: "bbcode",
|
|
||||||
theme_advanced_toolbar_location : "top",
|
|
||||||
theme_advanced_toolbar_align : "left",
|
|
||||||
theme_advanced_buttons1 : "undo, redo, | , link, unlink"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
21
pandora_console/godmode/massive/massive_edit_modules.php
Normal file → Executable file
21
pandora_console/godmode/massive/massive_edit_modules.php
Normal file → Executable file
@ -524,7 +524,9 @@ $table->data['edit11'][3] = html_print_input_text(
|
|||||||
ui_print_help_tip (
|
ui_print_help_tip (
|
||||||
__('Seconds that agent will wait for the execution of the module.'), true);
|
__('Seconds that agent will wait for the execution of the module.'), true);
|
||||||
|
|
||||||
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit">';
|
echo '<form method="post" ' .
|
||||||
|
'action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" ' .
|
||||||
|
'id="form_edit">';
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
|
|
||||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||||
@ -551,7 +553,24 @@ else {
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
|
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
|
||||||
|
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
$("#form_edit").submit(function() {
|
||||||
|
var get_parameters_count = window.location.href.slice(
|
||||||
|
window.location.href.indexOf('?') + 1).split('&').length;
|
||||||
|
var post_parameters_count = $("#form_edit").serializeArray().length;
|
||||||
|
|
||||||
|
var count_parameters =
|
||||||
|
get_parameters_count + post_parameters_count;
|
||||||
|
|
||||||
|
if (count_parameters > limit_parameters_massive) {
|
||||||
|
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$("#id_agents").change(agent_changed_by_multiple_agents);
|
$("#id_agents").change(agent_changed_by_multiple_agents);
|
||||||
$("#module_name").change(module_changed_by_multiple_modules);
|
$("#module_name").change(module_changed_by_multiple_modules);
|
||||||
|
|
||||||
|
43
pandora_console/godmode/massive/massive_operations.php
Normal file → Executable file
43
pandora_console/godmode/massive/massive_operations.php
Normal file → Executable file
@ -40,11 +40,6 @@ $options_alerts = array(
|
|||||||
'enable_disable_alerts' => __('Massive alert enable/disable'),
|
'enable_disable_alerts' => __('Massive alert enable/disable'),
|
||||||
'standby_alerts' => __('Massive alert setting standby'));
|
'standby_alerts' => __('Massive alert setting standby'));
|
||||||
|
|
||||||
$options_tags = array(
|
|
||||||
'add_tags' => __('Massive tags addition'),
|
|
||||||
'delete_tags' => __('Massive tags deletion')
|
|
||||||
);
|
|
||||||
|
|
||||||
$options_agents = array(
|
$options_agents = array(
|
||||||
'edit_agents' => __('Massive agents edition'),
|
'edit_agents' => __('Massive agents edition'),
|
||||||
'delete_agents' => __('Massive agents deletion'));
|
'delete_agents' => __('Massive agents deletion'));
|
||||||
@ -94,9 +89,6 @@ if ($satellite_options != ENTERPRISE_NOT_HOOK) {
|
|||||||
if (in_array($option, array_keys($options_alerts))) {
|
if (in_array($option, array_keys($options_alerts))) {
|
||||||
$tab = 'massive_alerts';
|
$tab = 'massive_alerts';
|
||||||
}
|
}
|
||||||
elseif (in_array($option, array_keys($options_tags))) {
|
|
||||||
$tab = 'massive_tags';
|
|
||||||
}
|
|
||||||
elseif (in_array($option, array_keys($options_agents))) {
|
elseif (in_array($option, array_keys($options_agents))) {
|
||||||
$tab = 'massive_agents';
|
$tab = 'massive_agents';
|
||||||
}
|
}
|
||||||
@ -120,9 +112,6 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch ($tab) {
|
switch ($tab) {
|
||||||
case 'massive_tags':
|
|
||||||
$options = $options_tags;
|
|
||||||
break;
|
|
||||||
case 'massive_alerts':
|
case 'massive_alerts':
|
||||||
$options = $options_alerts;
|
$options = $options_alerts;
|
||||||
break;
|
break;
|
||||||
@ -151,29 +140,24 @@ if ($option == '') {
|
|||||||
$option = array_shift(array_keys($options));
|
$option = array_shift(array_keys($options));
|
||||||
}
|
}
|
||||||
|
|
||||||
$tagstab = array('text' =>
|
$alertstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts">'
|
||||||
'<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_tags">' .
|
. html_print_image ('images/op_alerts.png', true,
|
||||||
html_print_image ('images/tag.png', true,
|
array ('title' => __('Alerts operations')))
|
||||||
array('title' => __('Tags operations'))) . '</a>',
|
. '</a>', 'active' => $tab == 'massive_alerts');
|
||||||
'active' => $tab == 'massive_tags');
|
|
||||||
|
|
||||||
|
|
||||||
$alertstab = array('text' =>
|
|
||||||
'<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_alerts">' .
|
|
||||||
html_print_image ('images/op_alerts.png', true,
|
|
||||||
array('title' => __('Alerts operations'))) . '</a>',
|
|
||||||
'active' => $tab == 'massive_alerts');
|
|
||||||
|
|
||||||
$userstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_users">'
|
$userstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_users">'
|
||||||
. html_print_image ('images/op_workspace.png', true, array ('title' => __('Users operations')))
|
. html_print_image ('images/op_workspace.png', true,
|
||||||
|
array ('title' => __('Users operations')))
|
||||||
. '</a>', 'active' => $tab == 'massive_users');
|
. '</a>', 'active' => $tab == 'massive_users');
|
||||||
|
|
||||||
$agentstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_agents">'
|
$agentstab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_agents">'
|
||||||
. html_print_image ('images/bricks.png', true, array ('title' => __('Agents operations')))
|
. html_print_image ('images/bricks.png', true,
|
||||||
|
array ('title' => __('Agents operations')))
|
||||||
. '</a>', 'active' => $tab == 'massive_agents');
|
. '</a>', 'active' => $tab == 'massive_agents');
|
||||||
|
|
||||||
$modulestab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_modules">'
|
$modulestab = array('text' => '<a href="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&tab=massive_modules">'
|
||||||
. html_print_image ('images/brick.png', true, array ('title' => __('Modules operations')))
|
. html_print_image ('images/brick.png', true,
|
||||||
|
array ('title' => __('Modules operations')))
|
||||||
. '</a>', 'active' => $tab == 'massive_modules');
|
. '</a>', 'active' => $tab == 'massive_modules');
|
||||||
|
|
||||||
|
|
||||||
@ -200,7 +184,6 @@ $onheader['massive_modules'] = $modulestab;
|
|||||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||||
$onheader['user_agents'] = $userstab;
|
$onheader['user_agents'] = $userstab;
|
||||||
}
|
}
|
||||||
$onheader['massive_tags'] = $tagstab;
|
|
||||||
$onheader['massive_alerts'] = $alertstab;
|
$onheader['massive_alerts'] = $alertstab;
|
||||||
$onheader['policies'] = $policiestab;
|
$onheader['policies'] = $policiestab;
|
||||||
$onheader['snmp'] = $snmptab;
|
$onheader['snmp'] = $snmptab;
|
||||||
@ -313,12 +296,6 @@ switch ($option) {
|
|||||||
case 'copy_modules':
|
case 'copy_modules':
|
||||||
require_once ('godmode/massive/massive_copy_modules.php');
|
require_once ('godmode/massive/massive_copy_modules.php');
|
||||||
break;
|
break;
|
||||||
case 'add_tags':
|
|
||||||
require_once ('godmode/massive/massive_add_tags.php');
|
|
||||||
break;
|
|
||||||
case 'delete_tags':
|
|
||||||
require_once ('godmode/massive/massive_delete_tags.php');
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
if (!enterprise_hook('massive_operations', array($option))) {
|
if (!enterprise_hook('massive_operations', array($option))) {
|
||||||
require_once ('godmode/massive/massive_config.php');
|
require_once ('godmode/massive/massive_config.php');
|
||||||
|
@ -259,6 +259,12 @@ $table->data[33][0] = __('Allow create planned downtimes in the past') .
|
|||||||
$table->data[33][1] = __('Yes').' '.html_print_radio_button ('past_planned_downtimes', 1, '', $config["past_planned_downtimes"], true).' ';
|
$table->data[33][1] = __('Yes').' '.html_print_radio_button ('past_planned_downtimes', 1, '', $config["past_planned_downtimes"], true).' ';
|
||||||
$table->data[33][1] .= __('No').' '.html_print_radio_button ('past_planned_downtimes', 0, '', $config["past_planned_downtimes"], true);
|
$table->data[33][1] .= __('No').' '.html_print_radio_button ('past_planned_downtimes', 0, '', $config["past_planned_downtimes"], true);
|
||||||
|
|
||||||
|
$table->data[34][0] = __('Limit parameters massive') .
|
||||||
|
ui_print_help_tip(__('Your PHP environment is setted with %d max_input_vars. Maybe you must not set this value with upper values.', ini_get("max_input_vars")), true);
|
||||||
|
$table->data[34][1] = html_print_input_text('limit_parameters_massive',
|
||||||
|
$config['limit_parameters_massive'], '', 10, 10, true);
|
||||||
|
|
||||||
|
|
||||||
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
||||||
|
|
||||||
echo "<fieldset>";
|
echo "<fieldset>";
|
||||||
|
@ -186,6 +186,8 @@ function config_update_config () {
|
|||||||
$error_update[] = __('Tutorial mode');
|
$error_update[] = __('Tutorial mode');
|
||||||
if (!config_update_value ('past_planned_downtimes', get_parameter('past_planned_downtimes')))
|
if (!config_update_value ('past_planned_downtimes', get_parameter('past_planned_downtimes')))
|
||||||
$error_update[] = __('Allow create planned downtimes in the past');
|
$error_update[] = __('Allow create planned downtimes in the past');
|
||||||
|
if (!config_update_value ('limit_parameters_massive', get_parameter('limit_parameters_massive')))
|
||||||
|
$error_update[] = __('Limit parameters massive');
|
||||||
break;
|
break;
|
||||||
case 'enterprise':
|
case 'enterprise':
|
||||||
if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) {
|
if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) {
|
||||||
@ -773,6 +775,10 @@ function config_process_config () {
|
|||||||
config_update_value ('font_size', 6);
|
config_update_value ('font_size', 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset ($config["limit_parameters_massive"])) {
|
||||||
|
config_update_value ('limit_parameters_massive', ini_get("max_input_vars") / 2);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*Parse the ACL IP list for access API
|
*Parse the ACL IP list for access API
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user