Merge branch '853-Custom-SQL-que-afecten-a-BDD-de-histórico-enterprise-open' into 'develop'

Add historical db check to reports template SQL items - #853

See merge request !640
This commit is contained in:
vgilc 2017-07-05 11:45:18 +02:00
commit 0fd6d38a6b
4 changed files with 14 additions and 4 deletions

View File

@ -710,6 +710,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`module_names` TEXT,
`module_free_text` TEXT,
`each_agent` tinyint(1) default 1,
`historical_db` tinyint(1) UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;

View File

@ -3454,7 +3454,12 @@ function graph_custom_sql_graph ($id, $width, $height,
global $config;
$report_content = db_get_row ('treport_content', 'id_rc', $id);
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$id);
if($id != null){
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$id);
}
else{
$historical_db = $content['historical_db'];
}
if ($report_content["external_source"] != "") {
$sql = io_safe_output ($report_content["external_source"]);
}

View File

@ -3940,9 +3940,12 @@ function reporting_sql($report, $content) {
$header = explode('|', $content['header_definition']);
$return['header'] = $header;
}
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$content['id_rc']);
if($content['id_rc'] != null){
$historical_db = db_get_value_sql("SELECT historical_db from treport_content where id_rc =".$content['id_rc']);
}
else{
$historical_db = $content['historical_db'];
}
$result = db_get_all_rows_sql($sql,$historical_db);
if ($result !== false) {

View File

@ -2696,6 +2696,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`module_names` TEXT,
`module_free_text` TEXT,
`each_agent` tinyint(1) default 1,
`historical_db` tinyint(1) UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;