2010-10-08 Junichi Satoh <junichi@rworks.jp>
* godmode/massive/massive_add_action_alerts.php, godmode/massive/massive_delete_action_alerts.php: Added simple and compound alerts selections. * include/functions_alerts.php: Added new function, get_alert_compounds(). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3367 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e53038088d
commit
73f475bb04
|
@ -1,3 +1,11 @@
|
||||||
|
2010-10-08 Junichi Satoh <junichi@rworks.jp>
|
||||||
|
|
||||||
|
* godmode/massive/massive_add_action_alerts.php,
|
||||||
|
godmode/massive/massive_delete_action_alerts.php: Added simple and
|
||||||
|
compound alerts selections.
|
||||||
|
|
||||||
|
* include/functions_alerts.php: Added new function, get_alert_compounds().
|
||||||
|
|
||||||
2010-10-07 Sancho Lerena <slerena@artica.es>
|
2010-10-07 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
* godmode/alerts/alert_list.list.php: Another ugly warning fixed due
|
* godmode/alerts/alert_list.list.php: Another ugly warning fixed due
|
||||||
|
|
|
@ -26,8 +26,40 @@ if (! give_acl ($config['id_user'], 0, "AW")) {
|
||||||
require_once ('include/functions_agents.php');
|
require_once ('include/functions_agents.php');
|
||||||
require_once ('include/functions_alerts.php');
|
require_once ('include/functions_alerts.php');
|
||||||
|
|
||||||
|
if (is_ajax ()) {
|
||||||
|
$get_alerts = (bool) get_parameter ('get_alerts');
|
||||||
|
|
||||||
|
if ($get_alerts) {
|
||||||
|
$id_agents = get_parameter ('id_agents');
|
||||||
|
if (empty($id_agents)) {
|
||||||
|
echo json_encode ('');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$get_compounds = get_parameter ('get_compounds');
|
||||||
|
if (!$get_compounds) {
|
||||||
|
$alert_templates = get_agent_alerts_simple ($id_agents);
|
||||||
|
echo json_encode (index_array ($alert_templates, 'id_alert_template', 'template_name'));
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
$filter = '';
|
||||||
|
foreach ($id_agents as $id_agent) {
|
||||||
|
if ($filter != '') {
|
||||||
|
$filter .= ' OR ';
|
||||||
|
}
|
||||||
|
$filter .= 'id_agent=' . $id_agent;
|
||||||
|
};
|
||||||
|
$alert_compounds = get_alert_compounds ($filter, array('id', 'name'));
|
||||||
|
echo json_encode (index_array ($alert_compounds, 'id', 'name'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$id_group = (int) get_parameter ('id_group');
|
$id_group = (int) get_parameter ('id_group');
|
||||||
$id_agents = get_parameter ('id_agents');
|
$id_agents = get_parameter ('id_agents');
|
||||||
|
$id_alert_templates = (array) get_parameter ('id_alert_templates');
|
||||||
|
$id_alert_compounds = (array) get_parameter ('id_alert_compounds');
|
||||||
|
|
||||||
$add = (bool) get_parameter_post ('add');
|
$add = (bool) get_parameter_post ('add');
|
||||||
|
|
||||||
|
@ -44,16 +76,20 @@ if ($add) {
|
||||||
$cont = 0;
|
$cont = 0;
|
||||||
$agent_alerts_id = array();
|
$agent_alerts_id = array();
|
||||||
foreach($agent_alerts['simple'] as $agent_alert){
|
foreach($agent_alerts['simple'] as $agent_alert){
|
||||||
|
if (in_array($agent_alert['id_alert_template'], $id_alert_templates)) {
|
||||||
$agent_alerts_id[$cont] = $agent_alert['id'];
|
$agent_alerts_id[$cont] = $agent_alert['id'];
|
||||||
$cont = $cont + 1;
|
$cont = $cont + 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$cont = 0;
|
$cont = 0;
|
||||||
$agent_alerts_id_compound = array();
|
$agent_alerts_id_compound = array();
|
||||||
foreach($agent_alerts['compounds'] as $agent_alert){
|
foreach($agent_alerts['compounds'] as $agent_alert){
|
||||||
|
if (in_array($agent_alert['id'], $id_alert_compounds)) {
|
||||||
$agent_alerts_id_compound[$cont] = $agent_alert['id'];
|
$agent_alerts_id_compound[$cont] = $agent_alert['id'];
|
||||||
$cont = $cont + 1;
|
$cont = $cont + 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$options = array();
|
$options = array();
|
||||||
|
|
||||||
|
@ -62,6 +98,9 @@ if ($add) {
|
||||||
if($fires_max > 0)
|
if($fires_max > 0)
|
||||||
$options['fires_max'] = $fires_max;
|
$options['fires_max'] = $fires_max;
|
||||||
|
|
||||||
|
if (empty($agent_alerts_id) && empty($agent_alerts_id_compound)) {
|
||||||
|
print_result_message (false, '', __('Could not be added').". ".__('No alerts selected'));
|
||||||
|
} else {
|
||||||
$results = true;
|
$results = true;
|
||||||
foreach($agent_alerts_id as $agent_alert_id){
|
foreach($agent_alerts_id as $agent_alert_id){
|
||||||
$result = add_alert_agent_module_action($agent_alert_id, $action, $options);
|
$result = add_alert_agent_module_action($agent_alert_id, $action, $options);
|
||||||
|
@ -77,6 +116,7 @@ if ($add) {
|
||||||
|
|
||||||
print_result_message ($results, __('Successfully added'), __('Could not be added'));
|
print_result_message ($results, __('Successfully added'), __('Could not be added'));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
print_result_message (false, '', __('Could not be added').". ".__('No action selected'));
|
print_result_message (false, '', __('Could not be added').". ".__('No action selected'));
|
||||||
}
|
}
|
||||||
|
@ -108,17 +148,46 @@ $table->data[1][0] .= '</span>';
|
||||||
$table->data[1][1] = print_select (get_group_agents ($id_group, false, "none"),
|
$table->data[1][1] = print_select (get_group_agents ($id_group, false, "none"),
|
||||||
'id_agents[]', 0, false, '', '', true, true);
|
'id_agents[]', 0, false, '', '', true, true);
|
||||||
|
|
||||||
|
if (empty($id_agents)) {
|
||||||
|
$alert_templates = '';
|
||||||
|
} else {
|
||||||
|
$alert_templates = get_agent_alerts_simple ($id_agents);
|
||||||
|
}
|
||||||
|
$table->data[2][0] = __('Alert templates');
|
||||||
|
$table->data[2][0] .= '<span id="template_loading" class="invisible">';
|
||||||
|
$table->data[2][0] .= '<img src="images/spinner.png" />';
|
||||||
|
$table->data[2][0] .= '</span>';
|
||||||
|
$table->data[2][1] = print_select (index_array ($alert_templates, 'id_alert_template', 'template_name'), 'id_alert_templates[]', '', '', '', '', true, true, true, '', $alert_templates == 0);
|
||||||
|
|
||||||
|
if (empty($id_agents)) {
|
||||||
|
$alert_compounds = '';
|
||||||
|
} else {
|
||||||
|
$filter = '';
|
||||||
|
foreach ($id_agents as $id_agent) {
|
||||||
|
if ($filter != '') {
|
||||||
|
$filter .= ' OR ';
|
||||||
|
}
|
||||||
|
$filter .= 'id_agent=' . $id_agent;
|
||||||
|
};
|
||||||
|
$alert_compounds = get_alert_compounds ($filter, array('id', 'name'));
|
||||||
|
}
|
||||||
|
$table->data[3][0] = __('Alert compounds');
|
||||||
|
$table->data[3][0] .= '<span id="compound_loading" class="invisible">';
|
||||||
|
$table->data[3][0] .= '<img src="images/spinner.png" />';
|
||||||
|
$table->data[3][0] .= '</span>';
|
||||||
|
$table->data[3][1] = print_select (index_array ($alert_compounds, 'id', 'name'), 'id_alert_compounds[]', '', false, '', '', true, true, true, '', $alert_compounds == 0);
|
||||||
|
|
||||||
$actions = get_alert_actions ();
|
$actions = get_alert_actions ();
|
||||||
$table->data[2][0] = __('Action');
|
$table->data[4][0] = __('Action');
|
||||||
$table->data[2][1] = print_select ($actions, 'action', '', '', __('None'), 0, true);
|
$table->data[4][1] = print_select ($actions, 'action', '', '', __('None'), 0, true);
|
||||||
$table->data[2][1] .= '<span><a href="#" class="show_advanced_actions">'.__('Advanced options').' » </a></span>';
|
$table->data[4][1] .= '<span><a href="#" class="show_advanced_actions">'.__('Advanced options').' » </a></span>';
|
||||||
$table->data[2][1] .= '<span id="advanced_actions" class="advanced_actions invisible">';
|
$table->data[4][1] .= '<span id="advanced_actions" class="advanced_actions invisible">';
|
||||||
$table->data[2][1] .= __('Number of alerts match from').' ';
|
$table->data[4][1] .= __('Number of alerts match from').' ';
|
||||||
$table->data[2][1] .= print_input_text ('fires_min', 0, '', 4, 10, true);
|
$table->data[4][1] .= print_input_text ('fires_min', 0, '', 4, 10, true);
|
||||||
$table->data[2][1] .= ' '.__('to').' ';
|
$table->data[4][1] .= ' '.__('to').' ';
|
||||||
$table->data[2][1] .= print_input_text ('fires_max', 0, '', 4, 10, true);
|
$table->data[4][1] .= print_input_text ('fires_max', 0, '', 4, 10, true);
|
||||||
$table->data[2][1] .= print_help_icon ("alert-matches", true);
|
$table->data[4][1] .= print_help_icon ("alert-matches", true);
|
||||||
$table->data[2][1] .= '</span>';
|
$table->data[4][1] .= '</span>';
|
||||||
|
|
||||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/massive/massive_operations&option=add_action_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
|
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/massive/massive_operations&option=add_action_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
|
||||||
print_table ($table);
|
print_table ($table);
|
||||||
|
@ -137,10 +206,72 @@ require_jquery_file ('pandora.controls');
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
update_alerts();
|
||||||
|
|
||||||
$("#id_group").pandoraSelectGroupAgent ({
|
$("#id_group").pandoraSelectGroupAgent ({
|
||||||
agentSelect: "select#id_agents"
|
agentSelect: "select#id_agents",
|
||||||
|
callbackPost: function () {
|
||||||
|
var $select_template = $("#id_alert_templates").disable ();
|
||||||
|
var $select_compound = $("#id_alert_compounds").disable ();
|
||||||
|
$("option", $select_template).remove ();
|
||||||
|
$("option", $select_compound).remove ();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#id_agents").change (function () {
|
||||||
|
update_alerts();
|
||||||
|
});
|
||||||
|
|
||||||
|
function update_alerts() {
|
||||||
|
var idAgents = Array();
|
||||||
|
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
||||||
|
idAgents.push($(val).val());
|
||||||
|
});
|
||||||
|
$("#template_loading").show();
|
||||||
|
$("#compound_loading").show();
|
||||||
|
|
||||||
|
var $select_template = $("#id_alert_templates").disable ();
|
||||||
|
var $select_compound = $("#id_alert_compounds").disable ();
|
||||||
|
$("option", $select_template).remove ();
|
||||||
|
$("option", $select_compound).remove ();
|
||||||
|
|
||||||
|
jQuery.post ("ajax.php",
|
||||||
|
{"page" : "godmode/massive/massive_add_action_alerts",
|
||||||
|
"get_alerts" : 1,
|
||||||
|
"get_compounds" : 0,
|
||||||
|
"id_agents[]" : idAgents
|
||||||
|
},
|
||||||
|
function (data, status) {
|
||||||
|
options = "";
|
||||||
|
jQuery.each (data, function (id, value) {
|
||||||
|
options += "<option value=\""+id+"\">"+value+"</option>";
|
||||||
|
});
|
||||||
|
$("#id_alert_templates").append (options);
|
||||||
|
$("#template_loading").hide ();
|
||||||
|
$select_template.enable ();
|
||||||
|
},
|
||||||
|
"json"
|
||||||
|
);
|
||||||
|
|
||||||
|
jQuery.post ("ajax.php",
|
||||||
|
{"page" : "godmode/massive/massive_add_action_alerts",
|
||||||
|
"get_alerts" : 1,
|
||||||
|
"get_compounds" : 1,
|
||||||
|
"id_agents[]" : idAgents
|
||||||
|
},
|
||||||
|
function (data, status) {
|
||||||
|
options = "";
|
||||||
|
jQuery.each (data, function (id, value) {
|
||||||
|
options += "<option value=\""+id+"\">"+value+"</option>";
|
||||||
|
});
|
||||||
|
$("#id_alert_compounds").append (options);
|
||||||
|
$("#compound_loading").hide ();
|
||||||
|
$select_compound.enable ();
|
||||||
|
},
|
||||||
|
"json"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$("a.show_advanced_actions").click (function () {
|
$("a.show_advanced_actions").click (function () {
|
||||||
/* It can be done in two different sites, so it must use two different selectors */
|
/* It can be done in two different sites, so it must use two different selectors */
|
||||||
actions = $(this).parents ("form").children ("span.advanced_actions");
|
actions = $(this).parents ("form").children ("span.advanced_actions");
|
||||||
|
|
|
@ -26,8 +26,40 @@ if (! give_acl ($config['id_user'], 0, "AW")) {
|
||||||
require_once ('include/functions_agents.php');
|
require_once ('include/functions_agents.php');
|
||||||
require_once ('include/functions_alerts.php');
|
require_once ('include/functions_alerts.php');
|
||||||
|
|
||||||
|
if (is_ajax ()) {
|
||||||
|
$get_alerts = (bool) get_parameter ('get_alerts');
|
||||||
|
|
||||||
|
if ($get_alerts) {
|
||||||
|
$id_agents = get_parameter ('id_agents');
|
||||||
|
if (empty($id_agents)) {
|
||||||
|
echo json_encode ('');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$get_compounds = get_parameter ('get_compounds');
|
||||||
|
if (!$get_compounds) {
|
||||||
|
$alert_templates = get_agent_alerts_simple ($id_agents);
|
||||||
|
echo json_encode (index_array ($alert_templates, 'id_alert_template', 'template_name'));
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
$filter = '';
|
||||||
|
foreach ($id_agents as $id_agent) {
|
||||||
|
if ($filter != '') {
|
||||||
|
$filter .= ' OR ';
|
||||||
|
}
|
||||||
|
$filter .= 'id_agent=' . $id_agent;
|
||||||
|
};
|
||||||
|
$alert_compounds = get_alert_compounds ($filter, array('id', 'name'));
|
||||||
|
echo json_encode (index_array ($alert_compounds, 'id', 'name'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$id_group = (int) get_parameter ('id_group');
|
$id_group = (int) get_parameter ('id_group');
|
||||||
$id_agents = get_parameter ('id_agents');
|
$id_agents = get_parameter ('id_agents');
|
||||||
|
$id_alert_templates = (array) get_parameter ('id_alert_templates');
|
||||||
|
$id_alert_compounds = (array) get_parameter ('id_alert_compounds');
|
||||||
|
|
||||||
$delete = (bool) get_parameter_post ('delete');
|
$delete = (bool) get_parameter_post ('delete');
|
||||||
|
|
||||||
|
@ -42,17 +74,23 @@ if ($delete) {
|
||||||
|
|
||||||
$alerts_agent_modules = array();
|
$alerts_agent_modules = array();
|
||||||
foreach($agent_alerts['simple'] as $agent_alert){
|
foreach($agent_alerts['simple'] as $agent_alert){
|
||||||
|
if (in_array($agent_alert['id_alert_template'], $id_alert_templates)) {
|
||||||
$alerts_agent_modules = array_merge($alerts_agent_modules, get_alerts_agent_module ($agent_alert['id_agent_module'], true, false, 'id'));
|
$alerts_agent_modules = array_merge($alerts_agent_modules, get_alerts_agent_module ($agent_alert['id_agent_module'], true, false, 'id'));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$cont = 0;
|
$cont = 0;
|
||||||
$alerts_compound = array();
|
$alerts_compound = array();
|
||||||
foreach($agent_alerts['compounds'] as $agent_alert){
|
foreach($agent_alerts['compounds'] as $agent_alert){
|
||||||
|
if (in_array($agent_alert['id'], $id_alert_compounds)) {
|
||||||
$alerts_compound[$cont] = $agent_alert['id'];
|
$alerts_compound[$cont] = $agent_alert['id'];
|
||||||
$cont = $cont + 1;
|
$cont = $cont + 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($alerts_agent_modules) && empty($alerts_compound)) {
|
||||||
|
print_result_message (false, '', __('Could not be deleted').". ".__('No alerts selected'));
|
||||||
|
} else {
|
||||||
$results = true;
|
$results = true;
|
||||||
$agent_module_actions = array();
|
$agent_module_actions = array();
|
||||||
|
|
||||||
|
@ -82,6 +120,7 @@ if ($delete) {
|
||||||
|
|
||||||
print_result_message ($results, __('Successfully deleted'), __('Could not be deleted')/*.": ". $agent_alerts['simple'][0]['id']*/);
|
print_result_message ($results, __('Successfully deleted'), __('Could not be deleted')/*.": ". $agent_alerts['simple'][0]['id']*/);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
print_result_message (false, '', __('Could not be deleted').". ".__('No action selected'));
|
print_result_message (false, '', __('Could not be deleted').". ".__('No action selected'));
|
||||||
}
|
}
|
||||||
|
@ -113,9 +152,38 @@ $table->data[1][0] .= '</span>';
|
||||||
$table->data[1][1] = print_select (get_group_agents ($id_group, false, "none"),
|
$table->data[1][1] = print_select (get_group_agents ($id_group, false, "none"),
|
||||||
'id_agents[]', 0, false, '', '', true, true);
|
'id_agents[]', 0, false, '', '', true, true);
|
||||||
|
|
||||||
|
if (empty($id_agents)) {
|
||||||
|
$alert_templates = '';
|
||||||
|
} else {
|
||||||
|
$alert_templates = get_agent_alerts_simple ($id_agents);
|
||||||
|
}
|
||||||
|
$table->data[2][0] = __('Alert templates');
|
||||||
|
$table->data[2][0] .= '<span id="template_loading" class="invisible">';
|
||||||
|
$table->data[2][0] .= '<img src="images/spinner.png" />';
|
||||||
|
$table->data[2][0] .= '</span>';
|
||||||
|
$table->data[2][1] = print_select (index_array ($alert_templates, 'id_alert_template', 'template_name'), 'id_alert_templates[]', '', '', '', '', true, true, true, '', $alert_templates == 0);
|
||||||
|
|
||||||
|
if (empty($id_agents)) {
|
||||||
|
$alert_compounds = '';
|
||||||
|
} else {
|
||||||
|
$filter = '';
|
||||||
|
foreach ($id_agents as $id_agent) {
|
||||||
|
if ($filter != '') {
|
||||||
|
$filter .= ' OR ';
|
||||||
|
}
|
||||||
|
$filter .= 'id_agent=' . $id_agent;
|
||||||
|
};
|
||||||
|
$alert_compounds = get_alert_compounds ($filter, array('id', 'name'));
|
||||||
|
}
|
||||||
|
$table->data[3][0] = __('Alert compounds');
|
||||||
|
$table->data[3][0] .= '<span id="compound_loading" class="invisible">';
|
||||||
|
$table->data[3][0] .= '<img src="images/spinner.png" />';
|
||||||
|
$table->data[3][0] .= '</span>';
|
||||||
|
$table->data[3][1] = print_select (index_array ($alert_compounds, 'id', 'name'), 'id_alert_compounds[]', '', false, '', '', true, true, true, '', $alert_compounds == 0);
|
||||||
|
|
||||||
$actions = get_alert_actions ();
|
$actions = get_alert_actions ();
|
||||||
$table->data[2][0] = __('Action');
|
$table->data[4][0] = __('Action');
|
||||||
$table->data[2][1] = print_select ($actions, 'action', '', '', __('None'), 0, true);
|
$table->data[4][1] = print_select ($actions, 'action', '', '', __('None'), 0, true);
|
||||||
|
|
||||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/massive/massive_operations&option=delete_action_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
|
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/massive/massive_operations&option=delete_action_alerts" onsubmit="if (! confirm(\''.__('Are you sure?').'\')) return false;">';
|
||||||
print_table ($table);
|
print_table ($table);
|
||||||
|
@ -134,9 +202,71 @@ require_jquery_file ('pandora.controls');
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
update_alerts();
|
||||||
|
|
||||||
$("#id_group").pandoraSelectGroupAgent ({
|
$("#id_group").pandoraSelectGroupAgent ({
|
||||||
agentSelect: "select#id_agents"
|
agentSelect: "select#id_agents",
|
||||||
|
callbackPost: function () {
|
||||||
|
var $select_template = $("#id_alert_templates").disable ();
|
||||||
|
var $select_compound = $("#id_alert_compounds").disable ();
|
||||||
|
$("option", $select_template).remove ();
|
||||||
|
$("option", $select_compound).remove ();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#id_agents").change (function () {
|
||||||
|
update_alerts();
|
||||||
|
});
|
||||||
|
|
||||||
|
function update_alerts() {
|
||||||
|
var idAgents = Array();
|
||||||
|
jQuery.each ($("#id_agents option:selected"), function (i, val) {
|
||||||
|
idAgents.push($(val).val());
|
||||||
|
});
|
||||||
|
$("#template_loading").show();
|
||||||
|
$("#compound_loading").show();
|
||||||
|
|
||||||
|
var $select_template = $("#id_alert_templates").disable ();
|
||||||
|
var $select_compound = $("#id_alert_compounds").disable ();
|
||||||
|
$("option", $select_template).remove ();
|
||||||
|
$("option", $select_compound).remove ();
|
||||||
|
|
||||||
|
jQuery.post ("ajax.php",
|
||||||
|
{"page" : "godmode/massive/massive_delete_action_alerts",
|
||||||
|
"get_alerts" : 1,
|
||||||
|
"get_compounds" : 0,
|
||||||
|
"id_agents[]" : idAgents
|
||||||
|
},
|
||||||
|
function (data, status) {
|
||||||
|
options = "";
|
||||||
|
jQuery.each (data, function (id, value) {
|
||||||
|
options += "<option value=\""+id+"\">"+value+"</option>";
|
||||||
|
});
|
||||||
|
$("#id_alert_templates").append (options);
|
||||||
|
$("#template_loading").hide ();
|
||||||
|
$select_template.enable ();
|
||||||
|
},
|
||||||
|
"json"
|
||||||
|
);
|
||||||
|
|
||||||
|
jQuery.post ("ajax.php",
|
||||||
|
{"page" : "godmode/massive/massive_delete_action_alerts",
|
||||||
|
"get_alerts" : 1,
|
||||||
|
"get_compounds" : 1,
|
||||||
|
"id_agents[]" : idAgents
|
||||||
|
},
|
||||||
|
function (data, status) {
|
||||||
|
options = "";
|
||||||
|
jQuery.each (data, function (id, value) {
|
||||||
|
options += "<option value=\""+id+"\">"+value+"</option>";
|
||||||
|
});
|
||||||
|
$("#id_alert_compounds").append (options);
|
||||||
|
$("#compound_loading").hide ();
|
||||||
|
$select_compound.enable ();
|
||||||
|
},
|
||||||
|
"json"
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
/* ]]> */
|
/* ]]> */
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -764,6 +764,10 @@ function add_alert_compound_element ($id_alert_compound, $id_alert_template_modu
|
||||||
return @process_sql_insert ('talert_compound_elements', $values);
|
return @process_sql_insert ('talert_compound_elements', $values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_alert_compounds ($filter = false, $fields = false) {
|
||||||
|
return @get_db_all_rows_filter ('talert_compound', $filter, $fields);
|
||||||
|
}
|
||||||
|
|
||||||
function get_alert_compound ($id_alert_compound) {
|
function get_alert_compound ($id_alert_compound) {
|
||||||
return get_db_row ('talert_compound', 'id', $id_alert_compound);
|
return get_db_row ('talert_compound', 'id', $id_alert_compound);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue