diff options
Diffstat (limited to 'httemplate/edit/process')
34 files changed, 0 insertions, 1431 deletions
diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi deleted file mode 100755 index 3d697ddfd..000000000 --- a/httemplate/edit/process/REAL_cust_pkg.cgi +++ /dev/null @@ -1,24 +0,0 @@ -<% - -my $pkgnum = $cgi->param('pkgnum') or die; -my $old = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my %hash = $old->hash; -$hash{'setup'} = $cgi->param('setup') ? str2time($cgi->param('setup')) : ''; -$hash{'bill'} = $cgi->param('bill') ? str2time($cgi->param('bill')) : ''; -$hash{'last_bill'} = - $cgi->param('last_bill') ? str2time($cgi->param('last_bill')) : ''; -$hash{'expire'} = $cgi->param('expire') ? str2time($cgi->param('expire')) : ''; -my $new = new FS::cust_pkg \%hash; - -my $error = $new->replace($old); - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "REAL_cust_pkg.cgi?". $cgi->query_string ); -} else { - my $custnum = $new->custnum; - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum". - "#cust_pkg$pkgnum" ); -} - -%> diff --git a/httemplate/edit/process/addr_block/add.cgi b/httemplate/edit/process/addr_block/add.cgi deleted file mode 100755 index 34d799ccd..000000000 --- a/httemplate/edit/process/addr_block/add.cgi +++ /dev/null @@ -1,20 +0,0 @@ -<% - -my $error = ''; -my $ip_gateway = $cgi->param('ip_gateway'); -my $ip_netmask = $cgi->param('ip_netmask'); - -my $new = new FS::addr_block { - ip_gateway => $ip_gateway, - ip_netmask => $ip_netmask, - routernum => 0 }; - -$error = $new->insert; - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(4). "browse/addr_block.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(4). "browse/addr_block.cgi"); -} -%> diff --git a/httemplate/edit/process/addr_block/allocate.cgi b/httemplate/edit/process/addr_block/allocate.cgi deleted file mode 100755 index 85b0d7a7a..000000000 --- a/httemplate/edit/process/addr_block/allocate.cgi +++ /dev/null @@ -1,25 +0,0 @@ -<% -my $error = ''; -my $blocknum = $cgi->param('blocknum'); -my $routernum = $cgi->param('routernum'); - -my $addr_block = qsearchs('addr_block', { blocknum => $blocknum }); -my $router = qsearchs('router', { routernum => $routernum }); - -if($addr_block) { - if ($router) { - $error = $addr_block->allocate($router); - } else { - $error = "Cannot find router with routernum $routernum"; - } -} else { - $error = "Cannot find block with blocknum $blocknum"; -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(4). "browse/addr_block.cgi?" . $cgi->query_string); -} else { - print $cgi->redirect(popurl(4). "browse/addr_block.cgi"); -} -%> diff --git a/httemplate/edit/process/addr_block/deallocate.cgi b/httemplate/edit/process/addr_block/deallocate.cgi deleted file mode 100755 index cfb7ed04d..000000000 --- a/httemplate/edit/process/addr_block/deallocate.cgi +++ /dev/null @@ -1,24 +0,0 @@ -<% -my $error = ''; -my $blocknum = $cgi->param('blocknum'); - -my $addr_block = qsearchs('addr_block', { blocknum => $blocknum }); - -if($addr_block) { - my $router = $addr_block->router; - if ($router) { - $error = $addr_block->deallocate($router); - } else { - $error = "Block is not allocated to a router"; - } -} else { - $error = "Cannot find block with blocknum $blocknum"; -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(4). "browse/addr_block.cgi?" . $cgi->query_string); -} else { - print $cgi->redirect(popurl(4). "browse/addr_block.cgi"); -} -%> diff --git a/httemplate/edit/process/addr_block/split.cgi b/httemplate/edit/process/addr_block/split.cgi deleted file mode 100755 index bb6d4ba3e..000000000 --- a/httemplate/edit/process/addr_block/split.cgi +++ /dev/null @@ -1,19 +0,0 @@ -<% -my $error = ''; -my $blocknum = $cgi->param('blocknum'); -my $addr_block = qsearchs('addr_block', { blocknum => $blocknum }); - -if ( $addr_block) { - $error = $addr_block->split_block; -} else { - $error = "Unknown blocknum: $blocknum"; -} - - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(4). "browse/addr_block.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(4). "browse/addr_block.cgi"); -} -%> diff --git a/httemplate/edit/process/agent.cgi b/httemplate/edit/process/agent.cgi deleted file mode 100755 index 182eeab41..000000000 --- a/httemplate/edit/process/agent.cgi +++ /dev/null @@ -1,28 +0,0 @@ -<% - -my $agentnum = $cgi->param('agentnum'); - -my $old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum; - -my $new = new FS::agent ( { - map { - $_, scalar($cgi->param($_)); - } fields('agent') -} ); - -my $error; -if ( $agentnum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $agentnum=$new->getfield('agentnum'); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/agent.cgi"); -} - -%> diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi deleted file mode 100755 index 516594573..000000000 --- a/httemplate/edit/process/agent_type.cgi +++ /dev/null @@ -1,55 +0,0 @@ -<% - -my $typenum = $cgi->param('typenum'); -my $old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum; - -my $new = new FS::agent_type ( { - map { - $_, scalar($cgi->param($_)); - } fields('agent_type') -} ); - -my $error; -if ( $typenum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $typenum=$new->getfield('typenum'); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string ); -} else { - - #false laziness w/ edit/process/part_svc.cgi - foreach my $part_pkg (qsearch('part_pkg',{})) { - my($pkgpart)=$part_pkg->getfield('pkgpart'); - - my($type_pkgs)=qsearchs('type_pkgs',{ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - if ( $type_pkgs && ! $cgi->param("pkgpart$pkgpart") ) { - my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below. - $error=$d_type_pkgs->delete; - die $error if $error; - - } elsif ( $cgi->param("pkgpart$pkgpart") - && ! $type_pkgs - ) { - #ok to clobber it now (but bad form nonetheless?) - $type_pkgs=new FS::type_pkgs ({ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - $error= $type_pkgs->insert; - die $error if $error; - } - - } - - print $cgi->redirect(popurl(3). "browse/agent_type.cgi"); -} - -%> diff --git a/httemplate/edit/process/cust_bill_pay.cgi b/httemplate/edit/process/cust_bill_pay.cgi deleted file mode 100755 index 0c33506a8..000000000 --- a/httemplate/edit/process/cust_bill_pay.cgi +++ /dev/null @@ -1,31 +0,0 @@ -<% - -$cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!"; -my $paynum = $1; - -my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ) - or die "No such paynum"; - -my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pay->custnum } ) - or die "Bogus credit: not attached to customer"; - -my $custnum = $cust_main->custnum; - -my $new = new FS::cust_bill_pay ( { - map { - $_, scalar($cgi->param($_)); - #} qw(custnum _date amount invnum) - } fields('cust_bill_pay') -} ); - -my $error = $new->insert; - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -} - - -%> diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi deleted file mode 100755 index ac92631f8..000000000 --- a/httemplate/edit/process/cust_credit.cgi +++ /dev/null @@ -1,30 +0,0 @@ -<% - -$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; -my $custnum = $1; - -$cgi->param('otaker',getotaker); - -my $new = new FS::cust_credit ( { - map { - $_, scalar($cgi->param($_)); - #} qw(custnum _date amount otaker reason) - } fields('cust_credit') -} ); - -my $error = $new->insert; - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_credit.cgi?". $cgi->query_string ); -} else { - if ( $cgi->param('apply') eq 'yes' ) { - my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum }) - or die "unknown custnum $custnum"; - $cust_main->apply_credits; - } - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -} - - -%> diff --git a/httemplate/edit/process/cust_credit_bill.cgi b/httemplate/edit/process/cust_credit_bill.cgi deleted file mode 100755 index 23e2e6ce5..000000000 --- a/httemplate/edit/process/cust_credit_bill.cgi +++ /dev/null @@ -1,43 +0,0 @@ -<% - -$cgi->param('crednum') =~ /^(\d*)$/ or die "Illegal crednum!"; -my $crednum = $1; - -my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ) - or die "No such crednum"; - -my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_credit->custnum } ) - or die "Bogus credit: not attached to customer"; - -my $custnum = $cust_main->custnum; - -my $new; -if ($cgi->param('invnum') =~ /^Refund$/) { - $new = new FS::cust_refund ( { - 'reason' => $cust_credit->reason, - 'refund' => $cgi->param('amount'), - 'payby' => 'BILL', - #'_date' => $cgi->param('_date'), - 'payinfo' => 'Cash', - 'crednum' => $crednum, - } ); -} else { - $new = new FS::cust_credit_bill ( { - map { - $_, scalar($cgi->param($_)); - #} qw(custnum _date amount invnum) - } fields('cust_credit_bill') - } ); -} - -my $error = $new->insert; - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_credit_bill.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -} - - -%> diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi deleted file mode 100755 index 25c346e46..000000000 --- a/httemplate/edit/process/cust_main.cgi +++ /dev/null @@ -1,133 +0,0 @@ -<% - -my $error = ''; - -#unmunge stuff - -$cgi->param('tax','') unless defined $cgi->param('tax'); - -$cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] ); - -my $payby = $cgi->param('payby'); -if ( $payby ) { - if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) { - $cgi->param('payinfo', - $cgi->param($payby. '_payinfo1'). '@'. $cgi->param($payby. '_payinfo2') ); - } else { - $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); - } - $cgi->param('paydate', - $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); - $cgi->param('payname', $cgi->param( $payby. '_payname' ) ); - $cgi->param('paycvv', $cgi->param( $payby. '_paycvv' ) ) - if defined $cgi->param( $payby. '_paycvv' ); -} - -$cgi->param('otaker', &getotaker ); - -my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); -push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); -$cgi->param('invoicing_list', join(',', @invoicing_list) ); - - -#create new record object - -my $new = new FS::cust_main ( { - map { - $_, scalar($cgi->param($_)) -# } qw(custnum agentnum last first ss company address1 address2 city county -# state zip daytime night fax payby payinfo paydate payname tax -# otaker refnum) - } fields('cust_main') -} ); - -if ( defined($cgi->param('same')) && $cgi->param('same') eq "Y" ) { - $new->setfield("ship_$_", '') foreach qw( - last first company address1 address2 city county state zip - country daytime night fax - ); -} - -#perhaps this stuff should go to cust_main.pm -my $cust_pkg = ''; -my $svc_acct = ''; -if ( $new->custnum eq '' ) { - - if ( $cgi->param('pkgpart_svcpart') ) { - my $x = $cgi->param('pkgpart_svcpart'); - $x =~ /^(\d+)_(\d+)$/ or die "illegal pkgpart_svcpart $x\n"; - my($pkgpart, $svcpart) = ($1, $2); - #false laziness: copied from FS::cust_pkg::order (which should become a - #FS::cust_main method) - my(%part_pkg); - # generate %part_pkg - # $part_pkg{$pkgpart} is true iff $custnum may purchase $pkgpart - my $agent = qsearchs('agent',{'agentnum'=> $new->agentnum }); - #my($type_pkgs); - #foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) { - # my($pkgpart)=$type_pkgs->pkgpart; - # $part_pkg{$pkgpart}++; - #} - # $pkgpart_href->{PKGPART} is true iff $custnum may purchase $pkgpart - my $pkgpart_href = $agent->pkgpart_hashref; - #eslaf - - # this should wind up in FS::cust_pkg! - $error ||= "Agent ". $new->agentnum. " (type ". $agent->typenum. ") can't ". - "purchase pkgpart ". $pkgpart - #unless $part_pkg{ $pkgpart }; - unless $pkgpart_href->{ $pkgpart }; - - $cust_pkg = new FS::cust_pkg ( { - #later 'custnum' => $custnum, - 'pkgpart' => $pkgpart, - } ); - $error ||= $cust_pkg->check; - - #$cust_svc = new FS::cust_svc ( { 'svcpart' => $svcpart } ); - - #$error ||= $cust_svc->check; - - $svc_acct = new FS::svc_acct ( { - 'svcpart' => $svcpart, - 'username' => $cgi->param('username'), - '_password' => $cgi->param('_password'), - 'popnum' => $cgi->param('popnum'), - } ); - - my $y = $svc_acct->setdefault; # arguably should be in new method - $error ||= $y unless ref($y); - #and just in case you were silly - $svc_acct->svcpart($svcpart); - $svc_acct->username($cgi->param('username')); - $svc_acct->_password($cgi->param('_password')); - $svc_acct->popnum($cgi->param('popnum')); - - $error ||= $svc_acct->check; - - } elsif ( $cgi->param('username') ) { #good thing to catch - $error = "Can't assign username without a package!"; - } - - use Tie::RefHash; - tie my %hash, 'Tie::RefHash'; - %hash = ( $cust_pkg => [ $svc_acct ] ) if $cust_pkg; - $error ||= $new->insert( \%hash, \@invoicing_list ); -} else { #create old record object - my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } ); - $error ||= "Old record not found!" unless $old; - if ( defined dbdef->table('cust_main')->column('paycvv') - && length($old->paycvv) - && $new->paycvv =~ /^\s*\*+\s*$/ ) { - $new->paycvv($old->paycvv); - } - $error ||= $new->replace($old, \@invoicing_list); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_main.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new->custnum); -} -%> diff --git a/httemplate/edit/process/cust_main_county-collapse.cgi b/httemplate/edit/process/cust_main_county-collapse.cgi deleted file mode 100755 index 5da9dea80..000000000 --- a/httemplate/edit/process/cust_main_county-collapse.cgi +++ /dev/null @@ -1,35 +0,0 @@ -<% - -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/ or die "Illegal taxnum!"; -my $taxnum = $1; -my $cust_main_county = qsearchs('cust_main_county', { 'taxnum' => $taxnum } ) - or die "Unknown taxnum $taxnum"; - -#really should do this in a .pm & start transaction - -foreach my $delete ( qsearch('cust_main_county', { - 'country' => $cust_main_county->country, - 'state' => $cust_main_county->state - } ) ) { -# unless ( qsearch('cust_main',{ -# 'state' => $cust_main_county->getfield('state'), -# 'county' => $cust_main_county->getfield('county'), -# 'country' => $cust_main_county->getfield('country'), -# } ) ) { - my $error = $delete->delete; - die $error if $error; -# } else { - #should really fix the $cust_main record -# } - -} - -$cust_main_county->taxnum(''); -$cust_main_county->county(''); -my $error = $cust_main_county->insert; -die $error if $error; - -print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); - -%> diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi deleted file mode 100755 index a452711c1..000000000 --- a/httemplate/edit/process/cust_main_county-expand.cgi +++ /dev/null @@ -1,58 +0,0 @@ -<% - -$cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; -my $taxnum = $1; -my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum}) - or die ("Unknown taxnum!"); - -my @expansion; -if ( $cgi->param('delim') eq 'n' ) { - @expansion=split(/\n/,$cgi->param('expansion')); -} elsif ( $cgi->param('delim') eq 's' ) { - @expansion=split(' ',$cgi->param('expansion')); -} else { - die "Illegal delim!"; -} - -@expansion=map { - unless ( /^\s*([\w\- ]+)\s*$/ ) { - $cgi->param('error', "Illegal item in expansion"); - print $cgi->redirect(popurl(2). "cust_main_county-expand.cgi?". $cgi->query_string ); - myexit(); - } - $1; -} @expansion; - -foreach ( @expansion) { - my(%hash)=$cust_main_county->hash; - my($new)=new FS::cust_main_county \%hash; - $new->setfield('taxnum',''); - if ( $cgi->param('taxclass') ) { - $new->setfield('taxclass', $_); - } elsif ( ! $cust_main_county->state ) { - $new->setfield('state',$_); - } else { - $new->setfield('county',$_); - } - #if (datasrc =~ m/Pg/) - #{ - # $new->setfield('tax',0.0); - #} - my($error)=$new->insert; - die $error if $error; -} - -unless ( qsearch( 'cust_main', { - 'state' => $cust_main_county->state, - 'county' => $cust_main_county->county, - 'country' => $cust_main_county->country, - } ) - || ! @expansion -) { - my($error)=($cust_main_county->delete); - die $error if $error; -} - -print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); - -%> diff --git a/httemplate/edit/process/cust_main_county.cgi b/httemplate/edit/process/cust_main_county.cgi deleted file mode 100755 index 9287ed150..000000000 --- a/httemplate/edit/process/cust_main_county.cgi +++ /dev/null @@ -1,30 +0,0 @@ -<% - -foreach ( grep { /^tax\d+$/ } $cgi->param ) { - /^tax(\d+)$/ or die "Illegal form $_!"; - my $taxnum = $1; - my $old = qsearchs('cust_main_county', { 'taxnum' => $taxnum }) - or die "Couldn't find taxnum $taxnum!"; - next unless $old->tax != $cgi->param("tax$taxnum") - || $old->exempt_amount != $cgi->param("exempt_amount$taxnum") - || $old->taxname ne $cgi->param("taxname$taxnum") - || $old->setuptax ne $cgi->param("setuptax$taxnum") - || $old->recurtax ne $cgi->param("recurtax$taxnum"); - my %hash = $old->hash; - $hash{tax} = $cgi->param("tax$taxnum"); - $hash{exempt_amount} = $cgi->param("exempt_amount$taxnum"); - $hash{taxname} = $cgi->param("taxname$taxnum"); - $hash{setuptax} = $cgi->param("setuptax$taxnum"); - $hash{recurtax} = $cgi->param("recurtax$taxnum"); - my $new = new FS::cust_main_county \%hash; - my $error = $new->replace($old); - if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string ); - myexit(); - } -} - -print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); - -%> diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi deleted file mode 100755 index 82442ae00..000000000 --- a/httemplate/edit/process/cust_pay.cgi +++ /dev/null @@ -1,39 +0,0 @@ -<% - -$cgi->param('linknum') =~ /^(\d+)$/ - or die "Illegal linknum: ". $cgi->param('linknum'); -my $linknum = $1; - -$cgi->param('link') =~ /^(custnum|invnum)$/ - or die "Illegal link: ". $cgi->param('link'); -my $link = $1; - -my $new = new FS::cust_pay ( { - $link => $linknum, - map { - $_, scalar($cgi->param($_)); - } qw(paid _date payby payinfo paybatch) - #} fields('cust_pay') -} ); - -my $error = $new->insert; - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string ); -} elsif ( $link eq 'invnum' ) { - print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum"); -} elsif ( $link eq 'custnum' ) { - if ( $cgi->param('apply') eq 'yes' ) { - my $cust_main = qsearchs('cust_main', { 'custnum' => $linknum }) - or die "unknown custnum $linknum"; - $cust_main->apply_payments; - } - if ( $cgi->param('quickpay') eq 'yes' ) { - print $cgi->redirect(popurl(3). "search/cust_main-quickpay.html"); - } else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum"); - } -} - -%> diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi deleted file mode 100755 index df8471c27..000000000 --- a/httemplate/edit/process/cust_pkg.cgi +++ /dev/null @@ -1,43 +0,0 @@ -<% - -my $error = ''; - -#untaint custnum -$cgi->param('custnum') =~ /^(\d+)$/; -my $custnum = $1; - -my @remove_pkgnums = map { - /^(\d+)$/ or die "Illegal remove_pkg value!"; - $1; -} $cgi->param('remove_pkg'); - -my $error_redirect; -my @pkgparts; -if ( $cgi->param('new_pkgpart') =~ /^(\d+)$/ ) { #came from misc/change_pkg.cgi - $error_redirect = "misc/change_pkg.cgi"; - @pkgparts = ($1); -} else { #came from edit/cust_pkg.cgi - $error_redirect = "edit/cust_pkg.cgi"; - foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { - if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { - my $num_pkgs = $1; - while ( $num_pkgs-- ) { - push @pkgparts,$pkgpart; - } - } else { - $error = "Illegal quantity"; - last; - } - } -} - -$error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(3). $error_redirect. '?'. $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -} - -%> diff --git a/httemplate/edit/process/domain_record.cgi b/httemplate/edit/process/domain_record.cgi deleted file mode 100755 index b8c3f62a1..000000000 --- a/httemplate/edit/process/domain_record.cgi +++ /dev/null @@ -1,34 +0,0 @@ -<% - -my $recnum = $cgi->param('recnum'); - -my $old = qsearchs('agent',{'recnum'=>$recnum}) if $recnum; - -my $new = new FS::domain_record ( { - map { - $_, scalar($cgi->param($_)); - } fields('domain_record') -} ); - -my $error; -if ( $recnum ) { - $error=$new->replace($old); -} else { - $error=$new->insert; - $recnum=$new->getfield('recnum'); -} - -if ( $error ) { -# $cgi->param('error', $error); -# print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string ); - #no edit screen to send them back to -%> -<!-- mason kludge --> -<% - eidiot($error); -} else { - my $svcnum = $new->svcnum; - print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum"); -} - -%> diff --git a/httemplate/edit/process/generic.cgi b/httemplate/edit/process/generic.cgi deleted file mode 100644 index 9c54feb1d..000000000 --- a/httemplate/edit/process/generic.cgi +++ /dev/null @@ -1,70 +0,0 @@ -<% - -# Welcome to generic.cgi. -# -# This script provides a generic edit/process/ backend for simple table -# editing. All it knows how to do is take the values entered into -# the script and insert them into the table specified by $cgi->param('table'). -# If there's an existing record with the same primary key, it will be -# replaced. (Deletion will be added in the future.) -# -# Special cgi params for this script: -# table: the name of the table to be edited. The script will die horribly -# if it can't find the table. -# redirect_ok: URL to be displayed after a successful edit. The value of -# the record's primary key will be passed as a keyword. -# Defaults to (freeside root)/view/$table.cgi. -# redirect_error: URL to be displayed if there's an error. The original -# query string, plus the error message, will be passed. -# Defaults to $cgi->referer() (i.e. go back where you -# came from). - - -use FS::Record qw(qsearchs dbdef); -use DBIx::DBSchema; -use DBIx::DBSchema::Table; - - -my $error; -my $p2 = popurl(2); -my $p3 = popurl(3); -my $table = $cgi->param('table'); -my $dbdef = dbdef or die "Cannot fetch dbdef!"; - -my $dbdef_table = $dbdef->table($table) or die "Cannot fetch schema for $table"; - -my $pkey = $dbdef_table->primary_key or die "Cannot fetch pkey for $table"; -my $pkey_val = $cgi->param($pkey); - - -#warn "new FS::Record ( $table, (hashref) )"; -my $new = FS::Record::new ( "FS::$table", { - map { $_, scalar($cgi->param($_)) } fields($table) -} ); - -#warn 'created $new of class '.ref($new); - -if($pkey_val and (my $old = qsearchs($table, { $pkey, $pkey_val} ))) { - # edit - $error = $new->replace($old); -} else { - #add - $error = $new->insert; - $pkey_val = $new->getfield($pkey); - # New records usually don't have their primary keys set until after - # they've been checked/inserted, so grab the new $pkey_val so we can - # redirect to it. -} - -my $redirect_ok = (($cgi->param('redirect_ok')) ? - $cgi->param('redirect_ok') : $p3."browse/generic.cgi?$table"); -my $redirect_error = (($cgi->param('redirect_error')) ? - $cgi->param('redirect_error') : $cgi->referer()); - -if($error) { - $cgi->param('error', $error); - print $cgi->redirect($redirect_error . '?' . $cgi->query_string); -} else { - print $cgi->redirect($redirect_ok); -} -%> diff --git a/httemplate/edit/process/msgcat.cgi b/httemplate/edit/process/msgcat.cgi deleted file mode 100644 index 1f94f6668..000000000 --- a/httemplate/edit/process/msgcat.cgi +++ /dev/null @@ -1,20 +0,0 @@ -<% - -my $error; -foreach my $param ( grep { /^\d+$/ } $cgi->param ) { - my $old = qsearchs('msgcat', { msgnum=>$param } ); - next if $old->msg eq $cgi->param($param); #no need to update identical records - my $new = new FS::msgcat { $old->hash }; - $new->msg($cgi->param($param)); - $error = $new->replace($old); - last if $error; -} - -if ( $error ) { - $cgi->param('error',$error); - print $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/msgcat.cgi"); -} - -%> diff --git a/httemplate/edit/process/part_bill_event.cgi b/httemplate/edit/process/part_bill_event.cgi deleted file mode 100755 index e224bf634..000000000 --- a/httemplate/edit/process/part_bill_event.cgi +++ /dev/null @@ -1,53 +0,0 @@ -<% - -my $eventpart = $cgi->param('eventpart'); - -my $old = qsearchs('part_bill_event',{'eventpart'=>$eventpart}) if $eventpart; - -#s/days/seconds/ -$cgi->param('seconds', $cgi->param('days') * 86400 ); - -my $error; -if ( ! $cgi->param('plan_weight_eventcode') ) { - $error = "Must select an action"; -} else { - - $cgi->param('plan_weight_eventcode') =~ /^([\w\-]+):(\d+):(.*)$/s - or die "illegal plan_weight_eventcode:". - $cgi->param('plan_weight_eventcode'); - $cgi->param('plan', $1); - $cgi->param('weight', $2); - my $eventcode = $3; - my $plandata = ''; - while ( $eventcode =~ /%%%(\w+)%%%/ ) { - my $field = $1; - my $value = $cgi->param($field); - $eventcode =~ s/%%%$field%%%/$value/; - $plandata .= "$field $value\n"; - } - $cgi->param('eventcode', $eventcode); - $cgi->param('plandata', $plandata); - - my $new = new FS::part_bill_event ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_bill_event'), - } ); - - if ( $eventpart ) { - $error = $new->replace($old); - } else { - $error = $new->insert; - $eventpart = $new->getfield('eventpart'); - } -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "part_bill_event.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3)."browse/part_bill_event.cgi"); -} - -%> - diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi deleted file mode 100644 index fa009edbb..000000000 --- a/httemplate/edit/process/part_export.cgi +++ /dev/null @@ -1,39 +0,0 @@ -<% - -my $exportnum = $cgi->param('exportnum'); - -my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum; - -#fixup options -#warn join('-', split(',',$cgi->param('options'))); -my %options = map { - my $value = $cgi->param($_); - $value =~ s/\r\n/\n/g; #browsers? (textarea) - $_ => $value; -} split(',', $cgi->param('options')); - -my $new = new FS::part_export ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_export') -} ); - -my $error; -if ( $exportnum ) { - #warn $old; - #warn $exportnum; - #warn $new->machine; - $error = $new->replace($old,\%options); -} else { - $error = $new->insert(\%options); -# $exportnum = $new->exportnum; -} - -if ( $error ) { - $cgi->param('error', $error ); - print $cgi->redirect(popurl(2). "part_export.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/part_export.cgi"); -} - -%> diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi deleted file mode 100755 index 7eada7bc8..000000000 --- a/httemplate/edit/process/part_pkg.cgi +++ /dev/null @@ -1,117 +0,0 @@ -<% - -my $dbh = dbh; - -my $pkgpart = $cgi->param('pkgpart'); - -my $old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart; - -#fixup plandata -my $plandata = $cgi->param('plandata'); -my @plandata = split(',', $plandata); -$cgi->param('plandata', - join('', map { "$_=". join(', ', $cgi->param($_)). "\n" } @plandata ) -); - -foreach (qw( setuptax recurtax disabled )) { - $cgi->param($_, '') unless defined $cgi->param($_); -} - -my $new = new FS::part_pkg ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_pkg') -} ); - -#warn "setuptax: ". $new->setuptax; -#warn "recurtax: ". $new->recurtax; - -#most of the stuff below should move to part_pkg.pm - -foreach my $part_svc ( qsearch('part_svc', {} ) ) { - my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0; - unless ( $quantity =~ /^(\d+)$/ ) { - $cgi->param('error', "Illegal quantity" ); - print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); - myexit(); - } -} - -local $SIG{HUP} = 'IGNORE'; -local $SIG{INT} = 'IGNORE'; -local $SIG{QUIT} = 'IGNORE'; -local $SIG{TERM} = 'IGNORE'; -local $SIG{TSTP} = 'IGNORE'; -local $SIG{PIPE} = 'IGNORE'; - -local $FS::UID::AutoCommit = 0; - -my $error; -if ( $pkgpart ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $pkgpart=$new->pkgpart; -} -if ( $error ) { - $dbh->rollback; - $cgi->param('error', $error ); - print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); - myexit(); -} - -foreach my $part_svc (qsearch('part_svc',{})) { - my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0; - my $primary_svc = - $cgi->param('pkg_svc_primary') == $part_svc->svcpart ? 'Y' : ''; - my $old_pkg_svc = qsearchs('pkg_svc', { - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->svcpart, - } ); - my $old_quantity = $old_pkg_svc ? $old_pkg_svc->quantity : 0; - my $old_primary_svc = - ( $old_pkg_svc && $old_pkg_svc->dbdef_table->column('primary_svc') ) - ? $old_pkg_svc->primary_svc - : ''; - next unless $old_quantity != $quantity || $old_primary_svc ne $primary_svc; - - my $new_pkg_svc = new FS::pkg_svc( { - 'pkgpart' => $pkgpart, - 'svcpart' => $part_svc->svcpart, - 'quantity' => $quantity, - 'primary_svc' => $primary_svc, - } ); - if ( $old_pkg_svc ) { - my $myerror = $new_pkg_svc->replace($old_pkg_svc); - if ( $myerror ) { - $dbh->rollback; - die $myerror; - } - } else { - my $myerror = $new_pkg_svc->insert; - if ( $myerror ) { - $dbh->rollback; - die $myerror; - } - } -} - -unless ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) { - $dbh->commit or die $dbh->errstr; - print $cgi->redirect(popurl(3). "browse/part_pkg.cgi"); -} else { - my($old_cust_pkg) = qsearchs( 'cust_pkg', { 'pkgnum' => $1 } ); - my %hash = $old_cust_pkg->hash; - $hash{'pkgpart'} = $pkgpart; - my($new_cust_pkg) = new FS::cust_pkg \%hash; - my $myerror = $new_cust_pkg->replace($old_cust_pkg); - if ( $myerror ) { - $dbh->rollback; - die "Error modifying cust_pkg record: $myerror\n"; - } - - $dbh->commit or die $dbh->errstr; - print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new_cust_pkg->custnum); -} - -%> diff --git a/httemplate/edit/process/part_referral.cgi b/httemplate/edit/process/part_referral.cgi deleted file mode 100755 index fd2c01506..000000000 --- a/httemplate/edit/process/part_referral.cgi +++ /dev/null @@ -1,28 +0,0 @@ -<% - -my $refnum = $cgi->param('refnum'); - -my $new = new FS::part_referral ( { - map { - $_, scalar($cgi->param($_)); - } fields('part_referral') -} ); - -my $error; -if ( $refnum ) { - my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } ); - die "(Old) Record not found!" unless $old; - $error = $new->replace($old); -} else { - $error = $new->insert; -} -$refnum=$new->refnum; - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "part_referral.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/part_referral.cgi"); -} - -%> diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi deleted file mode 100755 index 9633fabdf..000000000 --- a/httemplate/edit/process/part_svc.cgi +++ /dev/null @@ -1,62 +0,0 @@ -<% - -my $svcpart = $cgi->param('svcpart'); - -my $old = qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart; - -$cgi->param( 'svc_acct__usergroup', - join(',', $cgi->param('svc_acct__usergroup') ) ); - -my $new = new FS::part_svc ( { - map { - $_, scalar($cgi->param($_)); -# } qw(svcpart svc svcdb) - } ( fields('part_svc'), - map { my $svcdb = $_; - my @fields = fields($svcdb); - push @fields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge - map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) } @fields; - } grep defined( $FS::Record::dbdef->table($_) ), - qw( svc_acct svc_domain svc_forward svc_www svc_broadband ) - ) -} ); - -my $error; -if ( $svcpart ) { - $error = $new->replace($old, '1.3-COMPAT', [ 'usergroup' ] ); -} else { - $error = $new->insert( [ 'usergroup' ] ); - $svcpart=$new->getfield('svcpart'); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "part_svc.cgi?". $cgi->query_string ); -} else { - - #false laziness w/ edit/process/agent_type.cgi - foreach my $part_export (qsearch('part_export',{})) { - my $exportnum = $part_export->exportnum; - my $export_svc = qsearchs('export_svc', { - 'exportnum' => $part_export->exportnum, - 'svcpart' => $new->svcpart, - } ); - if ( $export_svc && ! $cgi->param("exportnum". $part_export->exportnum) ) { - $error = $export_svc->delete; - die $error if $error; - } elsif ( $cgi->param("exportnum". $part_export->exportnum) - && ! $export_svc ) { - $export_svc = new FS::export_svc ( { - 'exportnum' => $part_export->exportnum, - 'svcpart' => $new->svcpart, - } ); - $error = $export_svc->insert; - die $error if $error; - } - - } - - print $cgi->redirect(popurl(3)."browse/part_svc.cgi"); -} - -%> diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi deleted file mode 100644 index 477f58508..000000000 --- a/httemplate/edit/process/quick-charge.cgi +++ /dev/null @@ -1,32 +0,0 @@ -<% - -#untaint custnum -$cgi->param('custnum') =~ /^(\d+)$/ - or die 'illegal custnum '. $cgi->param('custnum'); -my $custnum = $1; - -$cgi->param('amount') =~ /^\s*(\d+(\.\d{1,2})?)\s*$/ - or die 'illegal amount '. $cgi->param('amount'); -my $amount = $1; - -my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) - or die "unknown custnum $custnum"; - -my $error = $cust_main->charge( - $amount, - $cgi->param('pkg'), - '$'. sprintf("%.2f",$amount), - $cgi->param('taxclass') -); - -if ($error) { -%> -<!-- mason kludge --> -<% - eidiot($error); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum" ); -} - -%> - diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi deleted file mode 100644 index fd9e59472..000000000 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ /dev/null @@ -1,25 +0,0 @@ -<% - -#untaint custnum -$cgi->param('custnum') =~ /^(\d+)$/ - or die 'illegal custnum '. $cgi->param('custnum'); -my $custnum = $1; -$cgi->param('pkgpart') =~ /^(\d+)$/ - or die 'illegal pkgpart '. $cgi->param('pkgpart'); -my $pkgpart = $1; - -my @cust_pkg = (); -my $error = FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, ); - -if ($error) { -%> -<!-- mason kludge --> -<% - eidiot($error); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum". - "#cust_pkg". $cust_pkg[0]->pkgnum ); -} - -%> - diff --git a/httemplate/edit/process/router.cgi b/httemplate/edit/process/router.cgi deleted file mode 100644 index a2fa46dd9..000000000 --- a/httemplate/edit/process/router.cgi +++ /dev/null @@ -1,67 +0,0 @@ -<% - -local $FS::UID::AutoCommit=0; - -sub check { - my $error = shift; - if($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(3) . "edit/router.cgi?". $cgi->query_string); - dbh->rollback; - exit; - } -} - -my $error = ''; -my $routernum = $cgi->param('routernum'); -my $routername = $cgi->param('routername'); -my $old = qsearchs('router', { routernum => $routernum }); -my @old_psr; - -my $new = new FS::router { - map { - ($_, scalar($cgi->param($_))); - } fields('router') -}; - -if($old) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $routernum = $new->routernum; -} - -check($error); - -if ($old) { - @old_psr = $old->part_svc_router; - foreach my $psr (@old_psr) { - if($cgi->param('svcpart_'.$psr->svcpart) eq 'ON') { - # do nothing - } else { - $error = $psr->delete; - } - } - check($error); -} - -foreach($cgi->param) { - if($cgi->param($_) eq 'ON' and /^svcpart_(\d+)$/) { - my $svcpart = $1; - if(grep {$_->svcpart == $svcpart} @old_psr) { - # do nothing - } else { - my $new_psr = new FS::part_svc_router { svcpart => $svcpart, - routernum => $routernum }; - $error = $new_psr->insert; - } - check($error); - } -} - - -# Yay, everything worked! -dbh->commit or die dbh->errstr; -print $cgi->redirect(popurl(3). "browse/router.cgi"); - -%> diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi deleted file mode 100755 index 950a8602f..000000000 --- a/httemplate/edit/process/svc_acct.cgi +++ /dev/null @@ -1,49 +0,0 @@ -<% - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum = $1; - -my $old; -if ( $svcnum ) { - $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } ) - or die "fatal: can't find account (svcnum $svcnum)!"; -} else { - $old = ''; -} - -#unmunge popnum -$cgi->param('popnum', (split(/:/, $cgi->param('popnum') ))[0] ); - -#unmunge passwd -if ( $cgi->param('_password') eq '*HIDDEN*' ) { - die "fatal: no previous account to recall hidden password from!" unless $old; - $cgi->param('_password',$old->getfield('_password')); -} - -#unmunge usergroup -$cgi->param('usergroup', [ $cgi->param('radius_usergroup') ] ); - -my $new = new FS::svc_acct ( { - map { - $_, scalar($cgi->param($_)); - #} qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir - # shell quota slipip) - } ( fields('svc_acct'), qw( pkgnum svcpart usergroup ) ) -} ); - -my $error; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->svcnum; -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_acct.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_acct.cgi?" . $svcnum ); -} - -%> diff --git a/httemplate/edit/process/svc_acct_pop.cgi b/httemplate/edit/process/svc_acct_pop.cgi deleted file mode 100755 index 46ad74d62..000000000 --- a/httemplate/edit/process/svc_acct_pop.cgi +++ /dev/null @@ -1,28 +0,0 @@ -<% - -my $popnum = $cgi->param('popnum'); - -my $old = qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum; - -my $new = new FS::svc_acct_pop ( { - map { - $_, scalar($cgi->param($_)); - } fields('svc_acct_pop') -} ); - -my $error = ''; -if ( $popnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $popnum=$new->getfield('popnum'); -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_acct_pop.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "browse/svc_acct_pop.cgi"); -} - -%> diff --git a/httemplate/edit/process/svc_broadband.cgi b/httemplate/edit/process/svc_broadband.cgi deleted file mode 100644 index 4912a3a9f..000000000 --- a/httemplate/edit/process/svc_broadband.cgi +++ /dev/null @@ -1,45 +0,0 @@ -<% - -# If it's stupid but it works, it's not stupid. -# -- U.S. Army - -local $FS::UID::AutoCommit = 0; -my $dbh = FS::UID::dbh; - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum = $1; - -my $old; -if ( $svcnum ) { - $old = qsearchs('svc_broadband', { 'svcnum' => $svcnum } ) - or die "fatal: can't find broadband service (svcnum $svcnum)!"; -} else { - $old = ''; -} - -my $new = new FS::svc_broadband ( { - map { - ($_, scalar($cgi->param($_))); - } ( fields('svc_broadband'), qw( pkgnum svcpart ) ) -} ); - -my $error; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->svcnum; -} - - -if ( $error ) { - $cgi->param('error', $error); - $cgi->param('ip_addr', $new->ip_addr); - $dbh->rollback; - print $cgi->redirect(popurl(2). "svc_broadband.cgi?". $cgi->query_string ); -} else { - $dbh->commit or die $dbh->errstr; - print $cgi->redirect(popurl(3). "view/svc_broadband.cgi?" . $svcnum ); -} - -%> diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi deleted file mode 100755 index 19f8eb4f8..000000000 --- a/httemplate/edit/process/svc_domain.cgi +++ /dev/null @@ -1,31 +0,0 @@ -<% - -#remove this to actually test the domains! -$FS::svc_domain::whois_hack = 1; - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum = $1; - -my $new = new FS::svc_domain ( { - map { - $_, scalar($cgi->param($_)); - #} qw(svcnum pkgnum svcpart domain action purpose) - } ( fields('svc_domain'), qw( pkgnum svcpart action purpose ) ) -} ); - -my $error = ''; -if ($cgi->param('svcnum')) { - $error="Can't modify a domain!"; -} else { - $error=$new->insert; - $svcnum=$new->svcnum; -} - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_domain.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum"); -} - -%> diff --git a/httemplate/edit/process/svc_external.cgi b/httemplate/edit/process/svc_external.cgi deleted file mode 100755 index 728cd2189..000000000 --- a/httemplate/edit/process/svc_external.cgi +++ /dev/null @@ -1,29 +0,0 @@ -<% - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum =$1; - -my $old = qsearchs('svc_external',{'svcnum'=>$svcnum}) if $svcnum; - -my $new = new FS::svc_external ( { - map { - ($_, scalar($cgi->param($_))); - } ( fields('svc_external'), qw( pkgnum svcpart ) ) -} ); - -my $error = ''; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->getfield('svcnum'); -} - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_external.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_external.cgi?$svcnum"); -} - -%> diff --git a/httemplate/edit/process/svc_forward.cgi b/httemplate/edit/process/svc_forward.cgi deleted file mode 100755 index bb066d8a6..000000000 --- a/httemplate/edit/process/svc_forward.cgi +++ /dev/null @@ -1,29 +0,0 @@ -<% - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum =$1; - -my $old = qsearchs('svc_forward',{'svcnum'=>$svcnum}) if $svcnum; - -my $new = new FS::svc_forward ( { - map { - ($_, scalar($cgi->param($_))); - } ( fields('svc_forward'), qw( pkgnum svcpart ) ) -} ); - -my $error = ''; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->getfield('svcnum'); -} - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_forward.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_forward.cgi?$svcnum"); -} - -%> diff --git a/httemplate/edit/process/svc_www.cgi b/httemplate/edit/process/svc_www.cgi deleted file mode 100644 index 40913145a..000000000 --- a/httemplate/edit/process/svc_www.cgi +++ /dev/null @@ -1,36 +0,0 @@ -<% - -$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; -my $svcnum = $1; - -my $old; -if ( $svcnum ) { - $old = qsearchs('svc_www', { 'svcnum' => $svcnum } ) - or die "fatal: can't find website (svcnum $svcnum)!"; -} else { - $old = ''; -} - -my $new = new FS::svc_www ( { - map { - ($_, scalar($cgi->param($_))); - #} qw(svcnum pkgnum svcpart recnum usersvc) - } ( fields('svc_www'), qw( pkgnum svcpart ) ) -} ); - -my $error; -if ( $svcnum ) { - $error = $new->replace($old); -} else { - $error = $new->insert; - $svcnum = $new->svcnum; -} - -if ( $error ) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "svc_www.cgi?". $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/svc_www.cgi?" . $svcnum ); -} - -%> |