#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) {
enterprise_include_once('include/functions_agents.php');
include_once $config['homedir'].'/include/functions_graph.php';
$id = get_parameter('id', 0);
$id_server = get_parameter('id_server', 0);
if (empty($id_server) === false) {

View File

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

View File

@ -100,7 +100,7 @@ function forecast_projection_graph(
$data[0] = '';
$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[4] = $row[1];
$data[5] = ($row[0] * $row[1]);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -34,7 +34,12 @@ if ($redraw === false) {
$output .= '<div class="header-widget">';
$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') {
$output .= $options['title'];
} else {