Merge branch 'ent-12082-error-al-copiar-widget-de-inventario' into 'develop'

Ent 12082 error al copiar widget de inventario

See merge request artica/pandorafms!6503
This commit is contained in:
Rafael Ameijeiras 2023-11-27 14:38:33 +00:00
commit 25152e27f8

View File

@ -396,6 +396,7 @@ class InventoryWidget extends Widget
$inventory_id_agent = $this->values['agentId']; $inventory_id_agent = $this->values['agentId'];
$inventory_agent = $this->values['agentAlias']; $inventory_agent = $this->values['agentAlias'];
$cellId = $this->cellId;
if (strlen($inventory_agent) === 0) { if (strlen($inventory_agent) === 0) {
$inventory_id_agent = -1; $inventory_id_agent = -1;
@ -610,7 +611,7 @@ class InventoryWidget extends Widget
} }
} }
$id_table = 'id_'.$row['id_module_inventory'].'_'.uniqid().'_'.$nodo['server_uid']; $id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid'].'_'.$cellId;
$table = ui_print_datatable( $table = ui_print_datatable(
[ [
'id' => $id_table, 'id' => $id_table,
@ -682,7 +683,7 @@ class InventoryWidget extends Widget
$agents, $agents,
'<span class="toggle-inventory-nodo">'.$node_name.'</span>', '<span class="toggle-inventory-nodo">'.$node_name.'</span>',
'', '',
'', $cellId,
false, false,
false, false,
'', '',
@ -729,7 +730,7 @@ class InventoryWidget extends Widget
} }
} }
$id_table = 'id_'.$row['id_module_inventory'].'_'.uniqid().'_'.$nodo['server_uid']; $id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid'].'_'.$cellId;
$table = ui_print_datatable( $table = ui_print_datatable(
[ [
@ -801,7 +802,7 @@ class InventoryWidget extends Widget
$agents, $agents,
'<span class="toggle-inventory-nodo">'.$node_name.'</span>', '<span class="toggle-inventory-nodo">'.$node_name.'</span>',
'', '',
'', $cellId,
false, false,
false false
); );
@ -895,7 +896,7 @@ class InventoryWidget extends Widget
} }
} }
$id_table = 'id_'.$key_row.'_'.$row['id_module_inventory'].'_'.uniqid().'_'.$row['id_agente']; $id_table = 'id_'.$key_row.'_'.$row['id_module_inventory'].'_'.$row['id_agente'].'_'.$cellId;
$table = ui_print_datatable( $table = ui_print_datatable(
[ [
@ -950,7 +951,7 @@ class InventoryWidget extends Widget
$modules, $modules,
$agent_rows['agent'], $agent_rows['agent'],
'', '',
'', $cellId,
false, false,
false, false,
'', '',
@ -987,7 +988,7 @@ class InventoryWidget extends Widget
array_push($data, $data_tmp); array_push($data, $data_tmp);
} }
$id_table = 'id_'.$row['id_module_inventory'].'_'.uniqid(); $id_table = 'id_'.$row['id_module_inventory'].'_'.$cellId;
} }
if ($count_rows > 1) { if ($count_rows > 1) {
@ -1000,8 +1001,8 @@ class InventoryWidget extends Widget
'column_names' => $columns, 'column_names' => $columns,
'no_sortable_columns' => [], 'no_sortable_columns' => [],
'data_element' => $data, 'data_element' => $data,
'searching' => true, 'searching' => false,
'dom_elements' => 'rtilp', 'dom_elements' => 'frtilp',
'order' => [ 'order' => [
'field' => $columns[0], 'field' => $columns[0],
'direction' => 'asc', 'direction' => 'asc',
@ -1010,11 +1011,9 @@ class InventoryWidget extends Widget
'emptyTable' => __('No inventory found'), 'emptyTable' => __('No inventory found'),
'return' => true, 'return' => true,
'no_sortable_columns' => [], 'no_sortable_columns' => [],
'mini_search' => true, 'mini_search' => false,
'mini_pagination' => true, 'mini_pagination' => true,
'csv' => 0, 'csv' => 0,
'mini_pagination' => true,
'mini_search' => true,
] ]
); );
@ -1022,7 +1021,7 @@ class InventoryWidget extends Widget
$table, $table,
array_shift($module_rows)['name'], array_shift($module_rows)['name'],
'', '',
'', $cellId,
false, false,
false false
); );
@ -1092,9 +1091,11 @@ class InventoryWidget extends Widget
__('Values Custom Fields'), __('Values Custom Fields'),
]; ];
$basic_info_id = 'id_'.$row['id_module_inventory'].'_'.$cellId;
ui_print_datatable( ui_print_datatable(
[ [
'id' => 'basic_info', 'id' => $basic_info_id,
'class' => $class, 'class' => $class,
'style' => $style, 'style' => $style,
'columns' => $columns, 'columns' => $columns,