update agent custom fields
This commit is contained in:
parent
a8a5289652
commit
4e25442813
|
@ -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'};
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue