projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
import package definitions, RT#32639
[freeside.git]
/
FS
/
FS
/
Record.pm
diff --git
a/FS/FS/Record.pm
b/FS/FS/Record.pm
index
4546741
..
f8282c0
100644
(file)
--- a/
FS/FS/Record.pm
+++ b/
FS/FS/Record.pm
@@
-45,6
+45,8
@@
our $nowarn_classload = 0;
our $no_update_diff = 0;
our $no_history = 0;
our $no_update_diff = 0;
our $no_history = 0;
+our $qsearch_qualify_columns = 1;
+
our $no_check_foreign = 1; #well, not inefficiently in perl by default anymore
my $rsa_module;
our $no_check_foreign = 1; #well, not inefficiently in perl by default anymore
my $rsa_module;
@@
-754,7
+756,7
@@
sub get_real_fields {
my $op = '=';
my $column = $_;
my $op = '=';
my $column = $_;
- my $table_column =
"$table.$column"
;
+ my $table_column =
$qsearch_qualify_columns ? "$table.$column" : $column
;
my $type = dbdef->table($table)->column($column)->type;
my $value = $record->{$column};
$value = $value->{'value'} if ref($value);
my $type = dbdef->table($table)->column($column)->type;
my $value = $record->{$column};
$value = $value->{'value'} if ref($value);
@@
-1807,6
+1809,7
@@
sub process_batch_import {
#?
default_csv => $opt->{default_csv},
postinsert_callback => $opt->{postinsert_callback},
#?
default_csv => $opt->{default_csv},
postinsert_callback => $opt->{postinsert_callback},
+ insert_args_callback => $opt->{insert_args_callback},
);
if ( $opt->{'batch_namecol'} ) {
);
if ( $opt->{'batch_namecol'} ) {
@@
-1893,6
+1896,9
@@
sub batch_import {
my $preinsert_callback = '';
$preinsert_callback = $param->{'preinsert_callback'}
if $param->{'preinsert_callback'};
my $preinsert_callback = '';
$preinsert_callback = $param->{'preinsert_callback'}
if $param->{'preinsert_callback'};
+ my $insert_args_callback = '';
+ $insert_args_callback = $param->{'insert_args_callback'}
+ if $param->{'insert_args_callback'};
if ( $param->{'format'} ) {
if ( $param->{'format'} ) {
@@
-2202,7
+2208,12
@@
sub batch_import {
next if exists $param->{skiprow} && $param->{skiprow};
}
next if exists $param->{skiprow} && $param->{skiprow};
}
- my $error = $record->insert;
+ my @insert_args = ();
+ if ( $insert_args_callback ) {
+ @insert_args = &{$insert_args_callback}($record, $param);
+ }
+
+ my $error = $record->insert(@insert_args);
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;