[freeside-commits] freeside/FS/FS Record.pm,1.214.2.4,1.214.2.5
Ivan,,,
ivan at wavetail.420.am
Sun May 1 12:27:56 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv9263/FS/FS
Modified Files:
Tag: FREESIDE_2_1_BRANCH
Record.pm
Log Message:
cdr reimporting, RT#12181
Index: Record.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Record.pm,v
retrieving revision 1.214.2.4
retrieving revision 1.214.2.5
diff -u -w -d -r1.214.2.4 -r1.214.2.5
--- Record.pm 5 Apr 2011 16:38:20 -0000 1.214.2.4
+++ Record.pm 1 May 2011 19:27:54 -0000 1.214.2.5
@@ -1630,6 +1630,8 @@
=item fields - Alternate way to specify import, specifying import fields directly as a listref
+=item preinsert_callback
+
=item postinsert_callback
=item params
@@ -1664,9 +1666,14 @@
my( $type, $header, $sep_char, $fixedlength_format,
$xml_format, $row_callback, @fields );
+
my $postinsert_callback = '';
$postinsert_callback = $param->{'postinsert_callback'}
if $param->{'postinsert_callback'};
+ my $preinsert_callback = '';
+ $preinsert_callback = $param->{'preinsert_callback'}
+ if $param->{'preinsert_callback'};
+
if ( $param->{'format'} ) {
my $format = $param->{'format'};
@@ -1914,6 +1921,16 @@
}
next if exists( $param->{skiprow} );
+ if ( $preinsert_callback ) {
+ my $error = &{$postinsert_callback}($record, $param);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "preinsert_callback error". ( $line ? " for $line" : '' ).
+ ": $error";
+ }
+ next if exists $param->{skiprow} && $param->{skiprow};
+ }
+
my $error = $record->insert;
if ( $error ) {
More information about the freeside-commits
mailing list