update agent custom fields
This commit is contained in:
parent
a7e97f0493
commit
a8a5289652
|
@ -242,6 +242,7 @@ our @EXPORT = qw(
|
||||||
pandora_update_agent_module_count
|
pandora_update_agent_module_count
|
||||||
pandora_update_config_token
|
pandora_update_config_token
|
||||||
pandora_update_agent_custom_field
|
pandora_update_agent_custom_field
|
||||||
|
pandora_select_id_custom_field
|
||||||
pandora_update_gis_data
|
pandora_update_gis_data
|
||||||
pandora_update_module_on_error
|
pandora_update_module_on_error
|
||||||
pandora_update_module_from_hash
|
pandora_update_module_from_hash
|
||||||
|
@ -3407,6 +3408,17 @@ sub pandora_update_config_token ($$$) {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
## Select custom field id by name tagent_custom_field
|
||||||
|
##########################################################################
|
||||||
|
sub pandora_select_id_custom_field ($$) {
|
||||||
|
my ($dbh, $field) = @_;
|
||||||
|
my $result = undef;
|
||||||
|
|
||||||
|
$result = get_db_single_row ($dbh, 'SELECT id_field FROM tagent_custom_fields WHERE name = ? ', safe_input($field));
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
## Update a custom field from agent of tagent_custom_data
|
## Update a custom field from agent of tagent_custom_data
|
||||||
|
|
|
@ -3063,7 +3063,7 @@ sub cli_agent_update_custom_fields() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Department, Serial number ...
|
# Department, Serial number ...
|
||||||
my $custom_field = get_db_single_row ($dbh, 'SELECT id_field FROM tagent_custom_fields WHERE name = ? ', safe_input($field));
|
my $custom_field = pandora_select_id_custom_field ($dbh, $field);
|
||||||
|
|
||||||
if($custom_field eq '') {
|
if($custom_field eq '') {
|
||||||
print_log "[ERROR] Field '$field' doesnt exist\n\n";
|
print_log "[ERROR] Field '$field' doesnt exist\n\n";
|
||||||
|
|
Loading…
Reference in New Issue