2011-08-17 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* include/functions_modules.php: Format decimal numeric data
        in function modules_get_agentmodule when DB is Oracle.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4765 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2011-08-18 10:36:33 +00:00
parent 035c20ca8d
commit 28c0435917
2 changed files with 23 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2011-08-17 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_modules.php: Format decimal numeric data
in function modules_get_agentmodule when DB is Oracle.
2011-08-18 Sergio Martin <sergio.martin@artica.es>
* operation/agentes/estado_generalagente.php: Changed the

View File

@ -448,9 +448,26 @@ function modules_format_delete_log4x($id)
* @return array An array with module information
*/
function modules_get_agentmodule ($id_agentmodule) {
return db_get_row ('tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule);
global $config;
switch ($config['dbtype']){
case "mysql":
case "postgresql":
return db_get_row ('tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule);
break;
case "oracle":
$fields = db_get_all_rows_filter('USER_TAB_COLUMNS', 'TABLE_NAME = \'TAGENTE_MODULO\' AND COLUMN_NAME <> \'MAX_CRITICAL\' AND COLUMN_NAME <> \'MIN_CRITICAL\' AND COLUMN_NAME <> \'POST_PROCESS\' AND COLUMN_NAME <> \'MAX_WARNING\' AND COLUMN_NAME <> \'MIN_WARNING\'', 'COLUMN_NAME');
foreach ($fields as $field){
$fields_[] = $field['column_name'];
}
$fields = implode(',', $fields_);
$result = db_process_sql("SELECT TO_NUMBER(MAX_CRITICAL) as max_critical, TO_NUMBER(MIN_CRITICAL) as min_critical, TO_NUMBER(MAX_WARNING) as max_warning, TO_NUMBER(MIN_WARNING) as min_warning, TO_NUMBER(POST_PROCESS) as post_process, " . $fields . " FROM tagente_modulo WHERE id_agente_modulo = " . $id_agentmodule);
return $result[0];
break;
}
}
/**
* Get a id of module from his name and the agent id
*