X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_forward.cgi;h=75cd9fc7fc12e73e47a9828eddcac22e1ad50db7;hb=abb18df8aeb27dc49817045e217c61ba6c990ad6;hp=de4c8cbc93fd9edf32d7ed9e760be0a03f47be0c;hpb=06d6c58f29564e0cbf92c6df01c7c0409a5c3097;p=freeside.git diff --git a/httemplate/edit/svc_forward.cgi b/httemplate/edit/svc_forward.cgi index de4c8cbc9..75cd9fc7f 100755 --- a/httemplate/edit/svc_forward.cgi +++ b/httemplate/edit/svc_forward.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $conf $cgi $mydomain $action $svcnum $svc_forward $pkgnum $svcpart @@ -57,13 +57,15 @@ if ( $cgi->param('error') ) { $svcnum=''; #set fixed and default fields from part_svc - my($field); - foreach $field ( fields('svc_forward') ) { - if ( $part_svc->getfield('svc_forward__'. $field. '_flag') ne '' ) { - $svc_forward->setfield($field,$part_svc->getfield('svc_forward__'. $field) ); - } + foreach my $part_svc_column ( + grep { $_->columnflag } $part_svc->all_part_svc_column + ) { + $svc_forward->setfield( $part_svc_column->columnname, + $part_svc_column->columnvalue, + ); } + } } $action = $svc_forward->svcnum ? 'Edit' : 'Add'; @@ -97,10 +99,13 @@ if ($pkgnum) { foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding #record(s) in cust_svc ( for this #pkgnum ! ) - my($i_cust_svc); - foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) { - $svc_acct=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')}); - $email{$svc_acct->getfield('svcnum')}=$svc_acct->email; + 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; } } } @@ -126,7 +131,7 @@ if ($pkgnum) { #display $p1 = popurl(1); -print $cgi->header( '-expires' => 'now' ), header("Mail Forward $action", '', +print header("Mail Forward $action", '', " onLoad=\"visualize()\""); %>