diff options
Diffstat (limited to 'httemplate/view/svc_acct.cgi')
-rwxr-xr-x | httemplate/view/svc_acct.cgi | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi index 58591fcb5..f92e4e240 100755 --- a/httemplate/view/svc_acct.cgi +++ b/httemplate/view/svc_acct.cgi @@ -2,6 +2,7 @@ <% my $conf = new FS::Conf; +my $mydomain = $conf->config('domain'); my($query) = $cgi->keywords; $query =~ /^(\d+)$/; @@ -31,7 +32,11 @@ if ( $svc_acct->domsvc ) { die "Unknown domain" unless $svc_domain; $domain = $svc_domain->domain; } else { - die "No svc_domain.svcnum record for svc_acct.domsvc: ". $cust_svc->domsvc; + unless ( $mydomain ) { + die "No legacy domain config file and no svc_domain.svcnum record ". + "for svc_acct.domsvc: ". $cust_svc->domsvc; + } + $domain = $mydomain; } %> @@ -174,7 +179,7 @@ if ($svc_acct->slipip) { : $svc_acct->slipip ). "</TD>"; my($attribute); - foreach $attribute ( grep /^radius_/, $svc_acct->fields ) { + foreach $attribute ( grep /^radius_/, fields('svc_acct') ) { #warn $attribute; $attribute =~ /^radius_(.*)$/; my $pattribute = $FS::raddb::attrib{$1}; @@ -182,7 +187,7 @@ if ($svc_acct->slipip) { "<TD BGCOLOR=\"#ffffff\">". $svc_acct->getfield($attribute). "</TD></TR>"; } - foreach $attribute ( grep /^rc_/, $svc_acct->fields ) { + foreach $attribute ( grep /^rc_/, fields('svc_acct') ) { #warn $attribute; $attribute =~ /^rc_(.*)$/; my $pattribute = $FS::raddb::attrib{$1}; @@ -197,19 +202,7 @@ if ($svc_acct->slipip) { print '<TR><TD ALIGN="right">RADIUS groups</TD><TD BGCOLOR="#ffffff">'. join('<BR>', $svc_acct->radius_groups). '</TD></TR>'; -# Can this be abstracted further? Maybe a library function like -# widget('HTML', 'view', $svc_acct) ? It would definitely make UI -# style management easier. - -foreach (sort { $a cmp $b } $svc_acct->virtual_fields) { - print $svc_acct->pvf($_)->widget('HTML', 'view', $svc_acct->getfield($_)), - "\n"; -} -%> -</TABLE></TD></TR></TABLE> -<% - -print '<BR><BR>'; +print '</TABLE></TD></TR></TABLE><BR><BR>'; print join("\n", $conf->config('svc_acct-notes') ). '<BR><BR>'. joblisting({'svcnum'=>$svcnum}, 1). '</BODY></HTML>'; |