#12460 fixed deprecated

This commit is contained in:
Daniel Cebrian 2024-01-29 17:31:19 +01:00
parent fd8d233cf8
commit 22598b4bc2
12 changed files with 83 additions and 7 deletions

View File

@ -250,6 +250,7 @@ if (is_ajax() === true) {
if ($getInfo === true) { if ($getInfo === true) {
enterprise_include_once('include/functions_agents.php'); enterprise_include_once('include/functions_agents.php');
include_once $config['homedir'].'/include/functions_graph.php';
$id = get_parameter('id', 0); $id = get_parameter('id', 0);
$id_server = get_parameter('id_server', 0); $id_server = get_parameter('id_server', 0);
if (empty($id_server) === false) { if (empty($id_server) === false) {

View File

@ -52,6 +52,13 @@ class OrderInterpreter extends Wizard
*/ */
public $ajaxController; public $ajaxController;
/**
* Pages menu
*
* @var array
*/
public $pages_menu;
/** /**
* Generates a JSON error. * Generates a JSON error.

View File

@ -100,7 +100,7 @@ function forecast_projection_graph(
$data[0] = ''; $data[0] = '';
$data[1] = $cont; $data[1] = $cont;
$data[2] = date($config['date_format'], $row[0]); $data[2] = date($config['date_format'], (int) $row[0]);
$data[3] = $row[0]; $data[3] = $row[0];
$data[4] = $row[1]; $data[4] = $row[1];
$data[5] = ($row[0] * $row[1]); $data[5] = ($row[0] * $row[1]);

View File

@ -167,6 +167,20 @@ class Manager implements PublicLogin
*/ */
private $duplicateCellId; private $duplicateCellId;
/**
* Url
*
* @var string
*/
public $url;
/**
* Widget
*
* @var Widget
*/
public $cWidget;
/** /**
* Allowed methods to be called using AJAX request. * Allowed methods to be called using AJAX request.
* *

View File

@ -65,6 +65,27 @@ class Widget
*/ */
private $dateTo; private $dateTo;
/**
* Data cell
*
* @var array
*/
public $dataCell;
/**
* Overflow scrollbar.
*
* @var boolean
*/
public $overflow_scrollbars;
/**
* Position
*
* @var array
*/
public $position;
/** /**
* Contructor widget. * Contructor widget.

View File

@ -226,7 +226,7 @@ class AgentHive extends Widget
'name' => 'groups[]', 'name' => 'groups[]',
'returnAllGroup' => false, 'returnAllGroup' => false,
'privilege' => 'AR', 'privilege' => 'AR',
'selected' => explode(',', $values['groups'][0]), 'selected' => (isset($values['groups'][0]) === true) ? explode(',', $values['groups'][0]) : [],
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
'required' => true, 'required' => true,

View File

@ -117,6 +117,13 @@ class DataMatrix extends Widget
*/ */
protected $cellId; protected $cellId;
/**
* Position
*
* @var array
*/
public $size;
/** /**
* Construct. * Construct.

View File

@ -115,6 +115,13 @@ class ModulesByStatus extends Widget
*/ */
protected $cellId; protected $cellId;
/**
* Size
*
* @var array
*/
public $size;
/** /**
* Construct. * Construct.

View File

@ -355,7 +355,7 @@ class AgentModuleWidget extends Widget
*/ */
public function getIdCacheAgent($id_agents) public function getIdCacheAgent($id_agents)
{ {
$target_agents = explode(',', $id_agents); $target_agents = explode(',', ($id_agents ?? ''));
$cache_id_agents = []; $cache_id_agents = [];
foreach ($target_agents as $agent_id) { foreach ($target_agents as $agent_id) {
if (str_contains($agent_id, '|') === false) { if (str_contains($agent_id, '|') === false) {

View File

@ -111,6 +111,20 @@ class EventsListWidget extends Widget
*/ */
protected $publicLink; protected $publicLink;
/**
* Overflow scrollbar.
*
* @var boolean
*/
public $overflow_scrollbars;
/**
* Position
*
* @var array
*/
public $position;
/** /**
* Construct. * Construct.

View File

@ -271,7 +271,7 @@ class HeatmapWidget extends Widget
'name' => 'groups[]', 'name' => 'groups[]',
'returnAllGroup' => true, 'returnAllGroup' => true,
'privilege' => 'AR', 'privilege' => 'AR',
'selected' => explode(',', $values['groups'][0]), 'selected' => (isset($values['groups'][0]) === true) ? explode(',', $values['groups'][0]) : [],
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
], ],
@ -305,7 +305,7 @@ class HeatmapWidget extends Widget
'type' => 'select', 'type' => 'select',
'fields' => $tags, 'fields' => $tags,
'name' => 'tags[]', 'name' => 'tags[]',
'selected' => explode(',', $values['tags'][0]), 'selected' => (isset($values['tags'][0]) === true) ? explode(',', $values['tags'][0]) : [],
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
], ],
@ -332,7 +332,7 @@ class HeatmapWidget extends Widget
'type' => 'select', 'type' => 'select',
'fields' => $module_groups, 'fields' => $module_groups,
'name' => 'module_groups[]', 'name' => 'module_groups[]',
'selected' => explode(',', $values['module_groups'][0]), 'selected' => (isset($values['module_groups'][0]) === true) ? explode(',', $values['module_groups'][0]) : [],
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
'nothing' => __('Not assigned'), 'nothing' => __('Not assigned'),

View File

@ -34,7 +34,12 @@ if ($redraw === false) {
$output .= '<div class="header-widget">'; $output .= '<div class="header-widget">';
$output .= '<div>'; $output .= '<div>';
$options = json_decode($cellData['options'], true); if (isset($cellData['options']) === true) {
$options = json_decode($cellData['options'], true);
} else {
$options = [];
}
if ($cellData['id_widget'] !== '0') { if ($cellData['id_widget'] !== '0') {
$output .= $options['title']; $output .= $options['title'];
} else { } else {