Merge branch '2030-Esconder-los-campos-de-tipo-password-dentro-de-los-custom-fields-del-agente-4' into 'develop'

Hide password custom fields in agent view - #2030

See merge request artica/pandorafms!1399
This commit is contained in:
vgilc 2018-04-03 09:35:22 +02:00
commit 90280fd943
1 changed files with 14 additions and 7 deletions

View File

@ -381,16 +381,23 @@ foreach ($fields as $field) {
$data = array(); $data = array();
$data[0] = '<b>' . $field['name'] . $data[0] = '<b>' . $field['name'] .
ui_print_help_tip (__('Custom field'), true) . '</b>'; ui_print_help_tip (__('Custom field'), true) . '</b>';
$custom_value = db_get_value_filter( $custom_value = db_get_all_rows_sql("select tagent_custom_data.description,tagent_custom_fields.is_password_type from tagent_custom_fields
'description', 'tagent_custom_data', 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);
array('id_field' => $field['id_field'], 'id_agent' => $id_agente));
if ($custom_value === false || $custom_value == '') { if ($custom_value[0]['description'] === false || $custom_value[0]['description'] == '') {
$custom_value = '<i>'.__('N/A').'</i>'; $custom_value[0]['description'] = '<i>-'.__('empty').'-</i>';
} }
else { else {
$custom_value = ui_bbcode_to_html($custom_value); $custom_value[0]['description'] = ui_bbcode_to_html($custom_value[0]['description']);
} }
$data[1] = $custom_value;
if($custom_value[0]['is_password_type']){
$data[1] = '&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;';
}
else{
$data[1] = $custom_value[0]['description'];
}
$table_data->data[] = $data; $table_data->data[] = $data;
} }