Added modals and fixed some bugs

This commit is contained in:
Jose Gonzalez 2021-02-12 11:28:13 +01:00
parent 2521b32f13
commit e727f7c276
19 changed files with 690 additions and 358 deletions

View File

@ -1,17 +1,32 @@
<?php
/**
* View for Add actions alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -195,9 +210,6 @@ $table->data[1][0] .= '</span>';
$table->data[1][1] = html_print_select([], 'id_agents[]', 0, false, __('Any'), '', true, true);
$table->data[2][0] = __('Alert templates');
$table->data[2][0] .= '<span id="template_loading" class="invisible">';
$table->data[2][0] .= html_print_image('images/spinner.png', true);
$table->data[2][0] .= '</span>';
$table->data[2][1] = html_print_select([], 'id_alert_templates[]', '', '', '', '', true, true, true, '', $alert_templates == 0);
$table->data[2][2] = __('When select agents');
$table->data[2][2] .= '<br>';
@ -251,10 +263,8 @@ $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 '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('add', 1);
html_print_submit_button(__('Add'), 'go', false, 'class="sub add"');
echo '</div>';
attachActionButton('add', 'create', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
@ -265,23 +275,8 @@ ui_require_jquery_file('pandora.controls');
?>
<script type="text/javascript">
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(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) {
showMassiveOperationMessage();
return false;
}
});
update_alerts();
@ -320,7 +315,7 @@ $(document).ready (function () {
jQuery.each ($("#id_agents option:selected"), function (i, val) {
idAgents.push($(val).val());
});
$("#template_loading").show();
showSpinner();
var $select_template = $("#id_alert_templates").disable ();
@ -341,7 +336,7 @@ $(document).ready (function () {
}
$("#id_alert_templates").append (options);
$("#template_loading").hide ();
hideSpinner();
$select_template.enable ();
},
"json"

View File

@ -278,10 +278,8 @@ $table->data[2][3] = '';
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;">';
html_print_input_hidden('add', 1);
html_print_submit_button(__('Add'), 'go', false, 'class="sub add"');
echo '</div>';
attachActionButton('add', 'add', $table->width);
echo '</form>';
// TODO: Change to iu_print_error system.
@ -299,7 +297,7 @@ ui_require_jquery_file('pandora.controls');
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(document).ready (function () {
$("#form_alerts").submit(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;
@ -311,7 +309,7 @@ $(document).ready (function () {
alert("<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>");
return false;
}
});
}); */
$("#checkbox-recursion").click(function () {
$("#id_group").trigger("change");
@ -321,7 +319,7 @@ $(document).ready (function () {
$("#id_group").change (function () {
var $select = $("#id_agents").enable ();
$("#agent_loading").show ();
showSpinner();
$("option", $select).remove ();
jQuery.post ("ajax.php",
@ -340,7 +338,7 @@ $(document).ready (function () {
options += "<option value=\""+id+"\">"+value+"</option>";
});
$("#id_agents").append (options);
$("#agent_loading").hide ();
hideSpinner();
$select.enable ();
},
"json"

View File

@ -1,20 +1,34 @@
<?php
/**
* View for Add profiles in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (!check_acl($config['id_user'], 0, 'UM')) {
db_pandora_audit(
'ACL Violation',
@ -219,14 +233,14 @@ $data[2] .= html_print_select(
'width: 100%'
);
// Waiting spinner.
ui_print_spinner(__('Loading'));
array_push($table->data, $data);
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('create_profiles', 1);
html_print_submit_button(__('Create'), 'go', false, 'class="sub add"');
echo '</div>';
attachActionButton('create_profiles', 'update', $table->width);
echo '</form>';

View File

@ -1,17 +1,32 @@
<?php
/**
* View for copy modules in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -294,22 +309,17 @@ echo '<legend><span>'.__('To agent(s)').'</span></legend>';
html_print_table($table);
echo '</fieldset>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
attachActionButton('do_operation', 'copy', $table->width);
html_print_input_hidden('do_operation', 1);
html_print_submit_button(__('Copy'), 'go', false, 'class="sub wand"');
echo '</div>';
echo '</form>';
echo '<h3 class="error invisible" id="message">&nbsp;</h3>';
// Load JS files.
ui_require_javascript_file('pandora_modules');
ui_require_jquery_file('form');
ui_require_jquery_file('pandora.controls');
?>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var module_alerts;
@ -514,7 +524,7 @@ $(document).ready (function () {
});
$("#manage_config_form").submit (function () {
var get_parameters_count = window.location.href.slice(
/* var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $("#manage_config_form").serializeArray().length;
@ -522,9 +532,13 @@ $(document).ready (function () {
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.'); ?>");
alert("
<?php
// echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.');
?>
");
return false;
}
} */

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete action alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -270,10 +285,8 @@ $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 '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete', 'delete', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"></h3>';

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete agents in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -186,11 +201,8 @@ $table->data[2][1] = html_print_select(
echo '<form method="post" id="form_agents" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_agents">';
html_print_table($table);
if (!is_central_policies_on_node()) {
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
if (is_central_policies_on_node() === false) {
attachActionButton('delete', 'delete', $table->width);
}
echo '</form>';
@ -202,24 +214,8 @@ ui_require_jquery_file('pandora.controls');
?>
<script type="text/javascript">
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(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;
$("#checkbox-recursion").click(function () {

View File

@ -1,17 +1,32 @@
<?php
/**
* View for Delete alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -321,10 +336,8 @@ $table->data[2][3] = html_print_select([], 'module[]', '', false, '', '', true,
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.'">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete', 'delete', $table->width);
echo '</form>';
// Hack to translate text "none" in PHP to javascript
@ -371,7 +384,7 @@ $(document).ready (function () {
$("#id_group").change (function () {
var $select = $("#id_agents").disable ();
$("#agent_loading").show ();
showSpinner();
$("option", $select).remove ();
jQuery.post ("ajax.php",
@ -393,7 +406,7 @@ $(document).ready (function () {
options += "<option value=\""+id+"\">"+value+"</option>";
});
$("#id_agents").append (options);
$("#agent_loading").hide ();
hideSpinner();
$select.enable ();
},
"json"

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete modules in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -563,10 +578,8 @@ $table->data['form_agents_3'][3] = html_print_select(
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;">';
html_print_input_hidden('delete', 1);
html_print_submit_button(__('Delete'), 'go', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete', 'delete', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
@ -575,6 +588,9 @@ ui_require_jquery_file('form');
// Hack to translate text "none" in PHP to javascript
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo '<span id ="select_agent_first_text" style="display: none;">'.__('Please, select an agent first').'</span>';
// Load JS files.
ui_require_javascript_file('pandora_modules');
ui_require_jquery_file('pandora.controls');
if ($selection_mode == 'modules') {
@ -586,13 +602,10 @@ if ($selection_mode == 'modules') {
}
?>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
$(document).ready (function () {
$("#checkbox-select_all_modules").change(function() {
if( $('#checkbox-select_all_modules').prop('checked')) {
$("#module_name option").prop('selected', 'selected');
@ -689,7 +702,7 @@ $(document).ready (function () {
}
}
$("#module_loading").show ();
showSpinner();
$("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
$("#module_name").attr ("disabled", "disabled")
$("#module_name option[value!=0]").remove ();
@ -702,7 +715,7 @@ $(document).ready (function () {
.html(value["nombre"]);
$("#module_name").append (option);
});
$("#module_loading").hide();
hideSpinner();
$("#module_name").removeAttr ("disabled");
//Filter modules. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
@ -832,21 +845,7 @@ $(document).ready (function () {
selector = $("#form_edit input[name=selection_mode]:checked").val();
$("#id_agents").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;
}
});
if("<?php echo $delete; ?>"){
if("<?php echo $selection_mode; ?>" == 'agents'){
$("#groups_select").trigger("change");

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete profiles in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'UM')) {
@ -199,16 +214,13 @@ array_push($table->data, $data);
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
html_print_input_hidden('delete_profiles', 1);
html_print_submit_button(__('Delete'), 'del', false, 'class="sub delete"');
echo '</div>';
attachActionButton('delete_profiles', 'delete', $table->width);
echo '</form>';
unset($table);
// TODO: Change to iu_print_error system
// TODO: Change to iu_print_error system.
echo '<h3 class="error invisible" id="message"> </h3>';
ui_require_jquery_file('form');
@ -224,7 +236,7 @@ $(document).ready (function () {
var $select = $("#users_id").disable ();
$("#users_loading").show ();
$("option", $select).remove ();
console.log($("#groups_id").val());
jQuery.post ("ajax.php",
{"page" : "godmode/massive/massive_delete_profiles",
"get_users" : 1,

View File

@ -1,17 +1,32 @@
<?php
/**
* View for edit agents in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -327,13 +342,16 @@ if ($update_agents) {
// Update Custom Fields
foreach ($fields as $field) {
$info[$field['id_field']] = $field['name'];
if (get_parameter_post('customvalue_'.$field['id_field'], '') != '') {
$value = get_parameter('customvalue_'.$field['id_field']);
if (empty($value) === false) {
$key = $field['id_field'];
$value = get_parameter_post('customvalue_'.$field['id_field'], '');
$old_value = db_get_all_rows_filter('tagent_custom_data', ['id_agent' => $id_agent, 'id_field' => $key]);
$old_value = db_get_all_rows_filter(
'tagent_custom_data',
[
'id_agent' => $id_agent,
'id_field' => $key,
]
);
if ($old_value === false) {
// Create custom field if not exist
@ -346,14 +364,16 @@ if ($update_agents) {
]
);
} else {
$result = db_process_sql_update(
'tagent_custom_data',
['description' => $value],
[
'id_field' => $key,
'id_agent' => $id_agent,
]
);
if ($old_value[0]['description'] !== $value) {
$result = db_process_sql_update(
'tagent_custom_data',
['description' => $value],
[
'id_field' => $key,
'id_agent' => $id_agent,
]
);
}
}
}
}
@ -373,7 +393,7 @@ if ($update_agents) {
ui_print_result_message(
$result !== false,
__('Agents updated successfully').'('.$n_edited.')',
__('Agents updated successfully (%d)', $n_edited),
__('Agents cannot be updated (maybe there was no field to update)')
);
}
@ -830,19 +850,16 @@ if (!empty($fields)) {
echo '<h3 class="error invisible" id="message"> </h3>';
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(__('Update'), 'updbutton', false, 'class="sub upd"');
html_print_input_hidden('update_agents', 1);
html_print_input_hidden('id_agente', $id_agente);
echo '</div>';
if (is_central_policies_on_node() === false) {
attachActionButton('update_agents', 'update', $table->width);
}
// Shown and hide div
echo '</div></form>';
ui_require_jquery_file('form');
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('pandora.controls');
ui_require_jquery_file('ajaxqueue');

View File

@ -1,17 +1,32 @@
<?php
/**
* View for edit modules in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -280,9 +295,6 @@ $table->data['selection_mode'][1] .= '<span style="width:110px;display:inline-bl
$table->rowclass['form_modules_1'] = 'select_modules_row';
$table->data['form_modules_1'][0] = __('Module type');
$table->data['form_modules_1'][0] .= '<span id="module_loading" class="invisible">';
$table->data['form_modules_1'][0] .= html_print_image('images/spinner.png', true);
$table->data['form_modules_1'][0] .= '</span>';
$types[0] = __('All');
$table->colspan['form_modules_1'][1] = 2;
@ -1161,31 +1173,37 @@ $table->data['edit1'][1] = '<table width="100%">';
''
);
if (!empty($id_plugin)) {
$preload = db_get_sql("SELECT description FROM tplugin WHERE id = $id_plugin");
if (empty($id_plugin) === false) {
$preload = db_get_sql(
sprintf(
'SELECT description FROM tplugin WHERE id = %s',
$id_plugin
)
);
$preload = io_safe_output($preload);
$preload = str_replace("\n", '<br>', $preload);
} else {
$preload = '';
}
$table->data['edit21'][1] = '<span style="font-weight: normal;" id="plugin_description">'.$preload.'</span>';
$table->data['edit21'][1] = sprintf(
'<span style="font-weight: normal;" id="plugin_description">%s</span>',
$preload
);
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);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('update', 1);
html_print_submit_button(__('Update'), 'go', false, 'class="sub upd"');
echo '</div>';
attachActionButton('update', 'update', $table->width);
echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
// Hack to translate text "none" in PHP to javascript
// Hack to translate text "none" in PHP to javascript.
echo '<span id ="none_text" style="display: none;">'.__('None').'</span>';
echo '<span id ="select_agent_first_text" style="display: none;">'.__('Please, select an agent first').'</span>';
ui_require_javascript_file('massive_operations');
// Load JS files.
ui_require_javascript_file('pandora_modules');
ui_require_jquery_file('pandora.controls');
if ($selection_mode == 'modules') {
@ -1197,27 +1215,11 @@ $table->data['edit1'][1] = '<table width="100%">';
}
?>
<script type="text/javascript">flag_load_plugin_component = false;</script>
<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var limit_parameters_massive = <?php echo $config['limit_parameters_massive']; ?>;
flag_load_plugin_component = false;
$(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) {
showMassiveOperationMessage('<?php echo __('Unsucessful sending the data, please contact with your administrator or make with less elements.'); ?>');
return false;
}
});
$("#checkbox-select_all_modules").change(function() {
if( $('#checkbox-select_all_modules').prop('checked')) {
@ -1341,7 +1343,7 @@ $(document).ready (function () {
}
}
$("#module_loading").show ();
showSpinner();
$("tr#delete_table-edit1, tr#delete_table-edit0, tr#delete_table-edit2").hide ();
$("#module_name").attr ("disabled", "disabled")
$("#module_name option[value!=0]").remove ();
@ -1352,7 +1354,7 @@ $(document).ready (function () {
option = $("<option></option>").attr ("value", value["nombre"]).html (value["nombre"]);
$("#module_name").append (option);
});
$("#module_loading").hide ();
hideSpinner();
$("#module_name").removeAttr ("disabled");
//Filter modules. Call the function when the select is fully loaded.
var textNoData = "<?php echo __('None'); ?>";
@ -1865,7 +1867,6 @@ function changePluginSelect() {
$('#hidden-macros').val(data['base64']);
jQuery.each (data['array'], function (i, macro) {
console.log(macro);
if (macro['desc'] != '') {
$("#delete_table-edit21").after("<tr class='macro_field' id='delete_table-edit"+(80+parseInt(i))+"'><td style='font-weight:bold;'>"+macro['desc']+"<input type='hidden' name='desc"+macro['macro']+"' value='"+macro['desc']+"'></td><td><input type='text' name='"+macro['macro']+"'></td></tr>");
}

View File

@ -1,17 +1,32 @@
<?php
/**
* View for edit plugins in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
global $config;
check_login();
@ -371,10 +386,7 @@ echo '<form method="POST" id="form-massive_plugin_edition"
html_print_table($table);
echo "<div style='text-align: right; width: ".$table->width."'>";
html_print_input_hidden('update', 1);
html_print_submit_button(__('Update'), 'upd-btn', false, 'class="sub upd"');
echo '</div>';
attachActionButton('update', 'update', $table->width);
echo '</form>';

View File

@ -1,17 +1,32 @@
<?php
/**
* View for enable/disable alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {

View File

@ -1,17 +1,32 @@
<?php
/**
* Main view for Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars.
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -26,6 +41,7 @@ if (! check_acl($config['id_user'], 0, 'AW')) {
require_once 'include/functions_agents.php';
require_once 'include/functions_alerts.php';
require_once 'include/functions_modules.php';
require_once 'include/functions_massive_operations.php';
enterprise_include('godmode/massive/massive_operations.php');
@ -325,30 +341,40 @@ html_print_div(
'content' => '',
]
);
// Load common JS files.
ui_require_javascript_file('massive_operations');
?>
<script language="javascript" type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
$('#manage_config_form').submit( function() {
confirm_status =
confirm("<?php echo __('Are you sure?'); ?>");
if (confirm_status)
$("#loading").css("display", "");
else
$('#button-go').click( function(e) {
var limitParametersMassive = <?php echo $config['limit_parameters_massive']; ?>;
var thisForm = e.target.form.id;
var get_parameters_count = window.location.href.slice(
window.location.href.indexOf('?') + 1).split('&').length;
var post_parameters_count = $('#'+thisForm).serializeArray().length;
var totalCount = get_parameters_count + post_parameters_count;
var contents = {};
contents.html = '<?php echo __('No changes have been made because they exceed the maximum allowed (%d). Make fewer changes or contact the administrator.', $config['limit_parameters_massive']); ?>';
contents.title = '<?php echo __('Massive operations'); ?>';
contents.question = '<?php echo __('Are you sure?'); ?>';
contents.ok = '<?php echo __('OK'); ?>';
contents.cancel = '<?php echo __('Cancel'); ?>';
var operation = massiveOperationValidation(contents, totalCount, limitParametersMassive, thisForm);
if (operation == false) {
return false;
}
});
$('[id^=form]').submit( function() {
confirm_status =
confirm("<?php echo __('Are you sure?'); ?>");
if (confirm_status)
showSpinner();
else
return false;
});
hideSpinner();
});
/* ]]> */
</script>
<?php

View File

@ -1,17 +1,32 @@
<?php
/**
* View for delete action alerts in Massive Operations
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
// Begin.
check_login();
if (! check_acl($config['id_user'], 0, 'AW')) {
@ -285,7 +300,7 @@ $(document).ready (function () {
jQuery.each ($("#id_agents option:selected"), function (i, val) {
idAgents.push($(val).val());
});
$("#template_loading").show();
showSpinner();
var $select_template = $("#id_alert_templates").disable ();
$("option", $select_template).remove ();
@ -302,7 +317,7 @@ $(document).ready (function () {
options += "<option value=\""+id+"\">"+value+"</option>";
});
$("#id_alert_templates").append (options);
$("#template_loading").hide ();
hideSpinner();
$select_template.enable ();
},
"json"

View File

@ -0,0 +1,97 @@
<?php
/**
* Massive Operations Functions
*
* @category Configuration
* @package Pandora FMS
* @subpackage Massive Operations
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
/**
* Generate a action button for submit the form.
*
* @param string $action Action to send in form.
* @param string $buttonAction Action of the button: Create, Update or Delete.
* @param string $tableWidth Set the table width for the container.
* @param boolean $return If true, return a formed string.
*
* @return string
*/
function attachActionButton(
string $action,
string $buttonAction,
string $tableWidth,
bool $return=false
) {
switch ($buttonAction) {
case 'add':
$caption = 'Add';
$class = 'add';
break;
case 'copy':
$caption = 'Copy';
$class = 'wand';
break;
case 'create':
$caption = 'Create';
$class = 'upd';
break;
case 'update':
$caption = 'Update';
$class = 'upd';
break;
case 'delete':
$caption = 'Delete';
$class = 'delete';
break;
default:
// Do none.
break;
}
return html_print_div(
[
'class' => 'action-buttons',
'style' => sprintf('width: %s', $tableWidth),
'content' => html_print_input_hidden(
$action,
1
).html_print_button(
__($caption),
'go',
false,
'',
sprintf('class="sub %s"', $class),
true
),
],
$return
);
}

View File

@ -6277,8 +6277,9 @@ function ui_print_reveal_password(string $name, bool $return=false)
/**
* Generate a spinner box for waiting times
* TIP: It's made for Massive Operations, but it migth used in entire project.
*
* @param string $text Text for show in spinner. English Loading for default.
* @param string $text Text for show in spinner. English term Loading for default.
* @param boolean $return If true, return the string with the formed element.
*
* @return string

View File

@ -0,0 +1,93 @@
/** global $ */
function massiveOperationValidation(contents, totalCount, limit, thisForm) {
var output = false;
// If the amount of changes exceed the limit, the operation stops.
if (totalCount > limit) {
// Set the content.
$("#massive_modal")
.empty()
.html(contents.html);
// Set the title.
$("#massive_modal").prop("title", contents.title);
// Build the dialog for show the mesage.
$("#massive_modal").dialog({
resizable: true,
draggable: true,
modal: true,
width: 800,
buttons: [
{
text: "OK",
click: function() {
hideSpinner();
$(this).dialog("close");
return false;
}
}
],
overlay: {
opacity: 0.5,
background: "black"
},
closeOnEscape: false,
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
}
});
return false;
} else {
confirmDialog({
title: contents.title,
message: contents.question,
ok: contents.ok,
cancel: contents.cancel,
onAccept: function() {
showSpinner();
output = true;
$("#" + thisForm).submit();
},
onDeny: function() {
hideSpinner();
return false;
}
});
}
return output;
}
/*
function showMassiveOperationMessage(message) {
$("#massive_modal")
.empty()
.html(message);
$("#massive_modal").prop("title", "Massive operations");
$("#massive_modal").dialog({
resizable: true,
draggable: true,
modal: true,
width: 800,
buttons: [
{
text: "OK",
click: function() {
$(this).dialog("close");
hideSpinner();
}
}
],
overlay: {
opacity: 0.5,
background: "black"
},
closeOnEscape: false,
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
}
});
}
*/

View File

@ -813,6 +813,7 @@ p.center {
border: 2px solid #82b92e;
box-shadow: 2px 2px 2px #9dbba1;
padding: 20px;
z-index: 100;
}
.tactical_set legend {