mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Dont show empty custom fields in agent view - #4201
This commit is contained in:
parent
31187d76fb
commit
2298019e6b
@ -461,26 +461,25 @@ if ($fields === false) {
|
|||||||
|
|
||||||
$custom_fields = [];
|
$custom_fields = [];
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$data = [];
|
$custom_value = db_get_all_rows_sql(
|
||||||
$data[0] = '<b>'.$field['name'].ui_print_help_tip(__('Custom field'), true).'</b>';
|
'select tagent_custom_data.description,tagent_custom_fields.is_password_type from tagent_custom_fields
|
||||||
$custom_value = db_get_all_rows_sql(
|
INNER JOIN tagent_custom_data ON tagent_custom_fields.id_field = tagent_custom_data.id_field where tagent_custom_fields.id_field = '.$field['id_field'].' and tagent_custom_data.id_agent = '.$id_agente
|
||||||
'select tagent_custom_data.description,tagent_custom_fields.is_password_type from tagent_custom_fields
|
);
|
||||||
INNER JOIN tagent_custom_data ON tagent_custom_fields.id_field = tagent_custom_data.id_field where tagent_custom_fields.id_field = '.$field['id_field'].' and tagent_custom_data.id_agent = '.$id_agente
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($custom_value[0]['description'] === false || $custom_value[0]['description'] == '') {
|
if ($custom_value[0]['description'] !== false && $custom_value[0]['description'] != '') {
|
||||||
$custom_value[0]['description'] = '<i>-'.__('empty').'-</i>';
|
$data = [];
|
||||||
} else {
|
|
||||||
|
$data[0] = '<b>'.$field['name'].ui_print_help_tip(__('Custom field'), true).'</b>';
|
||||||
$custom_value[0]['description'] = ui_bbcode_to_html($custom_value[0]['description']);
|
$custom_value[0]['description'] = ui_bbcode_to_html($custom_value[0]['description']);
|
||||||
}
|
|
||||||
|
|
||||||
if ($custom_value[0]['is_password_type']) {
|
if ($custom_value[0]['is_password_type']) {
|
||||||
$data[1] = '••••••••';
|
$data[1] = '••••••••';
|
||||||
} else {
|
} else {
|
||||||
$data[1] = $custom_value[0]['description'];
|
$data[1] = $custom_value[0]['description'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$custom_fields[] = $data;
|
$custom_fields[] = $data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$custom_fields_count = count($custom_fields);
|
$custom_fields_count = count($custom_fields);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user