summaryrefslogtreecommitdiff
path: root/FS/FS/svc_Common.pm
diff options
context:
space:
mode:
authorivan <ivan>2006-08-06 09:10:07 +0000
committerivan <ivan>2006-08-06 09:10:07 +0000
commit936038efe0b75ad037619167f62db7fe16c25255 (patch)
tree14074f0e128ddaaaa4a5678754a4cf48fbd6ab52 /FS/FS/svc_Common.pm
parent7fc8c3c193c3d673a58566569a0e82609212a087 (diff)
this should process default usergroup as well as fixed now
Diffstat (limited to 'FS/FS/svc_Common.pm')
-rw-r--r--FS/FS/svc_Common.pm15
1 files changed, 9 insertions, 6 deletions
diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm
index c1c482d72..fdb4132c4 100644
--- a/FS/FS/svc_Common.pm
+++ b/FS/FS/svc_Common.pm
@@ -51,7 +51,9 @@ sub new {
#$self->{'Hash'} = shift;
my $newhash = shift;
$self->{'Hash'} = { map { $_ => $newhash->{$_} } qw(svcnum svcpart) };
- $self->setdefault;
+
+ $self->setdefault( $self->_fieldhandlers );
+
$self->{'Hash'}{$_} = $newhash->{$_}
foreach grep { defined($newhash->{$_}) && length($newhash->{$_}) }
keys %$newhash;
@@ -69,6 +71,9 @@ sub new {
$self;
}
+#empty default
+sub _fieldhandlers { (); }
+
sub virtual_fields {
# This restricts the fields based on part_svc_column and the svcpart of
@@ -490,11 +495,9 @@ sub setx {
my $columnname = $part_svc_column->columnname;
my $columnvalue = $part_svc_column->columnvalue;
- if ( exists( $coderef->{$columnname} ) ) {
- &{ $coderef->{$columnname} }( $self, $columnvalue);
- } else {
- $self->setfield( $columnname, $columnvalue );
- }
+ $columnvalue = &{ $coderef->{$columnname} }( $self, $columnvalue )
+ if exists( $coderef->{$columnname} );
+ $self->setfield( $columnname, $columnvalue );
}