|
Date: 4/18/2007 4:01 pm · Subject: DataForm does not export entry information · Rating: -2
When exporting tab-delimited data from a DataForm, only the field names and values are exported. None of the "extra" information about the entry (such as entryId, username, submissionDate) are exported. I am filing this as a bug report rather than a feature request because in reviewing the code (DataForm::www_exportTab), it appears that this extra info was meant to be exported, as it is gathered into the data array here: while (my $entryData = $entries->hashRef) { $data[$i] = { entryId => $entryData->{DataForm_entryId}, ipAddress => $entryData->{ipAddress}, username => $entryData->{username}, userId => $entryData->{userId}, submissionDate => $self->session->datetime->epochToHuman($entryData->{submissionDate}), };However, later when the actual text to export is created, only fields from the DataForm_field table are pulled out, so the fields defined above do not get exported: foreach my $fieldId (keys %fields) { next if (isIn($fields{$fieldId}, qw(to from cc bcc subject)) && $noMailData); my $value = $record->{$fields{$fieldId}}; $value =~ s/\t/\\t/g; $value =~ s/\r//g; $value =~ s/\n/;/g; push(@row, $value); } $tab .= join("\t", @row)."\n"; Where %fields is defined above as: my %fields = $self->session->db->buildHash("select DataForm_fieldId,name from DataForm_field where assetId=".$self->session->db->quote($self->getId)." order by sequenceNumber");
|