mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Error fixes related with the improved oracle compatibility
This commit is contained in:
parent
758e11b5b0
commit
c95f70dde7
@ -56,9 +56,9 @@ if (is_ajax ()) {
|
||||
$default_action = false;
|
||||
// Try to get actions for the current alert
|
||||
$sql = 'SELECT t2.name
|
||||
FROM talert_template_module_actions AS t1
|
||||
INNER JOIN talert_actions AS t2
|
||||
INNER JOIN talert_template_modules AS t3
|
||||
FROM talert_template_module_actions t1
|
||||
INNER JOIN talert_actions t2
|
||||
INNER JOIN talert_template_modules t3
|
||||
ON t3.id = t1.id_alert_template_module
|
||||
AND t1.id_alert_action = t2.id
|
||||
WHERE (t3.id_alert_template = ' . $template['id'] . ' AND
|
||||
|
@ -25,10 +25,10 @@ INSERT INTO `tconfig_os` (`name`, `description`, `icon_name`) VALUES ('Mainframe
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE ttag_module ADD COLUMN `id_policy_module` int(10) NOT NULL DEFAULT 0;
|
||||
|
||||
UPDATE ttag_module AS t1
|
||||
UPDATE ttag_module t1
|
||||
SET t1.id_policy_module = (
|
||||
SELECT t2.id_policy_module
|
||||
FROM tagente_modulo AS t2
|
||||
FROM tagente_modulo t2
|
||||
WHERE t1.id_agente_modulo = t2.id_agente_modulo);
|
||||
|
||||
/* 2014/12/10 */
|
||||
|
@ -26,10 +26,10 @@ INSERT INTO tconfig_os (name, description, icon_name) VALUES ('Mainframe', 'Main
|
||||
|
||||
ALTER TABLE tlayout_data ADD COLUMN id_policy_module NUMBER(10, 0) DEFAULT 0 NOT NULL;
|
||||
|
||||
UPDATE ttag_module AS t1
|
||||
UPDATE ttag_module t1
|
||||
SET t1.id_policy_module = (
|
||||
SELECT t2.id_policy_module
|
||||
FROM tagente_modulo AS t2
|
||||
FROM tagente_modulo t2
|
||||
WHERE t1.id_agente_modulo = t2.id_agente_modulo);
|
||||
|
||||
/* 2014/12/10 */
|
||||
|
@ -26,10 +26,10 @@ INSERT INTO "tconfig_os" ("name", "description", "icon_name") VALUES ('Mainframe
|
||||
|
||||
ALTER TABLE tlayout_data ADD COLUMN "id_policy_module" INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
UPDATE ttag_module AS t1
|
||||
UPDATE ttag_module t1
|
||||
SET t1.id_policy_module = (
|
||||
SELECT t2.id_policy_module
|
||||
FROM tagente_modulo AS t2
|
||||
FROM tagente_modulo t2
|
||||
WHERE t1.id_agente_modulo = t2.id_agente_modulo);
|
||||
|
||||
/* 2014/12/10 */
|
||||
|
@ -181,7 +181,7 @@ if ($searchFlag) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$where .= " AND id_agent_module IN (SELECT t2.id_agente_modulo
|
||||
FROM tagente AS t1 INNER JOIN tagente_modulo AS t2 ON t1.id_agente = t2.id_agente
|
||||
FROM tagente t1 INNER JOIN tagente_modulo t2 ON t1.id_agente = t2.id_agente
|
||||
WHERE t1.nombre LIKE '" . trim($agentName) . "')";
|
||||
break;
|
||||
case "oracle":
|
||||
|
@ -98,10 +98,10 @@ function process_manage_delete ($id_alert_template, $id_agents, $module_names) {
|
||||
if (count($module_names) == 1 && $module_names[0] == '0') {
|
||||
if ($module_selection_mode == 'common') {
|
||||
$sql = 'SELECT t1.id_agente_modulo
|
||||
FROM tagente_modulo AS t1
|
||||
FROM tagente_modulo t1
|
||||
WHERE t1.id_agente_modulo IN (
|
||||
SELECT t2.id_agent_module
|
||||
FROM talert_template_modules AS t2
|
||||
FROM talert_template_modules t2
|
||||
WHERE
|
||||
t2.id_alert_template = ' . $id_alert_template . ')
|
||||
AND t1.id_agente IN (' . implode(',', $id_agents) . ');';
|
||||
|
@ -64,7 +64,7 @@ if (is_ajax ()) {
|
||||
WHERE id_agente IN (" . implode(',', $id_agents) . ")
|
||||
AND id_agente_modulo IN (
|
||||
SELECT t1.id_agente_modulo
|
||||
FROM ttag_module AS t1
|
||||
FROM ttag_module t1
|
||||
WHERE id_tag = " . $id_tag . "
|
||||
AND id_policy_module = 0)
|
||||
GROUP BY nombre;");
|
||||
|
@ -81,7 +81,7 @@ if ($update) {
|
||||
|
||||
$agents_ = db_get_all_rows_sql('
|
||||
SELECT DISTINCT(t1.id_agente)
|
||||
FROM tagente AS t1, tagente_modulo AS t2
|
||||
FROM tagente t1, tagente_modulo t2
|
||||
WHERE t1.id_agente = t2.id_agente
|
||||
AND t2.delete_pending = 0 ' . $condition);
|
||||
foreach ($agents_ as $id_agent) {
|
||||
|
@ -39,13 +39,13 @@ if (isset ($_GET["get_agent"])) {
|
||||
if ($editGraph) {
|
||||
$graphRows = db_get_all_rows_sql("SELECT t1.*,
|
||||
(SELECT t3.nombre
|
||||
FROM tagente AS t3
|
||||
FROM tagente t3
|
||||
WHERE t3.id_agente =
|
||||
(SELECT t2.id_agente
|
||||
FROM tagente_modulo AS t2
|
||||
FROM tagente_modulo t2
|
||||
WHERE t2.id_agente_modulo = t1.id_agent_module))
|
||||
AS agent_name
|
||||
FROM tgraph_source AS t1
|
||||
FROM tgraph_source t1
|
||||
WHERE t1.id_graph = " . $id);
|
||||
$module_array = array();
|
||||
$weight_array = array();
|
||||
|
@ -44,11 +44,11 @@ else {
|
||||
FROM
|
||||
(
|
||||
SELECT t1.*, id_agente
|
||||
FROM treport_content AS t1
|
||||
LEFT JOIN tagente_modulo AS t2
|
||||
FROM treport_content t1
|
||||
LEFT JOIN tagente_modulo t2
|
||||
ON t1.id_agent_module = id_agente_modulo
|
||||
) AS t4
|
||||
INNER JOIN tagente AS t5
|
||||
) t4
|
||||
INNER JOIN tagente t5
|
||||
ON (t4.id_agent = t5.id_agente OR t4.id_agente = t5.id_agente)
|
||||
WHERE t4.id_report = ' . $idReport);
|
||||
break;
|
||||
@ -82,8 +82,8 @@ else {
|
||||
case "postgresql":
|
||||
$rows = db_get_all_rows_sql('
|
||||
SELECT t1.id_agent_module, t2.nombre
|
||||
FROM treport_content AS t1
|
||||
INNER JOIN tagente_modulo AS t2
|
||||
FROM treport_content t1
|
||||
INNER JOIN tagente_modulo t2
|
||||
ON t1.id_agent_module = t2.id_agente_modulo
|
||||
WHERE t1.id_report = ' . $idReport);
|
||||
break;
|
||||
|
@ -1347,8 +1347,8 @@ switch ($action) {
|
||||
case 'module':
|
||||
$sql = "
|
||||
SELECT t1.id_rc, t2.nombre
|
||||
FROM treport_content AS t1
|
||||
LEFT JOIN tagente_modulo AS t2
|
||||
FROM treport_content t1
|
||||
LEFT JOIN tagente_modulo t2
|
||||
ON t1.id_agent_module = t2.id_agente_modulo
|
||||
WHERE %s
|
||||
ORDER BY nombre %s
|
||||
@ -1360,11 +1360,11 @@ switch ($action) {
|
||||
FROM
|
||||
(
|
||||
SELECT t1.*, id_agente
|
||||
FROM treport_content AS t1
|
||||
LEFT JOIN tagente_modulo AS t2
|
||||
FROM treport_content t1
|
||||
LEFT JOIN tagente_modulo t2
|
||||
ON t1.id_agent_module = id_agente_modulo
|
||||
) AS t4
|
||||
LEFT JOIN tagente AS t5
|
||||
) t4
|
||||
LEFT JOIN tagente t5
|
||||
ON (t4.id_agent = t5.id_agente OR t4.id_agente = t5.id_agente)
|
||||
WHERE %s
|
||||
ORDER BY t5.nombre %s
|
||||
|
@ -96,11 +96,11 @@ function alerts_get_alerts($id_group = 0, $free_search = "", $status = "all", $s
|
||||
}
|
||||
$sql .= '
|
||||
FROM talert_template_modules AS t0
|
||||
INNER JOIN talert_templates AS t1
|
||||
INNER JOIN talert_templates t1
|
||||
ON t0.id_alert_template = t1.id
|
||||
INNER JOIN tagente_modulo AS t2
|
||||
INNER JOIN tagente_modulo t2
|
||||
ON t0.id_agent_module = t2.id_agente_modulo
|
||||
INNER JOIN tagente AS t3
|
||||
INNER JOIN tagente t3
|
||||
ON t2.id_agente = t3.id_agente
|
||||
WHERE 1=1
|
||||
' . $status_query . ' ' . $standby_query . ' ' . $group_query . '
|
||||
|
@ -742,10 +742,10 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType) {
|
||||
$modules = db_get_all_rows_sql('SELECT *
|
||||
FROM (SELECT id_agente_modulo as module_id_agent_modulo ' . $module_additional_columns . '
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente = ' . $agent['agent_id'] . ') AS t1
|
||||
WHERE id_agente = ' . $agent['agent_id'] . ') t1
|
||||
INNER JOIN (SELECT id_agente_modulo as module_id_agent_modulo ' . $estado_additional_columns . '
|
||||
FROM tagente_estado
|
||||
WHERE id_agente = ' . $agent['agent_id'] . ') AS t2
|
||||
WHERE id_agente = ' . $agent['agent_id'] . ') t2
|
||||
ON t1.module_id_agent_modulo = t2.module_id_agent_modulo');
|
||||
|
||||
if ($modules === false) $modules = array();
|
||||
@ -766,14 +766,14 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType) {
|
||||
|
||||
$alerts = db_get_all_rows_sql('SELECT t1.id_agent_module as alert_id_agent_module ' . $alert_additional_columns . '
|
||||
FROM (SELECT * FROM talert_template_modules
|
||||
WHERE id_agent_module = ' . $module['module_id_agent_modulo'] . ') AS t1
|
||||
INNER JOIN talert_templates AS t2
|
||||
WHERE id_agent_module = ' . $module['module_id_agent_modulo'] . ') t1
|
||||
INNER JOIN talert_templates t2
|
||||
ON t1.id_alert_template = t2.id
|
||||
LEFT JOIN talert_template_module_actions AS t3
|
||||
LEFT JOIN talert_template_module_actions t3
|
||||
ON t1.id = t3.id_alert_template_module
|
||||
LEFT JOIN talert_actions AS t4
|
||||
LEFT JOIN talert_actions t4
|
||||
ON t3.id_alert_action = t4.id
|
||||
LEFT JOIN talert_commands AS t5
|
||||
LEFT JOIN talert_commands t5
|
||||
ON t4.id_alert_command = t5.id');
|
||||
|
||||
if ($alerts === false) $alerts = array();
|
||||
@ -981,10 +981,10 @@ function get_module_properties($id_module, $fields, $separator, $returnType, $re
|
||||
$modules = db_get_all_rows_sql('SELECT *
|
||||
FROM (SELECT id_agente_modulo as module_id_agent_modulo ' . $module_additional_columns . '
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = ' . $id_module . ') AS t1
|
||||
WHERE id_agente_modulo = ' . $id_module . ') t1
|
||||
INNER JOIN (SELECT id_agente_modulo as module_id_agent_modulo ' . $estado_additional_columns . '
|
||||
FROM tagente_estado
|
||||
WHERE id_agente_modulo = ' . $id_module . ') AS t2
|
||||
WHERE id_agente_modulo = ' . $id_module . ') t2
|
||||
ON t1.module_id_agent_modulo = t2.module_id_agent_modulo');
|
||||
|
||||
if ($modules === false) $modules = array();
|
||||
@ -5889,8 +5889,8 @@ function api_set_new_event($trash1, $trash2, $other, $trash3) {
|
||||
}
|
||||
else {
|
||||
$idAlert = db_get_value_sql("SELECT t1.id
|
||||
FROM talert_template_modules AS t1
|
||||
INNER JOIN talert_templates AS t2
|
||||
FROM talert_template_modules t1
|
||||
INNER JOIN talert_templates t2
|
||||
ON t1.id_alert_template = t2.id
|
||||
WHERE t1.id_agent_module = 1
|
||||
AND t2.name LIKE '" . $other['data'][7] . "'");
|
||||
@ -6425,10 +6425,10 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||
if (defined ('METACONSOLE')) {
|
||||
$sql = "SELECT *,
|
||||
(SELECT t2.nombre
|
||||
FROM tgrupo AS t2
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = " . $table_events . ".id_grupo) AS group_name,
|
||||
(SELECT t2.icon
|
||||
FROM tgrupo AS t2
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = " . $table_events . ".id_grupo) AS group_icon
|
||||
FROM " . $table_events . "
|
||||
WHERE 1=1 " . $sql_post . "
|
||||
@ -6438,13 +6438,13 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||
else {
|
||||
$sql = "SELECT *,
|
||||
(SELECT t1.nombre
|
||||
FROM tagente AS t1
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
(SELECT t2.nombre
|
||||
FROM tgrupo AS t2
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_name,
|
||||
(SELECT t2.icon
|
||||
FROM tgrupo AS t2
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_icon,
|
||||
(SELECT tmodule.name
|
||||
FROM tmodule
|
||||
@ -6464,13 +6464,13 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||
//TODO TOTAL
|
||||
$sql = "SELECT *,
|
||||
(SELECT t1.nombre
|
||||
FROM tagente AS t1
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
(SELECT t2.nombre
|
||||
FROM tgrupo AS t2
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_name,
|
||||
(SELECT t2.icon
|
||||
FROM tgrupo AS t2
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_icon,
|
||||
(SELECT tmodule.name
|
||||
FROM tmodule
|
||||
@ -6491,13 +6491,13 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||
|
||||
$sql = "SELECT *,
|
||||
(SELECT t1.nombre
|
||||
FROM tagente AS t1
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
(SELECT t2.nombre
|
||||
FROM tgrupo AS t2
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_name,
|
||||
(SELECT t2.icon
|
||||
FROM tgrupo AS t2
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_icon,
|
||||
(SELECT tmodule.name
|
||||
FROM tmodule
|
||||
|
@ -1267,12 +1267,12 @@ function events_get_group_events_steps ($begin, &$result, $id_group, $period, $d
|
||||
|
||||
$sql = sprintf ('SELECT *,
|
||||
(SELECT t2.nombre
|
||||
FROM tagente AS t2
|
||||
FROM tagente t2
|
||||
WHERE t2.id_agente = t3.id_agente) AS agent_name,
|
||||
(SELECT t2.fullname
|
||||
FROM tusuario AS t2
|
||||
FROM tusuario t2
|
||||
WHERE t2.id_user = t3.id_usuario) AS user_name
|
||||
FROM tevento AS t3
|
||||
FROM tevento t3
|
||||
WHERE utimestamp > %d AND utimestamp <= %d
|
||||
AND id_grupo IN (%s) ' . $sql_where . '
|
||||
ORDER BY utimestamp ASC',
|
||||
@ -2566,10 +2566,10 @@ function events_get_count_events_by_agent ($id_group, $period, $date,
|
||||
|
||||
$sql = sprintf ('SELECT id_agente,
|
||||
(SELECT t2.nombre
|
||||
FROM tagente AS t2
|
||||
FROM tagente t2
|
||||
WHERE t2.id_agente = t3.id_agente) AS agent_name,
|
||||
COUNT(*) AS count
|
||||
FROM tevento AS t3
|
||||
FROM tevento t3
|
||||
WHERE utimestamp > %d AND utimestamp <= %d
|
||||
AND id_grupo IN (%s) ' . $sql_where . '
|
||||
GROUP BY id_agente',
|
||||
@ -2648,10 +2648,10 @@ function events_get_count_events_validated_by_user ($filter, $period, $date,
|
||||
|
||||
$sql = sprintf ('SELECT id_usuario,
|
||||
(SELECT t2.fullname
|
||||
FROM tusuario AS t2
|
||||
FROM tusuario t2
|
||||
WHERE t2.id_user = t3.id_usuario) AS user_name,
|
||||
COUNT(*) AS count
|
||||
FROM tevento AS t3
|
||||
FROM tevento t3
|
||||
WHERE utimestamp > %d AND utimestamp <= %d
|
||||
%s ' . $sql_where . '
|
||||
GROUP BY id_usuario',
|
||||
|
@ -942,9 +942,9 @@ function gis_get_agent_map($agent_id, $heigth, $width, $show_history = false, $c
|
||||
$defaultMap = db_get_all_rows_sql("
|
||||
SELECT t1.*, t3.conection_name, t3.connection_type,
|
||||
t3.conection_data, t3.num_zoom_levels
|
||||
FROM tgis_map AS t1,
|
||||
tgis_map_has_tgis_map_connection AS t2,
|
||||
tgis_map_connection AS t3
|
||||
FROM tgis_map t1,
|
||||
tgis_map_has_tgis_map_connection t2,
|
||||
tgis_map_connection t3
|
||||
WHERE t1.default_map = 1
|
||||
AND t2.tgis_map_id_tgis_map = t1.id_tgis_map
|
||||
AND t2.default_map_connection = 1
|
||||
@ -1189,9 +1189,9 @@ function gis_get_map_data($idMap) {
|
||||
$connections = db_get_all_rows_sql('SELECT t1.tgis_map_connection_id_tmap_connection AS id_conection,
|
||||
t1.default_map_connection AS `default`, (
|
||||
SELECT t2.num_zoom_levels
|
||||
FROM tgis_map_connection AS t2
|
||||
FROM tgis_map_connection t2
|
||||
WHERE t2.id_tmap_connection = t1.tgis_map_connection_id_tmap_connection) AS num_zoom_levels
|
||||
FROM tgis_map_has_tgis_map_connection AS t1
|
||||
FROM tgis_map_has_tgis_map_connection t1
|
||||
WHERE t1.tgis_map_id_tgis_map = '. $map['id_tgis_map']);
|
||||
break;
|
||||
case "postgresql":
|
||||
@ -1199,9 +1199,9 @@ function gis_get_map_data($idMap) {
|
||||
$connections = db_get_all_rows_sql('SELECT t1.tgis_map_connection_id_tmap_connection AS id_conection,
|
||||
t1.default_map_connection AS "default", (
|
||||
SELECT t2.num_zoom_levels
|
||||
FROM tgis_map_connection AS t2
|
||||
FROM tgis_map_connection t2
|
||||
WHERE t2.id_tmap_connection = t1.tgis_map_connection_id_tmap_connection) AS num_zoom_levels
|
||||
FROM tgis_map_has_tgis_map_connection AS t1
|
||||
FROM tgis_map_has_tgis_map_connection t1
|
||||
WHERE t1.tgis_map_id_tgis_map = '. $map['id_tgis_map']);
|
||||
break;
|
||||
}
|
||||
|
@ -2680,8 +2680,8 @@ function reporting_alert_reporting_module ($id_agent_module, $period = 0, $date
|
||||
|
||||
|
||||
$alerts = db_get_all_rows_sql('SELECT *, t1.id as id_alert_template_module
|
||||
FROM talert_template_modules AS t1
|
||||
INNER JOIN talert_templates AS t2 ON t1.id_alert_template = t2.id
|
||||
FROM talert_template_modules t1
|
||||
INNER JOIN talert_templates t2 ON t1.id_alert_template = t2.id
|
||||
WHERE id_agent_module = ' . $id_agent_module);
|
||||
|
||||
if ($alerts === false) {
|
||||
|
@ -524,10 +524,10 @@ function tags_get_agents($id_tag, $id_policy_module = 0) {
|
||||
FROM tagente
|
||||
WHERE id_agente IN (
|
||||
SELECT t1.id_agente
|
||||
FROM tagente_modulo AS t1
|
||||
FROM tagente_modulo t1
|
||||
WHERE t1.id_agente_modulo IN (
|
||||
SELECT t2.id_agente_modulo
|
||||
FROM ttag_module AS t2
|
||||
FROM ttag_module t2
|
||||
WHERE id_tag = " . $id_tag . "
|
||||
AND id_policy_module = " . $id_policy_module . "))");
|
||||
|
||||
|
@ -53,10 +53,10 @@ if (is_ajax ()) {
|
||||
case "mysql":
|
||||
$sql = sprintf ("SELECT t1.id, t1.name,
|
||||
(SELECT COUNT(t2.id)
|
||||
FROM talert_templates AS t2
|
||||
FROM talert_templates t2
|
||||
WHERE t2.id = %d
|
||||
AND t2.id_alert_action = t1.id) as 'sort_order'
|
||||
FROM talert_actions AS t1
|
||||
FROM talert_actions t1
|
||||
WHERE id_group IN (%s)
|
||||
ORDER BY sort_order DESC", $id_template, $filter_groups);
|
||||
break;
|
||||
@ -73,10 +73,10 @@ if (is_ajax ()) {
|
||||
case "postgresql":
|
||||
$sql = sprintf ("SELECT t1.id, t1.name,
|
||||
(SELECT COUNT(t2.id)
|
||||
FROM talert_templates AS t2
|
||||
FROM talert_templates t2
|
||||
WHERE t2.id = %d
|
||||
AND t2.id_alert_action = t1.id) as sort_order
|
||||
FROM talert_actions AS t1
|
||||
FROM talert_actions t1
|
||||
WHERE id_group IN (%s)
|
||||
ORDER BY sort_order DESC", $id_template, $filter_groups);
|
||||
break;
|
||||
|
@ -287,8 +287,8 @@ switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$profiles = db_get_all_rows_sql('SELECT id_grupo
|
||||
FROM tusuario_perfil AS t1
|
||||
INNER JOIN tperfil AS t2 ON t1.id_perfil = t2.id_perfil
|
||||
FROM tusuario_perfil t1
|
||||
INNER JOIN tperfil t2 ON t1.id_perfil = t2.id_perfil
|
||||
WHERE t2.agent_view = 1 AND t1.id_usuario = \'' . $config['id_user'] . '\'');
|
||||
if ($profiles === false)
|
||||
$profiles = array();
|
||||
|
@ -120,16 +120,16 @@ switch ($opt) {
|
||||
$agentsGISStatus = db_get_all_rows_sql('SELECT t1.nombre, id_parent, t1.id_agente AS tagente_id_agente,
|
||||
IFNULL(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude,
|
||||
IFNULL(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude
|
||||
FROM tagente AS t1
|
||||
LEFT JOIN tgis_data_status AS t2 ON t1.id_agente = t2.tagente_id_agente
|
||||
FROM tagente t1
|
||||
LEFT JOIN tgis_data_status t2 ON t1.id_agente = t2.tagente_id_agente
|
||||
WHERE 1 = 0');
|
||||
}
|
||||
else {
|
||||
$agentsGISStatus = db_get_all_rows_sql('SELECT t1.nombre, id_parent, t1.id_agente AS tagente_id_agente,
|
||||
IFNULL(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude,
|
||||
IFNULL(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude
|
||||
FROM tagente AS t1
|
||||
LEFT JOIN tgis_data_status AS t2 ON t1.id_agente = t2.tagente_id_agente
|
||||
FROM tagente t1
|
||||
LEFT JOIN tgis_data_status t2 ON t1.id_agente = t2.tagente_id_agente
|
||||
WHERE id_agente IN (' . implode(',', $idAgentsWithGIS) . ')');
|
||||
}
|
||||
break;
|
||||
@ -138,16 +138,16 @@ switch ($opt) {
|
||||
$agentsGISStatus = db_get_all_rows_sql('SELECT t1.nombre, id_parent, t1.id_agente AS tagente_id_agente,
|
||||
COALESCE(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude,
|
||||
COALESCE(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude
|
||||
FROM tagente AS t1
|
||||
LEFT JOIN tgis_data_status AS t2 ON t1.id_agente = t2.tagente_id_agente
|
||||
FROM tagente t1
|
||||
LEFT JOIN tgis_data_status t2 ON t1.id_agente = t2.tagente_id_agente
|
||||
WHERE 1 = 0');
|
||||
}
|
||||
else {
|
||||
$agentsGISStatus = db_get_all_rows_sql('SELECT t1.nombre, id_parent, t1.id_agente AS tagente_id_agente,
|
||||
COALESCE(t2.stored_longitude, ' . $defaultCoords['default_longitude'] . ') AS stored_longitude,
|
||||
COALESCE(t2.stored_latitude, ' . $defaultCoords['default_latitude'] . ') AS stored_latitude
|
||||
FROM tagente AS t1
|
||||
LEFT JOIN tgis_data_status AS t2 ON t1.id_agente = t2.tagente_id_agente
|
||||
FROM tagente t1
|
||||
LEFT JOIN tgis_data_status t2 ON t1.id_agente = t2.tagente_id_agente
|
||||
WHERE id_agente IN (' . implode(',', $idAgentsWithGIS) . ')');
|
||||
}
|
||||
break;
|
||||
|
@ -118,8 +118,8 @@ if ($searchAgents) {
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$sql = "
|
||||
FROM tagente AS t1
|
||||
INNER JOIN tgrupo AS t2
|
||||
FROM tagente t1
|
||||
INNER JOIN tgrupo t2
|
||||
ON t2.id_grupo = t1.id_grupo
|
||||
WHERE (
|
||||
1 = (
|
||||
@ -149,8 +149,8 @@ if ($searchAgents) {
|
||||
case "postgresql":
|
||||
case "oracle":
|
||||
$sql = "
|
||||
FROM tagente AS t1
|
||||
INNER JOIN tgrupo AS t2
|
||||
FROM tagente t1
|
||||
INNER JOIN tgrupo t2
|
||||
ON t2.id_grupo = t1.id_grupo
|
||||
WHERE (
|
||||
1 = (
|
||||
|
@ -21,8 +21,8 @@ $searchMaps = check_acl($config["id_user"], 0, "IR");
|
||||
$maps = false;
|
||||
if ($searchMaps) {
|
||||
$sql = "SELECT t1.id, t1.name, t1.id_group,
|
||||
(SELECT COUNT(*) FROM tlayout_data AS t2 WHERE t2.id_layout = t1.id) AS count
|
||||
FROM tlayout AS t1 WHERE t1.name LIKE '%" . $stringSearchSQL . "%'
|
||||
(SELECT COUNT(*) FROM tlayout_data t2 WHERE t2.id_layout = t1.id) AS count
|
||||
FROM tlayout t1 WHERE t1.name LIKE '%" . $stringSearchSQL . "%'
|
||||
LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0);
|
||||
$maps = db_process_sql($sql);
|
||||
|
||||
|
@ -95,12 +95,12 @@ if ($searchModules) {
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$chunk_sql = '
|
||||
FROM tagente_modulo AS t1
|
||||
INNER JOIN tagente AS t2
|
||||
FROM tagente_modulo t1
|
||||
INNER JOIN tagente t2
|
||||
ON t2.id_agente = t1.id_agente
|
||||
INNER JOIN tgrupo AS t3
|
||||
INNER JOIN tgrupo t3
|
||||
ON t3.id_grupo = t2.id_grupo
|
||||
INNER JOIN tagente_estado AS t4
|
||||
INNER JOIN tagente_estado t4
|
||||
ON t4.id_agente_modulo = t1.id_agente_modulo
|
||||
WHERE
|
||||
' . $sql_tags . '
|
||||
@ -124,12 +124,12 @@ if ($searchModules) {
|
||||
break;
|
||||
case "postgresql":
|
||||
$chunk_sql = '
|
||||
FROM tagente_modulo AS t1
|
||||
INNER JOIN tagente AS t2
|
||||
FROM tagente_modulo t1
|
||||
INNER JOIN tagente t2
|
||||
ON t2.id_agente = t1.id_agente
|
||||
INNER JOIN tgrupo AS t3
|
||||
INNER JOIN tgrupo t3
|
||||
ON t3.id_grupo = t2.id_grupo
|
||||
INNER JOIN tagente_estado AS t4
|
||||
INNER JOIN tagente_estado t4
|
||||
ON t4.id_agente_modulo = t1.id_agente_modulo
|
||||
WHERE
|
||||
' . $sql_tags . '
|
||||
@ -152,12 +152,12 @@ if ($searchModules) {
|
||||
break;
|
||||
case "oracle":
|
||||
$chunk_sql = '
|
||||
FROM tagente_modulo AS t1
|
||||
INNER JOIN tagente AS t2
|
||||
FROM tagente_modulo t1
|
||||
INNER JOIN tagente t2
|
||||
ON t2.id_agente = t1.id_agente
|
||||
INNER JOIN tgrupo AS t3
|
||||
INNER JOIN tgrupo t3
|
||||
ON t3.id_grupo = t2.id_grupo
|
||||
INNER JOIN tagente_estado AS t4
|
||||
INNER JOIN tagente_estado t4
|
||||
ON t4.id_agente_modulo = t1.id_agente_modulo
|
||||
WHERE
|
||||
' . $sql_tags . '
|
||||
|
Loading…
x
Reference in New Issue
Block a user