X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_svc.cgi;h=d4bb4704c013279f2b6d06f846af78929ac1961a;hp=b4900a01c433364cfeb7dcef8ffbdce5d0d0b255;hb=b938a41859030d3d3a126f39fa1b64b9211145a5;hpb=74e64d70361848f089aad9a7881c2af9caf6e479 diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index b4900a01c..d4bb4704c 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,10 +1,17 @@ <% my $part_svc; + my $clone = ''; if ( $cgi->param('error') ) { #error $part_svc = new FS::part_svc ( { map { $_, scalar($cgi->param($_)) } fields('part_svc') } ); + } elsif ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {#clone + #$cgi->param('clone') =~ /^(\d+)$/ or die "malformed query: $query"; + $part_svc = qsearchs('part_svc', { 'svcpart'=>$1 } ) + or die "unknown svcpart: $1"; + $clone = $part_svc->svcpart; + $part_svc->svcpart(''); } elsif ( $cgi->keywords ) { #edit my($query) = $cgi->keywords; $query =~ /^(\d+)$/ or die "malformed query: $query"; @@ -43,9 +50,9 @@ Disable new orders
  • svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts
  • svc_domain - Domains -
  • svc_acct_sm - deprecated (use svc_forward for new installations) Virtual domain mail aliasing.
  • svc_forward - mail forwarding
  • svc_www - Virtual domain website +
  • svc_broadband - Broadband/High-speed Internet service @@ -73,7 +80,10 @@ my %defs = ( select_key => 'popnum', select_label => 'city', }, - 'username' => 'Username', + 'username' => { + desc => 'Username', + type => 'disabled', + }, 'quota' => '', '_password' => 'Password', 'gid' => 'GID (when blank, defaults to UID)', @@ -94,11 +104,6 @@ my %defs = ( 'svc_domain' => { 'domain' => 'Domain', }, - 'svc_acct_sm' => { - 'domuser' => 'domuser@virtualdomain.com', - 'domuid' => 'UID where domuser@virtualdomain.com mail is forwarded', - 'domsvc' => 'svcnum from svc_domain for virtualdomain.com', - }, 'svc_forward' => { 'srcsvc' => 'service from which mail is to be forwarded', 'dstsvc' => 'service to which mail is to be forwarded', @@ -115,11 +120,21 @@ my %defs = ( #'recnum' => '', #'usersvc' => '', }, + 'svc_broadband' => { + 'actypenum' => 'This is the actypenum that refers to the type of AC that can be provisioned for this service. This field must be set fixed.', + 'speed_down' => 'Maximum download speed for this service in Kbps. 0 denotes unlimited.', + 'speed_up' => 'Maximum upload speed for this service in Kbps. 0 denotes unlimited.', + 'acnum' => 'acnum of a specific AC that this service is restricted to. Not required', + 'ip_addr' => 'IP address. Leave blank for automatic assignment.', + 'ip_netmask' => 'Mask length, aka. netmask bits. (Eg. 255.255.255.0 == 24)', + 'mac_addr' => 'MAC address which is used by some ACs for access control. Specified by 6 colon seperated hex octets. (Eg. 00:00:0a:bc:1a:2b)', + 'location' => 'Defines the physically location at which this service was installed. This is not necessarily the billing address', + }, ); my @dbs = $hashref->{svcdb} ? ( $hashref->{svcdb} ) - : qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ); + : qw( svc_acct svc_domain svc_forward svc_www svc_broadband ); tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } @dbs; my $widget = new HTML::Widgets::SelectLayers( @@ -132,13 +147,37 @@ my %defs = ( 'form_checkbox' => [ 'disabled' ], 'layer_callback' => sub { my $layer = shift; - my $html = qq!!. - table(). "FieldModifier"; + my $html = qq!!; + + my $columns = 3; + my $count = 0; + my @part_export = + map { qsearch( 'part_export', {exporttype => $_ } ) } + keys %{FS::part_export::export_info($layer)}; + $html .= '

    '. table(). + table(). "Exports"; + foreach my $part_export ( @part_export ) { + $html .= 'svcpart ) #null svcpart search causing error + && qsearchs( 'export_svc', { + exportnum => $part_export->exportnum, + svcpart => $clone || $part_svc->svcpart }); + $html .= '>'. $part_export->exportnum. ': '. $part_export->exporttype. + ' to '. $part_export->machine. ''; + $count++; + $html .= '' unless $count % $columns; + } + $html .= '

    '; + + $html .= table(). "FieldModifier"; #yucky kludge my @fields = defined( $FS::Record::dbdef->table($layer) ) ? grep { $_ ne 'svcnum' } fields($layer) : (); push @fields, 'usergroup' if $layer eq 'svc_acct'; #kludge + $part_svc->svcpart($clone) if $clone; #haha, undone below foreach my $field (@fields) { my $part_svc_column = $part_svc->part_svc_column($field); my $value = $cgi->param('error') @@ -153,14 +192,19 @@ my %defs = ( $html .= "$field"; $html .= "- $desc" if $desc; $html .= ""; + $flag = '' if ref($def) && $def->{type} eq 'disabled'; $html .= qq!Off". - qq!Default ". - qq!Fixed ". - '
    '; + ''; + unless ( ref($def) && $def->{type} eq 'disabled' ) { + $html .= + qq!Default ". + qq!Fixed ". + '
    '; + } if ( ref($def) ) { if ( $def->{type} eq 'select' ) { $html .= qq!!; } else { $html .= 'unknown type'. $def->{type}; } @@ -184,6 +231,7 @@ my %defs = ( } $html .= "\n"; } + $part_svc->svcpart('') if $clone; #undone $html .= ""; $html .= '