update agent custom fields

This commit is contained in:
marcos 2021-09-28 11:20:26 +02:00
parent a8a5289652
commit 4e25442813
2 changed files with 9 additions and 3 deletions

View File

@ -3417,7 +3417,7 @@ sub pandora_select_id_custom_field ($$) {
$result = get_db_single_row ($dbh, 'SELECT id_field FROM tagent_custom_fields WHERE name = ? ', safe_input($field));
return $result;
return $result->{'id_field'};
}
##########################################################################

View File

@ -3070,10 +3070,16 @@ sub cli_agent_update_custom_fields() {
exit;
}
pandora_update_agent_custom_field ($dbh, $new_value, $id_field, $id_agent);
print_log "[INFO] Updating field '$field' in agent with ID '$id_agent'\n\n";
my $result = pandora_update_agent_custom_field ($dbh, $new_value, $custom_field, $id_agent);
if($result == "0E0"){
print_log "[ERROR] Error updating field '$field'\n";
} else {
print_log "[INFO] Field '$field' updated succesfully!\n\n";
}
exit;
}