projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
prepaid download/upload tracking
[freeside.git]
/
FS
/
FS
/
option_Common.pm
diff --git
a/FS/FS/option_Common.pm
b/FS/FS/option_Common.pm
index
c57e55b
..
ad3c269
100644
(file)
--- a/
FS/FS/option_Common.pm
+++ b/
FS/FS/option_Common.pm
@@
-81,7
+81,7
@@
sub insert {
# $dbh->rollback if $oldAutoCommit;
# return $@;
#}
# $dbh->rollback if $oldAutoCommit;
# return $@;
#}
- my $option_record =
$option_table
->new($href);
+ my $option_record =
"FS::$option_table"
->new($href);
$error = $option_record->insert;
if ( $error ) {
$error = $option_record->insert;
if ( $error ) {
@@
-124,7
+124,7
@@
sub delete {
}
my $pkey = $self->pkey;
}
my $pkey = $self->pkey;
- my $option_table = $self->option_table;
+
#
my $option_table = $self->option_table;
foreach my $obj ( $self->option_objects ) {
my $error = $obj->delete;
foreach my $obj ( $self->option_objects ) {
my $error = $obj->delete;
@@
-140,7
+140,7
@@
sub delete {
}
}
-=item replace [ HASHREF | OPTION => VALUE ... ]
+=item replace
OLD_RECORD
[ HASHREF | OPTION => VALUE ... ]
Replaces the OLD_RECORD with this one in the database. If there is an error,
returns the error, otherwise returns false.
Replaces the OLD_RECORD with this one in the database. If there is an error,
returns the error, otherwise returns false.
@@
-198,7
+198,7
@@
sub replace {
# $dbh->rollback if $oldAutoCommit;
# return $@;
#}
# $dbh->rollback if $oldAutoCommit;
# return $@;
#}
- my $new =
$option_table
->new($href);
+ my $new =
"FS::$option_table"
->new($href);
$new->optionnum($old->optionnum) if $old;
my $error = $old ? $new->replace($old) : $new->insert;
$new->optionnum($old->optionnum) if $old;
my $error = $old ? $new->replace($old) : $new->insert;