[freeside-commits] freeside/FS/FS Record.pm,1.222,1.223
Ivan,,,
ivan at wavetail.420.am
Sun May 1 12:27:54 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv9254/FS/FS
Modified Files:
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.222
retrieving revision 1.223
diff -u -w -d -r1.222 -r1.223
--- Record.pm 24 Apr 2011 00:33:35 -0000 1.222
+++ Record.pm 1 May 2011 19:27:52 -0000 1.223
@@ -1633,6 +1633,8 @@
=item fields - Alternate way to specify import, specifying import fields directly as a listref
+=item preinsert_callback
+
=item postinsert_callback
=item params
@@ -1667,9 +1669,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'};
@@ -1917,6 +1924,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