X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_forward.cgi;h=73f6465b931977d7587ca516cb17dd687d48609a;hb=860ba14587816649210dd43a5728cf4b007bfa54;hp=73b32dc7b63c7addb037fef6227fd08ab42debf0;hpb=3ce7691203a7737406bf2d4442f7fd84b81f847e;p=freeside.git
diff --git a/httemplate/edit/svc_forward.cgi b/httemplate/edit/svc_forward.cgi
index 73b32dc7b..73f6465b9 100755
--- a/httemplate/edit/svc_forward.cgi
+++ b/httemplate/edit/svc_forward.cgi
@@ -1,116 +1,6 @@
-
-%
-%
-%my $conf = new FS::Conf;
-%
-%my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_forward);
-%if ( $cgi->param('error') ) {
-% $svc_forward = new FS::svc_forward ( {
-% map { $_, scalar($cgi->param($_)) } fields('svc_forward')
-% } );
-% $svcnum = $svc_forward->svcnum;
-% $pkgnum = $cgi->param('pkgnum');
-% $svcpart = $cgi->param('svcpart');
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%} else {
-%
-% my($query) = $cgi->keywords;
-%
-% if ( $query =~ /^(\d+)$/ ) { #editing
-% $svcnum=$1;
-% $svc_forward=qsearchs('svc_forward',{'svcnum'=>$svcnum})
-% or die "Unknown (svc_forward) svcnum!";
-%
-% my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
-% or die "Unknown (cust_svc) svcnum!";
-%
-% $pkgnum=$cust_svc->pkgnum;
-% $svcpart=$cust_svc->svcpart;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-% } else { #adding
-%
-% $svc_forward = new FS::svc_forward({});
-%
-% foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
-% $pkgnum=$1 if /^pkgnum(\d+)$/;
-% $svcpart=$1 if /^svcpart(\d+)$/;
-% }
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-% $svcnum='';
-%
-% $svc_forward->set_default_and_fixed;
-% }
-%
-%}
-%my $action = $svc_forward->svcnum ? 'Edit' : 'Add';
-%
-%my %email;
-%
-%#starting with those currently attached
-%foreach my $method (qw( srcsvc_acct dstsvc_acct )) {
-% my $svc_acct = $svc_forward->$method();
-% $email{$svc_acct->svcnum} = $svc_acct->email if $svc_acct;
-%}
-%
-%if ($pkgnum) {
-%
-% #find all possible user svcnums (and emails)
-%
-% #and including the rest for this customer
-% my($u_part_svc,@u_acct_svcparts);
-% foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) {
-% push @u_acct_svcparts,$u_part_svc->getfield('svcpart');
-% }
-%
-% my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-% my($custnum)=$cust_pkg->getfield('custnum');
-% my($i_cust_pkg);
-% foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
-% my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
-% my($acct_svcpart);
-% foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding
-% #record(s) in cust_svc ( for this
-% #pkgnum ! )
-% foreach my $i_cust_svc (
-% qsearch( 'cust_svc', { 'pkgnum' => $cust_pkgnum,
-% 'svcpart' => $acct_svcpart } )
-% ) {
-% my $svc_acct =
-% qsearchs( 'svc_acct', { 'svcnum' => $i_cust_svc->svcnum } );
-% $email{$svc_acct->svcnum} = $svc_acct->email;
-% }
-% }
-% }
-%
-%} elsif ( $action eq 'Add' ) {
-% die "\$action eq Add, but \$pkgnum is null!\n";
-%}
-%
-%my($srcsvc,$dstsvc,$dst)=(
-% $svc_forward->srcsvc,
-% $svc_forward->dstsvc,
-% $svc_forward->dst,
-%);
-%my $src = $svc_forward->dbdef_table->column('src') ? $svc_forward->src : '';
-%
-%#display
-%
-%
-
-
-<% include("/elements/header.html","Mail Forward $action") %>
-% if ( $cgi->param('error') ) {
-
- Error: <% $cgi->param('error') %>
-
-% }
+<% include('/elements/header.html', "Mail Forward $action") %>
+<% include('/elements/error.html') %>
Service #<% $svcnum ? "$svcnum" : " (NEW)" %>
Service: <% $part_svc->svc %>
@@ -142,24 +32,35 @@ function dstchanged(what) {
<% ntable("#cccccc",2) %>
-