X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_acct.cgi;h=a730531f53f5e63b3c534295adfd2303c20d450a;hb=598102bce2442157492847c7bf43abf8140edf9f;hp=4420bb609bfbffb2d129dabb250a68279e9eabfa;hpb=0ebeec96313dd7edfca340f01f8fbbbac1f4aa1d;p=freeside.git
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
index 4420bb609..a730531f5 100755
--- a/httemplate/edit/svc_acct.cgi
+++ b/httemplate/edit/svc_acct.cgi
@@ -35,8 +35,6 @@ if ( $cgi->param('error') ) {
} else { #adding
- $svc_acct = new FS::svc_acct({});
-
foreach $_ (split(/-/,$query)) {
$pkgnum=$1 if /^pkgnum(\d+)$/;
$svcpart=$1 if /^svcpart(\d+)$/;
@@ -44,6 +42,8 @@ if ( $cgi->param('error') ) {
$part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
+ $svc_acct = new FS::svc_acct({svcpart => $svcpart});
+
$svcnum='';
#set gecos
@@ -96,8 +96,10 @@ if ( $svc_acct->_password ) {
$password = '';
}
-my $ulen = $conf->config('usernamemax')
- || $svc_acct->dbdef_table->column('username')->length;
+my $ulen =
+ $conf->exists('usernamemax')
+ ? $conf->config('usernamemax')
+ : dbdef->table('svc_acct')->column('username')->length;
my $ulen2 = $ulen+2;
my $pmax = $conf->config('passwordmax') || 8;
@@ -281,6 +283,14 @@ if ( $part_svc->part_svc_column('usergroup')->columnflag eq "F" ) {
}
print '';
+foreach my $field ($svc_acct->virtual_fields) {
+ if ( $part_svc->part_svc_column($field)->columnflag ne 'F' ) {
+ # If the flag is X, it won't even show up in $svc_acct->virtual_fields.
+ print $svc_acct->pvf($field)->widget('HTML', 'edit',
+ $svc_acct->getfield($field));
+ }
+}
+
#submit
print qq!
!;