2009-12-24 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_ui.php: fix bug that show SQL error message and don't
	show the actions for compound alerts.
	* include/functions_alerts.php: in function "get_alert_agent_module_actions"
	add the parameter compound for search compound actions.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2241 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2009-12-24 15:57:09 +00:00
parent 3bf4edbdf8
commit a4c4773bba
3 changed files with 23 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2009-12-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: fix bug that show SQL error message and don't
show the actions for compound alerts.
* include/functions_alerts.php: in function "get_alert_agent_module_actions"
add the parameter compound for search compound actions.
2009-12-24 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor_common.php,

View File

@ -504,13 +504,20 @@ function delete_alert_agent_module_action ($id_alert_agent_module_action) {
array ('id' => $id_alert_agent_module_action))) !== false;
}
function get_alert_agent_module_actions ($id_alert_agent_module, $fields = false) {
function get_alert_agent_module_actions ($id_alert_agent_module, $fields = false, $compound = false) {
if (empty ($id_alert_agent_module))
return false;
$actions = get_db_all_rows_filter ('talert_template_module_actions',
array ('id_alert_template_module' => $id_alert_agent_module),
if ($compound) {
$actions = get_db_all_rows_filter ('talert_compound_actions',
array ('id_alert_compound' => $id_alert_agent_module),
$fields);
}
else {
$actions = get_db_all_rows_filter ('talert_template_module_actions',
array ('id_alert_template_module' => $id_alert_agent_module),
$fields);
}
if ($actions === false)
return array ();
if ($fields !== false)

View File

@ -366,13 +366,15 @@ function format_alert_row ($alert, $compound = false, $agent = true, $url = '')
$data[$index['template']] .= '<a class="template_details" href="ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$template['id'].'">';
$data[$index['template']] .= print_image ('images/zoom.png', true);
$data[$index['template']] .= '</a> ';
$actionDefault = get_db_value_sql("SELECT id_alert_action
FROM talert_templates WHERE id = " . $alert['id_alert_template']);
}
else {
$actionDefault = get_db_value_sql("SELECT id_alert_action FROM talert_compound_actions WHERE id_alert_compound = " . $alert['id']);
}
$data[$index['description']] .= $disabledHtmlStart . mb_substr (safe_input ($description), 0, 35) . $disabledHtmlEnd;
$actionDefault = get_db_value_sql("SELECT id_alert_action
FROM talert_templates WHERE id = " . $alert['id_alert_template']);
$actions = get_alert_agent_module_actions ($alert['id']);
$actions = get_alert_agent_module_actions ($alert['id'], false, $compound);
$actionText = '<ul>';
foreach ($actions as $action) {
$defaultTagIni = $defaultTagEnd = '';