mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Merge branch 'ent-11660-errores-en-operaciones-masivas' into 'develop'
Ent 11660 Errores en operaciones masivas See merge request artica/pandorafms!6183
This commit is contained in:
commit
7cbae9d6d5
@ -92,6 +92,10 @@ if ($update) {
|
||||
// If the option to select all of one group or module type is checked.
|
||||
if ($force) {
|
||||
if ($force === 'type') {
|
||||
if (empty($modules_) === true) {
|
||||
$modules_ = [];
|
||||
}
|
||||
|
||||
$type_condition = '';
|
||||
if ($module_type != 0) {
|
||||
$type_condition = "AND tam.id_tipo_modulo = $module_type";
|
||||
@ -131,6 +135,7 @@ if ($update) {
|
||||
foreach ($module_name as $mod_name) {
|
||||
$result = process_manage_edit($mod_name['nombre'], $id_agent, $module_status, $modules_selection_mode);
|
||||
$count++;
|
||||
$modules_[] = $mod_name['nombre'];
|
||||
$success += (int) $result;
|
||||
}
|
||||
}
|
||||
@ -139,6 +144,10 @@ if ($update) {
|
||||
$error_msg = __('Error updating the modules from a module type');
|
||||
}
|
||||
} else if ($force === 'group') {
|
||||
if (empty($modules_) === true) {
|
||||
$modules_ = [];
|
||||
}
|
||||
|
||||
$agents_ = array_keys(agents_get_group_agents($group_select, false, 'none'));
|
||||
|
||||
foreach ($agents_ as $id_agent) {
|
||||
@ -156,6 +165,7 @@ if ($update) {
|
||||
foreach ($module_name as $mod_name) {
|
||||
$result = process_manage_edit($mod_name['nombre'], $id_agent, $module_status, $modules_selection_mode);
|
||||
$count++;
|
||||
$modules_[] = $mod_name['nombre'];
|
||||
$success += (int) $result;
|
||||
}
|
||||
}
|
||||
@ -188,6 +198,9 @@ if ($update) {
|
||||
__('Successfully updated').'('.$success.'/'.$count.')',
|
||||
$error_msg
|
||||
);
|
||||
if (empty($modules_) === true || is_array($modules_) === false) {
|
||||
$modules_ = [];
|
||||
}
|
||||
|
||||
$info = '{"Modules":"'.implode(',', $modules_).'","Agents":"'.implode(',', $agents_).'"}';
|
||||
if ($success > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user