Setup services

<%= foreach my $pkg ( grep { scalar(@{$_->{part_svc}}) || scalar(@{$_->{cust_svc}}) } @cust_pkg ) { my $susp = $pkg->{'susp'} || ''; warn $pkg->{'pkg'}. ' '.$susp."\n"; my @pkg_actions = ( [ 'customer_change_pkg' => 'change' ] ); push @pkg_actions, [ 'process_suspend_pkg' => 'suspend' ] if $self_suspend_reason and !$susp; my $bgcolor = $susp ? '"#ff9900"' : '"#8888ff"'; $OUT .= #'

'. '
'. $pkg->{'pkg'}. ($susp && ' (suspended)'). ' | '; foreach my $action (@pkg_actions) { $OUT .= '(' . $action->[1] . ') '; } $OUT .= '
--- | ---
'; my $col1 = "ffffff"; my $col2 = "dddddd"; my $col = $col1; foreach my $cust_svc ( @{ $pkg->{cust_svc} } ) { my $td = qq! | ". $cust_svc->{label}[0]. ': '. "$td>". $cust_svc->{label}[1]. ''; $OUT .= '
password: '. encode_entities($cust_svc->{_password}). '' if exists($cust_svc->{_password}); if ( exists($cust_svc->{svchash}) ) { $OUT .= '
Email: '. encode_entities($cust_svc->{svchash}->{email}). '' if exists($cust_svc->{svchash}->{email}) && length($cust_svc->{svchash}->{email}); $OUT .= '
Forward to: '. encode_entities($cust_svc->{svchash}->{forwarddst}). '' if exists($cust_svc->{svchash}->{forwarddst}) && length($cust_svc->{svchash}->{forwarddst}); } $OUT .= ''. "$td>"; #if ( $cust_svc->{label}[2] eq 'svc_acct' ) { # $OUT .= qq!(!. # 'change pw) '; #} unless ( $cust_svc->{'svcnum'} == $svcnum ) { $OUT .= qq!(!. 'delete)'; $OUT .= qq!
(modify)! if ( exists($cust_svc->{svchash}) && $cust_svc->{label}[2] eq 'svc_phone' ); } $OUT .= ''; $col = $col eq $col1 ? $col2 : $col1; } $OUT .= '
' if scalar(@{$pkg->{part_svc}}) && scalar(@{$pkg->{cust_svc}}); $col = $col1; foreach my $part_svc ( @{ $pkg->{part_svc} } ) { my $td = qq! | {'svcdb'} eq 'svc_external' #&& $conf->exists('svc_external-skip_manual') ) { $link = "${url}process_svc_external;". "pkgnum=$pkg->{'pkgnum'};". "svcpart=$part_svc->{'svcpart'}"; } else { $link = "${url}provision_svc;". "pkgnum=$pkg->{'pkgnum'};". "svcpart=$part_svc->{'svcpart'}"; } $OUT .= " $td COLSPAN=3 ALIGN=center>". qq!!. 'Setup '. $part_svc->{'svc'}. ' '. '('. $part_svc->{'num_avail'}. ' available)'. '
' #self-service only supports these services so far if grep { $part_svc->{'svcdb'} eq $_ } qw( svc_acct svc_external ); $col = $col eq $col1 ? $col2 : $col1; } #$OUT .= '

'; $OUT .= '
'; } %>