From c5d80cd10416b451068811c5ade12bb7360094cf Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Mon, 18 May 2015 18:05:09 +0200 Subject: [PATCH] Added history database support to the function '*_get_value_filter' --- pandora_console/include/db/mysql.php | 4 ++-- pandora_console/include/db/oracle.php | 4 ++-- pandora_console/include/db/postgresql.php | 4 ++-- pandora_console/include/functions_db.php | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index 2dee75f0bc..8dde18da04 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -395,7 +395,7 @@ function mysql_encapsule_fields_with_same_name_to_instructions($field) { * * @return mixed Value of first column of the first row. False if there were no row. */ -function mysql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND') { +function mysql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND', $search_history_db = false) { if (! is_array ($filter) || empty ($filter)) return false; @@ -407,7 +407,7 @@ function mysql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND' $field, $table, db_format_array_where_clause_sql ($filter, $where_join)); - $result = db_get_all_rows_sql ($sql); + $result = db_get_all_rows_sql ($sql, $search_history_db); if ($result === false) return false; diff --git a/pandora_console/include/db/oracle.php b/pandora_console/include/db/oracle.php index c45fe94342..907f0a479b 100644 --- a/pandora_console/include/db/oracle.php +++ b/pandora_console/include/db/oracle.php @@ -483,7 +483,7 @@ function oracle_encapsule_fields_with_same_name_to_instructions($field) { * * @return mixed Value of first column of the first row. False if there were no row. */ -function oracle_db_get_value_filter ($field, $table, $filter, $where_join = 'AND') { +function oracle_db_get_value_filter ($field, $table, $filter, $where_join = 'AND', $search_history_db = false) { if (! is_array ($filter) || empty ($filter)) return false; @@ -494,7 +494,7 @@ function oracle_db_get_value_filter ($field, $table, $filter, $where_join = 'AND $sql = sprintf ("SELECT * FROM (SELECT %s FROM %s WHERE %s) WHERE rownum < 2", $field, $table, db_format_array_where_clause_sql ($filter, $where_join)); - $result = db_get_all_rows_sql ($sql); + $result = db_get_all_rows_sql ($sql, $search_history_db); if ($result === false) return false; diff --git a/pandora_console/include/db/postgresql.php b/pandora_console/include/db/postgresql.php index eeb5ae45ee..3dd4816ed6 100644 --- a/pandora_console/include/db/postgresql.php +++ b/pandora_console/include/db/postgresql.php @@ -404,7 +404,7 @@ function postgresql_encapsule_fields_with_same_name_to_instructions($field) { * * @return mixed Value of first column of the first row. False if there were no row. */ -function postgresql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND') { +function postgresql_db_get_value_filter ($field, $table, $filter, $where_join = 'AND', $search_history_db = false) { if (! is_array ($filter) || empty ($filter)) return false; @@ -427,7 +427,7 @@ function postgresql_db_get_value_filter ($field, $table, $filter, $where_join = $field, $table, db_format_array_where_clause_sql ($filter, $where_join)); - $result = db_get_all_rows_sql ($sql); + $result = db_get_all_rows_sql ($sql, $search_history_db); if ($result === false) return false; diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 983fd6bb75..f9dc206877 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -271,18 +271,18 @@ function db_get_value($field, $table, $field_search = 1, $condition = 1, $search * * @return mixed Value of first column of the first row. False if there were no row. */ -function db_get_value_filter ($field, $table, $filter, $where_join = 'AND') { +function db_get_value_filter ($field, $table, $filter, $where_join = 'AND', $search_history_db = false) { global $config; switch ($config["dbtype"]) { case "mysql": - return mysql_db_get_value_filter($field, $table, $filter, $where_join); + return mysql_db_get_value_filter($field, $table, $filter, $where_join, $search_history_db); break; case "postgresql": - return postgresql_db_get_value_filter($field, $table, $filter, $where_join); + return postgresql_db_get_value_filter($field, $table, $filter, $where_join, $search_history_db); break; case "oracle": - return oracle_db_get_value_filter($field, $table, $filter, $where_join); + return oracle_db_get_value_filter($field, $table, $filter, $where_join, $search_history_db); break; } }