Merge branch 'ent-11179-15577-errores-en-varios-widgets-de-dashboard' into 'develop'

Ent 11179 15577 errores en varios widgets de dashboard

See merge request artica/pandorafms!5884
This commit is contained in:
Daniel Rodriguez 2023-05-16 09:43:38 +00:00
commit e2ef02081a
4 changed files with 45 additions and 13 deletions

View File

@ -208,7 +208,7 @@ $table->data[2][] = html_print_label_input_block(
if ($action === 'new') { if ($action === 'new') {
$backgroundColorInput = html_print_input_color( $backgroundColorInput = html_print_input_color(
'background_color', 'background_color',
'white', '#FFFFFF',
'background_color', 'background_color',
false, false,
true true

View File

@ -102,12 +102,26 @@ class Heatmap
protected $group = null; protected $group = null;
/** /**
* Heatmap group. * Heatmap dashboard.
* *
* @var boolean * @var boolean
*/ */
protected $dashboard = null; protected $dashboard = null;
/**
* Public hash.
*
* @var boolean
*/
protected $hash = null;
/**
* Public user.
*
* @var boolean
*/
protected $publicUser = null;
/** /**
* Constructor function * Constructor function
@ -131,7 +145,9 @@ class Heatmap
int $height=0, int $height=0,
string $search=null, string $search=null,
int $group=1, int $group=1,
bool $dashboard=false bool $dashboard=false,
string $hash='',
string $publicUser=''
) { ) {
$this->type = $type; $this->type = $type;
$this->filter = $filter; $this->filter = $filter;
@ -142,6 +158,8 @@ class Heatmap
$this->search = $search; $this->search = $search;
$this->group = $group; $this->group = $group;
$this->dashboard = $dashboard; $this->dashboard = $dashboard;
$this->hash = $hash;
$this->publicUser = $publicUser;
} }
@ -164,15 +182,18 @@ class Heatmap
false false
), ),
'data' => [ 'data' => [
'page' => 'operation/heatmap', 'page' => 'operation/heatmap',
'method' => 'showHeatmap', 'method' => 'showHeatmap',
'randomId' => $this->randomId, 'randomId' => $this->randomId,
'type' => $this->type, 'type' => $this->type,
'filter' => $this->filter, 'filter' => $this->filter,
'refresh' => $this->refresh, 'refresh' => $this->refresh,
'search' => $this->search, 'search' => $this->search,
'group' => $this->group, 'group' => $this->group,
'dashboard' => (int) $this->dashboard, 'dashboard' => (int) $this->dashboard,
'auth_hash' => $this->hash,
'auth_class' => 'PandoraFMS\Dashboard\Manager',
'id_user' => $this->publicUser,
], ],
]; ];

View File

@ -658,6 +658,10 @@ class EventsListWidget extends Widget
$table_id = 'dashboard_list_events_'.$this->cellId; $table_id = 'dashboard_list_events_'.$this->cellId;
// Public dashboard.
$hash = get_parameter('auth_hash', '');
$id_user = get_parameter('id_user', '');
// Print datatable. // Print datatable.
$output .= ui_print_datatable( $output .= ui_print_datatable(
[ [
@ -671,6 +675,9 @@ class EventsListWidget extends Widget
'filter' => $filter, 'filter' => $filter,
'length' => $this->values['limit'], 'length' => $this->values['limit'],
'groupRecursion' => (bool) $this->values['groupRecursion'], 'groupRecursion' => (bool) $this->values['groupRecursion'],
'auth_hash' => $hash,
'auth_class' => 'PandoraFMS\Dashboard\Manager',
'id_user' => $id_user,
], ],
'default_pagination' => $this->values['limit'], 'default_pagination' => $this->values['limit'],
'pagination_options' => [ 'pagination_options' => [

View File

@ -441,8 +441,12 @@ class HeatmapWidget extends Widget
$filter = explode(',', $values['module_groups'][0]); $filter = explode(',', $values['module_groups'][0]);
} }
// Public dashboard.
$auth_hash = get_parameter('auth_hash', '');
$public_user = get_parameter('id_user', '');
// Control call flow. // Control call flow.
$heatmap = new Heatmap($type, $filter, null, 300, 400, 200, $search, 0, true); $heatmap = new Heatmap($type, $filter, null, 300, 400, 200, $search, 0, true, $auth_hash, $public_user);
// AJAX controller. // AJAX controller.
if (is_ajax() === true) { if (is_ajax() === true) {
$method = get_parameter('method'); $method = get_parameter('method');