2012-03-24 Junichi Satoh <junichi@rworks.jp>
* include/functions_agents.php, include/functions_config.php, include/db/postgresql.php, operation/agentes/estado_agente.php: Fixed SQL error with PostgreSQL. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5825 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
cac1b42f84
commit
0ade546b40
|
@ -1,3 +1,9 @@
|
|||
2012-03-24 Junichi Satoh <junichi@rworks.jp>
|
||||
|
||||
* include/functions_agents.php, include/functions_config.php,
|
||||
include/db/postgresql.php, operation/agentes/estado_agente.php: Fixed
|
||||
SQL error with PostgreSQL.
|
||||
|
||||
2012-03-24 Junichi Satoh <junichi@rworks.jp>
|
||||
|
||||
* include/help/ja/help_wmifield.php: Fixed wmi field help.
|
||||
|
|
|
@ -278,7 +278,7 @@ function postgresql_db_process_sql($sql, $rettype = "affected_rows", $dbconnecti
|
|||
*/
|
||||
function postgresql_db_get_all_rows_in_table($table, $order_field = "", $order = 'ASC') {
|
||||
if ($order_field != "") {
|
||||
return db_get_all_rows_sql ('SELECT * FROM "'.$table.'" ORDER BY "'.$order_field . '" ' . $order);
|
||||
return db_get_all_rows_sql ('SELECT * FROM "'.$table.'" ORDER BY '.$order_field . ' ' . $order);
|
||||
}
|
||||
else {
|
||||
return db_get_all_rows_sql ('SELECT * FROM "'.$table.'"');
|
||||
|
@ -789,7 +789,7 @@ function postgresql_db_get_all_fields_in_table ($table, $field = '', $condition
|
|||
}
|
||||
|
||||
if ($order_field != "")
|
||||
$sql .= sprintf (" ORDER BY \"%s\"", $order_field);
|
||||
$sql .= sprintf (" ORDER BY %s", $order_field);
|
||||
|
||||
return db_get_all_rows_sql ($sql);
|
||||
}
|
||||
|
|
|
@ -491,13 +491,21 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
|
|||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$limit_sql = '';
|
||||
if(isset($offset) && isset($limit)) {
|
||||
$limit_sql = " LIMIT $offset, $limit ";
|
||||
}
|
||||
$sql = sprintf("%s %s", $sql, $limit_sql);
|
||||
|
||||
$agents = db_get_all_rows_sql($sql);
|
||||
break;
|
||||
case "postgresql":
|
||||
$limit_sql = '';
|
||||
if(isset($offset) && isset($limit)) {
|
||||
$limit_sql = " OFFSET $offset LIMIT $limit ";
|
||||
}
|
||||
$sql = sprintf("%s %s", $sql, $limit_sql);
|
||||
|
||||
$agents = db_get_all_rows_sql($sql);
|
||||
break;
|
||||
case "oracle":
|
||||
|
|
|
@ -677,7 +677,7 @@ function config_check (){
|
|||
$now = date("U");
|
||||
|
||||
// First action in order to know if it's a new installation or db maintenance never have been executed
|
||||
$first_action = db_get_value_filter('utimestamp', 'tsesion', array('1' => '1', 'order' => 'id_sesion ASC'));
|
||||
$first_action = db_get_value_filter('utimestamp', 'tsesion', array('1' => 'true', 'order' => 'id_sesion ASC'));
|
||||
$fresh_installation = $now - $first_action;
|
||||
|
||||
$resta = $now - $db_maintance;
|
||||
|
|
|
@ -301,12 +301,11 @@ $total_agents = 0;
|
|||
$agents = false;
|
||||
|
||||
$total_agents = agents_get_agents(array (
|
||||
'order' => 'nombre ASC',
|
||||
'disabled' => 0,
|
||||
'id_grupo' => $groups,
|
||||
'search' => $search_sql,
|
||||
'status' => $status),
|
||||
array ('COUNT(*) as total'));
|
||||
array ('COUNT(*) as total'), 'AR', false);
|
||||
$total_agents = isset ($total_agents[0]['total']) ? $total_agents[0]['total'] : 0;
|
||||
|
||||
$agents = agents_get_agents(array (
|
||||
|
|
Loading…
Reference in New Issue