sugarcrm/sugarcrm_dev — pull request #76 by krishardy (2012-01-26 00:58:54+00:00)
Title: Fixes export header problem

When exporting ProspectLists (and presumably other exports that use include/export_utils.php), headers shown twice due to a bug in the export() function.

When building the $field_labels array, it is being populated with the field name from the database ($dbname):
array(0 => "id", 1 => "name", ...)

The return value from the translateForExport() call, is then being appended to the $field_labels array, rather than overwriting the $field_labels array, due to a mistake in the key usage in $field_labels:
array(0 => "id", 1 => "name", ..., "id" => "ID", "name" => "Name", ...);

This patch:
* fixes population of the $field_labels array
* refactors the header row string creation
* changes the way that the non-exported fields ("ea_deleted", "ear_deleted", "primary_address") are removed from the header and data output.
* includes style fixes, changing all tabs to 4 spaces (I would like to make a petition to standardize to 4-spaces instead of tabs in ALL files, but that's another issue entirely.)

The bug report on sugarcrm.com will be following shortly.