mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Error fixes related with the improved oracle compatibility
This commit is contained in:
parent
7ae97fa48b
commit
c02f3bacf4
@ -373,15 +373,34 @@ if(!empty($groups)) {
|
|||||||
AND tpda.all_modules = 1))";
|
AND tpda.all_modules = 1))";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch ($config["dbtype"]) {
|
||||||
|
case "mysql":
|
||||||
|
case "postgresql":
|
||||||
$sql = "SELECT *
|
$sql = "SELECT *
|
||||||
FROM tplanned_downtime
|
FROM tplanned_downtime
|
||||||
WHERE $where_values
|
WHERE $where_values
|
||||||
ORDER BY type_execution DESC, date_from DESC
|
ORDER BY type_execution DESC, date_from DESC
|
||||||
LIMIT ".$config["block_size"]."
|
LIMIT ".$config["block_size"]."
|
||||||
OFFSET $offset";
|
OFFSET $offset";
|
||||||
|
break;
|
||||||
|
case "oracle":
|
||||||
|
$set = array ();
|
||||||
|
$set['limit'] = $config["block_size"];
|
||||||
|
$set['offset'] = $offset;
|
||||||
|
|
||||||
|
$sql = "SELECT *
|
||||||
|
FROM tplanned_downtime
|
||||||
|
WHERE $where_values
|
||||||
|
ORDER BY type_execution DESC, date_from DESC";
|
||||||
|
|
||||||
|
$sql = oracle_recode_query ($sql, $set);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$sql_count = "SELECT COUNT(id) AS num
|
$sql_count = "SELECT COUNT(id) AS num
|
||||||
FROM tplanned_downtime
|
FROM tplanned_downtime
|
||||||
WHERE $where_values";
|
WHERE $where_values";
|
||||||
|
|
||||||
$downtimes = db_get_all_rows_sql ($sql);
|
$downtimes = db_get_all_rows_sql ($sql);
|
||||||
$downtimes_number_res = db_get_all_rows_sql($sql_count);
|
$downtimes_number_res = db_get_all_rows_sql($sql_count);
|
||||||
$downtimes_number = $downtimes_number_res != false ? $downtimes_number_res[0]['num'] : 0;
|
$downtimes_number = $downtimes_number_res != false ? $downtimes_number_res[0]['num'] : 0;
|
||||||
|
@ -99,7 +99,7 @@ if ($search_agents && ((!defined('METACONSOLE')) || $force_local)) {
|
|||||||
$filter_agents[] = '(nombre LIKE \'%'.$string.'%\')';
|
$filter_agents[] = '(nombre LIKE \'%'.$string.'%\')';
|
||||||
break;
|
break;
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$filter_agents[] = '(UPPER(nombre) LIKE UPPER(\'%'.$string.'%\')';
|
$filter_agents[] = '(UPPER(nombre) LIKE UPPER(\'%'.$string.'%\'))';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$agents = agents_get_agents($filter_agents, array ('id_agente', 'nombre', 'direccion'));
|
$agents = agents_get_agents($filter_agents, array ('id_agente', 'nombre', 'direccion'));
|
||||||
|
@ -2086,11 +2086,15 @@ function visual_map_create_internal_name_item($label = null, $type, $image, $age
|
|||||||
}
|
}
|
||||||
|
|
||||||
function visual_map_get_items_parents($idVisual) {
|
function visual_map_get_items_parents($idVisual) {
|
||||||
$items = db_get_all_rows_sql(sprintf("SELECT * FROM tlayout_data where id_layout = %s order by label",$idVisual));
|
// Avoid the sort by 'label' in the query cause oracle cannot sort by columns with CLOB type
|
||||||
//$items = db_get_all_fields_in_table('tlayout_data',array('id_layout' => $idVisual));
|
$items = db_get_all_rows_filter('tlayout_data', array('id_layout' => $idVisual));
|
||||||
if ($items == false) {
|
if ($items == false) {
|
||||||
$items = array();
|
$items = array();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// Sort by label
|
||||||
|
sort_by_column($items, 'label');
|
||||||
|
}
|
||||||
|
|
||||||
$return = array();
|
$return = array();
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user