2011-05-18 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_agents.php: changed the source code to fixed the enterprise call in function "agents_get_agents". * operation/agentes/estado_agente.php: apply the change to the call "agents_get_agents". Fixes: #3303426 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4367 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
be51309f1c
commit
84ff993022
|
@ -1,3 +1,13 @@
|
|||
2011-05-18 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_agents.php: changed the source code to fixed the
|
||||
enterprise call in function "agents_get_agents".
|
||||
|
||||
* operation/agentes/estado_agente.php: apply the change to the call
|
||||
"agents_get_agents".
|
||||
|
||||
Fixes: #3303426
|
||||
|
||||
2011-05-18 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||
|
||||
* include/functions_graph.php
|
||||
|
|
|
@ -151,8 +151,7 @@ function agents_get_alerts_simple ($id_agent = false, $filter = '', $options = f
|
|||
$filter .= db_format_array_where_clause_sql ($options);
|
||||
}
|
||||
|
||||
if (($id_agent !== false) && ($idGroup !== false)) {
|
||||
|
||||
if (($id_agent === false) && ($idGroup !== false)) {
|
||||
if ($idGroup != 0) { //All group
|
||||
$subQuery = 'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
|
@ -372,7 +371,11 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
|
|||
$filter['order'] = $order['field'] . ' ' . $order['order'];
|
||||
|
||||
if ($enterprise_include) {
|
||||
add_enterprise_agents_get_agents_filter_acl($filter);
|
||||
$ids = get_id_agents_user_profile_policy();
|
||||
|
||||
if (!empty($filter['id_agente'])) {
|
||||
$filter['id_agente'] = array_intersect($filter['id_agente'], $ids);
|
||||
}
|
||||
}
|
||||
|
||||
return db_get_all_rows_filter ('tagente', $filter, $fields);
|
||||
|
@ -804,7 +807,7 @@ function agents_get_group_agents ($id_group = 0, $search = false, $case = "lower
|
|||
$search_sql .= ' AND nombre COLLATE utf8_general_ci LIKE \'' . $name . '\' ';
|
||||
break;
|
||||
case "oracle":
|
||||
$search_sql .= ' AND UPPER(nombre) LIKE UPPER(\'' . $name . '\') ';
|
||||
$search_sql .= ' AND nombre LIKE UPPER("' . $name . '") ';
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -959,29 +962,13 @@ function agents_get_modules ($id_agent = null, $details = false, $filter = false
|
|||
}
|
||||
|
||||
if ($value[0] == '%') {
|
||||
switch ($config['dbtype']){
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
array_push ($fields, $field.' LIKE "'.$value.'"');
|
||||
break;
|
||||
case "oracle":
|
||||
array_push ($fields, $field.' LIKE \''.$value.'\'');
|
||||
break;
|
||||
}
|
||||
array_push ($fields, $field.' LIKE "'.$value.'"');
|
||||
}
|
||||
else if ($operatorDistin) {
|
||||
array_push($fields, $field.' <> ' . substr($value, 2));
|
||||
}
|
||||
else if (substr($value, -1) == '%') {
|
||||
switch ($config['dbtype']){
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
array_push ($fields, $field.' LIKE "'.$value.'"');
|
||||
break;
|
||||
case "oracle":
|
||||
array_push ($fields, $field.' LIKE \''.$value.'\'');
|
||||
break;
|
||||
}
|
||||
array_push ($fields, $field.' LIKE "'.$value.'"');
|
||||
}
|
||||
else {
|
||||
switch ($config["dbtype"]) {
|
||||
|
|
|
@ -269,30 +269,25 @@ else {
|
|||
$total_agents = 0;
|
||||
$agents = false;
|
||||
if (! empty ($agent_names)) {
|
||||
$subquery_enterprise = '';
|
||||
if (ENTERPRISE_NOT_HOOK !== enterprise_include_once('include/functions_policies.php')) {
|
||||
$subquery_enterprise = subquery_acl_enterprise();
|
||||
}
|
||||
|
||||
$total_agents = agents_get_agents(array ('id_agente' => array_keys ($agent_names),
|
||||
'order' => 'nombre ASC',
|
||||
'disabled' => 0,
|
||||
'id_grupo' => $groups),
|
||||
array ('COUNT(*) as total'));
|
||||
$total_agents = isset ($total_agents[0]['total']) ? $total_agents[0]['total'] : 0;
|
||||
|
||||
$agents = agents_get_agents(array ('id_agente' => array_keys ($agent_names),
|
||||
'order' => 'nombre ASC',
|
||||
'id_grupo' => $groups,
|
||||
'offset' => (int) get_parameter ('offset'),
|
||||
'limit' => (int) $config['block_size']),
|
||||
array ('id_agente',
|
||||
'id_grupo',
|
||||
'id_os',
|
||||
'ultimo_contacto',
|
||||
'intervalo'),
|
||||
'AR',
|
||||
$order);
|
||||
$total_agents = agents_get_agents(array ('id_agente' => array_keys ($agent_names),
|
||||
'order' => 'nombre ASC',
|
||||
'disabled' => 0,
|
||||
'id_grupo' => $groups),
|
||||
array ('COUNT(*) as total'));
|
||||
$total_agents = isset ($total_agents[0]['total']) ? $total_agents[0]['total'] : 0;
|
||||
|
||||
$agents = agents_get_agents(array ('id_agente' => array_keys ($agent_names),
|
||||
'order' => 'nombre ASC',
|
||||
'id_grupo' => $groups,
|
||||
'offset' => (int) get_parameter ('offset'),
|
||||
'limit' => (int) $config['block_size']),
|
||||
array ('id_agente',
|
||||
'id_grupo',
|
||||
'id_os',
|
||||
'ultimo_contacto',
|
||||
'intervalo'),
|
||||
'AR',
|
||||
$order);
|
||||
}
|
||||
|
||||
if (empty ($agents)) {
|
||||
|
|
Loading…
Reference in New Issue