Merge branch 'ent-9595-error-500-en-vista-de-alerta-de-metaconsola-con-php-7-4' into 'develop'
Ent 9595 error 500 en vista de alerta de metaconsola con php 7 4 See merge request artica/pandorafms!5167
This commit is contained in:
commit
11f78d8720
|
@ -892,34 +892,6 @@ if ($get_agent_alerts_datatable === true) {
|
||||||
|
|
||||||
// Order and pagination metacosole.
|
// Order and pagination metacosole.
|
||||||
if (is_metaconsole() === true) {
|
if (is_metaconsole() === true) {
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auxiliar Ordenation function
|
|
||||||
*
|
|
||||||
* @param string $sort Direction of sort.
|
|
||||||
* @param string $sortField Field for perform the sorting.
|
|
||||||
*/
|
|
||||||
function arrayOutputSorting($sort, $sortField)
|
|
||||||
{
|
|
||||||
return function ($a, $b) use ($sort, $sortField) {
|
|
||||||
if ($sort === 'asc') {
|
|
||||||
if (is_string($a[$sortField]) === true) {
|
|
||||||
return strnatcasecmp($a[$sortField], $b[$sortField]);
|
|
||||||
} else {
|
|
||||||
return ($a[$sortField] - $b[$sortField]);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (is_string($a[$sortField]) === true) {
|
|
||||||
return strnatcasecmp($b[$sortField], $a[$sortField]);
|
|
||||||
} else {
|
|
||||||
return ($a[$sortField] + $b[$sortField]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Status order.
|
// Status order.
|
||||||
if ($sortField === 'status') {
|
if ($sortField === 'status') {
|
||||||
foreach ($alerts['alerts_simple'] as $i => $alert) {
|
foreach ($alerts['alerts_simple'] as $i => $alert) {
|
||||||
|
|
|
@ -6230,15 +6230,15 @@ function notify_reporting_console_node()
|
||||||
function arrayOutputSorting($sort, $sortField)
|
function arrayOutputSorting($sort, $sortField)
|
||||||
{
|
{
|
||||||
return function ($a, $b) use ($sort, $sortField) {
|
return function ($a, $b) use ($sort, $sortField) {
|
||||||
if ($sort === 'up') {
|
if ($sort === 'up' || $sort === 'asc') {
|
||||||
if (is_string($a[$sortField]) === true) {
|
if (is_string($a[$sortField]) === true) {
|
||||||
return strcasecmp($a[$sortField], $b[$sortField]);
|
return strnatcasecmp($a[$sortField], $b[$sortField]);
|
||||||
} else {
|
} else {
|
||||||
return ($a[$sortField] - $b[$sortField]);
|
return ($a[$sortField] - $b[$sortField]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (is_string($a[$sortField]) === true) {
|
if (is_string($a[$sortField]) === true) {
|
||||||
return strcasecmp($b[$sortField], $a[$sortField]);
|
return strnatcasecmp($b[$sortField], $a[$sortField]);
|
||||||
} else {
|
} else {
|
||||||
return ($a[$sortField] + $b[$sortField]);
|
return ($a[$sortField] + $b[$sortField]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
// Login check
|
// Login check.
|
||||||
check_login();
|
check_login();
|
||||||
|
|
||||||
if (is_ajax()) {
|
if (is_ajax()) {
|
||||||
|
@ -37,7 +37,7 @@ if (is_ajax()) {
|
||||||
$get_alert_fired = get_parameter('get_alert_fired', 0);
|
$get_alert_fired = get_parameter('get_alert_fired', 0);
|
||||||
|
|
||||||
if ($get_alert_fired) {
|
if ($get_alert_fired) {
|
||||||
// Calculate alerts fired
|
// Calculate alerts fired.
|
||||||
$data_reporting = reporting_get_group_stats();
|
$data_reporting = reporting_get_group_stats();
|
||||||
echo $data_reporting['monitor_alerts_fired'];
|
echo $data_reporting['monitor_alerts_fired'];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue