2009-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_db.php: add function "get_db_value_sql" for use in alert_list.php and in futures uses. This function returns the first column and first row from a query pass as parameters. * godmode/alerts/alert_list.php: fix bug that you can't add new alerts. Fixes: 2859264 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1943 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
f7278fbd98
commit
8aaa4f5d04
|
@ -1,11 +1,19 @@
|
|||
2009-09-14 Miguel de Dios <miguel.dedios@artica.es>
|
||||
2009-09-15 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_db.php: add function "get_db_value_sql" for use in
|
||||
alert_list.php and in futures uses. This function returns the first column
|
||||
and first row from a query pass as parameters.
|
||||
* godmode/alerts/alert_list.php: fix bug that you can't add new alerts.
|
||||
Fixes: 2859264
|
||||
|
||||
2009-09-15 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/agentes/module_manager.php: change the method for test if a
|
||||
module is a numeric, and can normalize. Now obtain the ids from modules tipe
|
||||
that it's not proc or string, and this ids use to test.
|
||||
Fixes: 2849325
|
||||
|
||||
2009-09-14 Miguel de Dios <miguel.dedios@artica.es>
|
||||
2009-09-15 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/reporting/map_builder.php: change (at the moment) the ajax for
|
||||
delete elements by html static form with select, because sometimes (when you
|
||||
|
|
|
@ -109,7 +109,7 @@ if ($create_alert) {
|
|||
$id_alert_template = (int) get_parameter ('template');
|
||||
$id_agent_module = (int) get_parameter ('id_agent_module');
|
||||
|
||||
if (get_db_row_sql("SELECT COUNT(id)
|
||||
if (get_db_value_sql("SELECT COUNT(id)
|
||||
FROM talert_template_modules
|
||||
WHERE id_agent_module = " . $id_agent_module . "
|
||||
AND id_alert_template = " . $id_alert_template) > 0) {
|
||||
|
|
|
@ -1604,6 +1604,24 @@ function get_db_value_filter ($field, $table, $filter, $where_join = 'AND') {
|
|||
return $result[0][$field];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first value of the first row of a table result from query.
|
||||
*
|
||||
* @param string SQL select statement to execute.
|
||||
*
|
||||
* @return the first value of the first row of a table result from query.
|
||||
*
|
||||
*/
|
||||
function get_db_value_sql ($sql) {
|
||||
$sql .= " LIMIT 1";
|
||||
$result = get_db_all_rows_sql ($sql);
|
||||
|
||||
if($result === false)
|
||||
return false;
|
||||
|
||||
return $result[0][0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first row of an SQL database query.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue