X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fsvc_acct-domains.cgi;h=57345748396ba570818c62ae896eaebd6c983f16;hp=5e96b8d710abe8e4695edefe416aa203b8139819;hb=79c8be3bd0c5db42794b36bf5b5dd25addba67cb;hpb=c193fc003020c040668cd801fca6447939c07e6c diff --git a/httemplate/misc/svc_acct-domains.cgi b/httemplate/misc/svc_acct-domains.cgi index 5e96b8d71..573457483 100644 --- a/httemplate/misc/svc_acct-domains.cgi +++ b/httemplate/misc/svc_acct-domains.cgi @@ -1,25 +1,31 @@ -% -% -% my $pkgpart_svcpart = $cgi->param('arg'); -% $pkgpart_svcpart =~ /^\d+_(\d+)$/; -% my $part_svc = qsearchs('part_svc', { 'svcpart' => $1 }) if $1; -% my $part_svc_column = $part_svc->part_svc_column('domsvc'); -% -% my @output = split /,/, $part_svc_column->columnvalue; -% my @svc_domain = (); -% my %seen = (); -% -% foreach (@output) { -% my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $_ }) -% or warn "unknown svc_domain.svcnum $_ for part_svc_column domsvc; ". -% "svcpart = " . $part_svc->svcpart; -% push @svc_domain, [ $_ => $svc_domain->domain ]; -% $seen{$_}++; -% } -% if ($part_svc_column->columnflag eq 'D' || $part_svc_column->columnflag eq '') { -% foreach (grep { $_->svcnum ne $output[0] } qsearch('svc_domain', {}) ){ -% push @svc_domain, [ $_->svcnum => $_->domain ]; -% } -% } -% [ <% join(', ', map { qq("$_->[0]", "$_->[1]") } @svc_domain) %> ] +<%init> + +my $conf = new FS::Conf; + +my $pkgpart_svcpart = $cgi->param('arg'); +$pkgpart_svcpart =~ /^\d+_(\d+)$/; +my $part_svc = qsearchs('part_svc', { 'svcpart' => $1 }) if $1; +my $part_svc_column = $part_svc->part_svc_column('domsvc') if $part_svc; + +my @output = split /,/, $part_svc_column->columnvalue if $part_svc_column; +my $columnflag = $part_svc_column->columnflag if $part_svc_column; +my @svc_domain = (); +my %seen = (); + +foreach (@output) { + my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $_ }) + or warn "unknown svc_domain.svcnum $_ for part_svc_column domsvc; ". + "svcpart = " . $part_svc->svcpart; + push @svc_domain, [ $_ => $svc_domain->domain ]; + $seen{$_}++; +} +if ($conf->exists('svc_acct-alldomains') + && ( $columnflag eq 'D' || $columnflag eq '' ) + ) { + foreach (grep { $_->svcnum ne $output[0] } qsearch('svc_domain', {}) ){ + push @svc_domain, [ $_->svcnum => $_->domain ]; + } +} + +