[freeside-commits] freeside/httemplate/edit/process REAL_cust_pkg.cgi, 1.6, 1.7 access_group.html, 1.2, 1.3 access_user.html, 1.1, 1.2 agent.cgi, 1.4, 1.5 agent_payment_gateway.html, 1.1, 1.2 agent_type.cgi, 1.7, 1.8 bulk-cust_svc.cgi, 1.1, 1.2 cust_bill_pay.cgi, 1.5, 1.6 cust_credit.cgi, 1.9, 1.10 cust_credit_bill.cgi, 1.7, 1.8 cust_main.cgi, 1.21, 1.22 cust_main_county-collapse.cgi, 1.4, 1.5 cust_main_county-expand.cgi, 1.7, 1.8 cust_main_county.cgi, 1.8, 1.9 cust_pay.cgi, 1.10, 1.11 cust_pkg.cgi, 1.5, 1.6 cust_refund.cgi, 1.2, 1.3 cust_svc.cgi, 1.1, 1.2 domain_record.cgi, 1.2, 1.3 generic.cgi, 1.2, 1.3 inventory_class.html, 1.2, 1.3 msgcat.cgi, 1.2, 1.3 part_bill_event.cgi, 1.6, 1.7 part_export.cgi, 1.7, 1.8 part_pkg.cgi, 1.15, 1.16 part_referral.html, 1.1, 1.2 part_svc.cgi, 1.13, 1.14 payment_gateway.html, 1.3, 1.4 pkg_class.html, 1.1, 1.2 prepay_credit.cgi, 1.2, 1.3 quick-charge.cgi, 1.4, 1.5 quick-cust_pkg.cgi, 1.8, 1.9 rate.cgi, 1.7, 1.8 rate_region.cgi, 1.1, 1.2 reg_code.cgi, 1.3, 1.4 router.cgi, 1.4, 1.5 svc_acct.cgi, 1.5, 1.6 svc_acct_pop.cgi, 1.4, 1.5 svc_broadband.cgi, 1.5, 1.6 svc_domain.cgi, 1.4, 1.5 svc_external.cgi, 1.1, 1.2 svc_forward.cgi, 1.4, 1.5 svc_phone.html, 1.1, 1.2 svc_www.cgi, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Wed Aug 23 15:25:39 PDT 2006


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail:/tmp/cvs-serv18630/httemplate/edit/process

Modified Files:
	REAL_cust_pkg.cgi access_group.html access_user.html agent.cgi 
	agent_payment_gateway.html agent_type.cgi bulk-cust_svc.cgi 
	cust_bill_pay.cgi cust_credit.cgi cust_credit_bill.cgi 
	cust_main.cgi cust_main_county-collapse.cgi 
	cust_main_county-expand.cgi cust_main_county.cgi cust_pay.cgi 
	cust_pkg.cgi cust_refund.cgi cust_svc.cgi domain_record.cgi 
	generic.cgi inventory_class.html msgcat.cgi 
	part_bill_event.cgi part_export.cgi part_pkg.cgi 
	part_referral.html part_svc.cgi payment_gateway.html 
	pkg_class.html prepay_credit.cgi quick-charge.cgi 
	quick-cust_pkg.cgi rate.cgi rate_region.cgi reg_code.cgi 
	router.cgi svc_acct.cgi svc_acct_pop.cgi svc_broadband.cgi 
	svc_domain.cgi svc_external.cgi svc_forward.cgi svc_phone.html 
	svc_www.cgi 
Log Message:
Will things ever be the same again?
It's the final masonize


Index: cust_bill_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_bill_pay.cgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cust_bill_pay.cgi	14 May 2006 16:47:30 -0000	1.5
+++ cust_bill_pay.cgi	23 Aug 2006 22:25:37 -0000	1.6
@@ -1,51 +1,54 @@
-<%
-
-$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;
-if ($cgi->param('invnum') =~ /^Refund$/) {
-  $new = new FS::cust_refund ( {
-    'reason'  => 'Refunding payment', #enter reason in UI
-    'refund'  => $cgi->param('amount'),
-    'payby'   => 'BILL',
-    #'_date'   => $cgi->param('_date'),
-    'payinfo' => 'Cash', #enter payinfo in UI
-    'paynum' => $paynum,
-  } );
-} else {
-  $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);
-  %><%= $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string ) %><%
-
-} else {
-
-  #print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
-
-  %><%= header('Payment application sucessful') %>
+%
+%
+%$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;
+%if ($cgi->param('invnum') =~ /^Refund$/) {
+%  $new = new FS::cust_refund ( {
+%    'reason'  => 'Refunding payment', #enter reason in UI
+%    'refund'  => $cgi->param('amount'),
+%    'payby'   => 'BILL',
+%    #'_date'   => $cgi->param('_date'),
+%    'payinfo' => 'Cash', #enter payinfo in UI
+%    'paynum' => $paynum,
+%  } );
+%} else {
+%  $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);
+%  
+<% $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string ) %>
+%
+%
+%} else {
+%
+%  #print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
+%
+%  
+<% header('Payment application sucessful') %>
   <SCRIPT TYPE="text/javascript">
     window.top.location.reload();
   </SCRIPT>
 
   </BODY></HTML>
+% } 
 
-<% } %>

Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_main.cgi,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- cust_main.cgi	6 Aug 2006 20:07:13 -0000	1.21
+++ cust_main.cgi	23 Aug 2006 22:25:37 -0000	1.22
@@ -1,153 +1,154 @@
-<%
-
-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');
-my $payby = $cgi->param('select'); # XXX key
-
-my %noauto = (
-  'CARD' => 'DCRD',
-  'CHEK' => 'DCHK',
-);
-$payby = $noauto{$payby}
-  if ! $cgi->param('payauto') && exists $noauto{$payby};
-
-$cgi->param('payby', $payby);
-
-if ( $payby ) {
-  if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) {
-    $cgi->param('payinfo',
-      $cgi->param('payinfo1'). '@'. $cgi->param('payinfo2') );
-  }
-  $cgi->param('paydate',
-    $cgi->param( 'exp_month' ). '-'. $cgi->param( 'exp_year' ) );
-}
-
-my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') );
-push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST');
-push @invoicing_list, 'FAX' if $cgi->param('invoicing_list_FAX');
-$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
-  );
-}
-
-$new->setfield('paid', $cgi->param('paid') )
-  if $cgi->param('paid');
-
-#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'),
-                                   } );
-
-    #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 );
-
-  my $conf = new FS::Conf;
-  if ( $conf->exists('backend-realtime') && ! $error ) {
-
-    my $berror = $new->bill;
-    $new->apply_payments;
-    $new->apply_credits;
-    $berror ||= $new->collect;
-    warn "Warning, error billing during backend-realtime: $berror" if $berror;
-
-  }
-  
-} 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);
-  
-}
+%
+%
+%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');
+%my $payby = $cgi->param('select'); # XXX key
+%
+%my %noauto = (
+%  'CARD' => 'DCRD',
+%  'CHEK' => 'DCHK',
+%);
+%$payby = $noauto{$payby}
+%  if ! $cgi->param('payauto') && exists $noauto{$payby};
+%
+%$cgi->param('payby', $payby);
+%
+%if ( $payby ) {
+%  if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) {
+%    $cgi->param('payinfo',
+%      $cgi->param('payinfo1'). '@'. $cgi->param('payinfo2') );
+%  }
+%  $cgi->param('paydate',
+%    $cgi->param( 'exp_month' ). '-'. $cgi->param( 'exp_year' ) );
+%}
+%
+%my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') );
+%push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST');
+%push @invoicing_list, 'FAX' if $cgi->param('invoicing_list_FAX');
+%$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
+%  );
+%}
+%
+%$new->setfield('paid', $cgi->param('paid') )
+%  if $cgi->param('paid');
+%
+%#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'),
+%                                   } );
+%
+%    #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 );
+%
+%  my $conf = new FS::Conf;
+%  if ( $conf->exists('backend-realtime') && ! $error ) {
+%
+%    my $berror = $new->bill;
+%    $new->apply_payments;
+%    $new->apply_credits;
+%    $berror ||= $new->collect;
+%    warn "Warning, error billing during backend-realtime: $berror" if $berror;
+%
+%  }
+%  
+%} 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);
+%} 
+%
 
-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);
-} 
-%>

Index: agent.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/agent.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- agent.cgi	10 Feb 2002 13:21:31 -0000	1.4
+++ agent.cgi	23 Aug 2006 22:25:37 -0000	1.5
@@ -1,28 +1,29 @@
-<%
-
-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");
-}
+%
+%
+%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");
+%}
+%
+%
 
-%>

Index: svc_www.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_www.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- svc_www.cgi	23 Jun 2002 05:44:54 -0000	1.2
+++ svc_www.cgi	23 Aug 2006 22:25:37 -0000	1.3
@@ -1,36 +1,37 @@
-<%
-
-$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 );
-}
+%
+%
+%$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 );
+%}
+%
+%
 
-%>

Index: rate.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/rate.cgi,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- rate.cgi	24 Oct 2005 11:56:35 -0000	1.7
+++ rate.cgi	23 Aug 2006 22:25:37 -0000	1.8
@@ -1,3 +1,4 @@
-<%
-  my $server = new FS::UI::Web::JSRPC 'FS::rate::process', $cgi;
-%><%= $server->process %>
+%
+%  my $server = new FS::UI::Web::JSRPC 'FS::rate::process', $cgi;
+%
+<% $server->process %>

Index: cust_credit_bill.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_credit_bill.cgi,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cust_credit_bill.cgi	14 May 2006 16:47:30 -0000	1.7
+++ cust_credit_bill.cgi	23 Aug 2006 22:25:37 -0000	1.8
@@ -1,52 +1,55 @@
-<%
-
-$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 from credit' ),
-    'refund'  => $cgi->param('amount'),
-    'payby'   => 'BILL',
-    #'_date'   => $cgi->param('_date'),
-    #'payinfo' => 'Cash',
-    'payinfo' => 'Refund',
-    '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);
-  %><%= $cgi->redirect(popurl(2). "cust_credit_bill.cgi?". $cgi->query_string ) %><%
-
-} else {
-
-  #print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
-
-  %><%= header('Credit application sucessful') %>
+%
+%
+%$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 from credit' ),
+%    'refund'  => $cgi->param('amount'),
+%    'payby'   => 'BILL',
+%    #'_date'   => $cgi->param('_date'),
+%    #'payinfo' => 'Cash',
+%    'payinfo' => 'Refund',
+%    '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);
+%  
+<% $cgi->redirect(popurl(2). "cust_credit_bill.cgi?". $cgi->query_string ) %>
+%
+%
+%} else {
+%
+%  #print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
+%
+%  
+<% header('Credit application sucessful') %>
   <SCRIPT TYPE="text/javascript">
     window.top.location.reload();
   </SCRIPT>
 
   </BODY></HTML>
+% } 
 
-<% } %>

Index: cust_credit.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_credit.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cust_credit.cgi	14 May 2006 16:47:30 -0000	1.9
+++ cust_credit.cgi	23 Aug 2006 22:25:37 -0000	1.10
@@ -1,35 +1,38 @@
-<%
-
-$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!";
-my $custnum = $1;
-
-my $new = new FS::cust_credit ( {
-  map {
-    $_, scalar($cgi->param($_));
-  } fields('cust_credit')
-} );
-
-my $error = $new->insert;
-
-if ( $error ) {
-  $cgi->param('error', $error);
-
-  %><%= $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");
-
-  %><%= header('Credit sucessful') %>
+%
+%
+%$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!";
+%my $custnum = $1;
+%
+%my $new = new FS::cust_credit ( {
+%  map {
+%    $_, scalar($cgi->param($_));
+%  } fields('cust_credit')
+%} );
+%
+%my $error = $new->insert;
+%
+%if ( $error ) {
+%  $cgi->param('error', $error);
+%
+%  
+<% $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");
+%
+%  
+<% header('Credit sucessful') %>
   <SCRIPT TYPE="text/javascript">
     window.top.location.reload();
   </SCRIPT>
 
   </BODY></HTML>
+% } 
 
-<% } %>

Index: inventory_class.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/inventory_class.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- inventory_class.html	22 Apr 2006 00:58:39 -0000	1.2
+++ inventory_class.html	23 Aug 2006 22:25:37 -0000	1.3
@@ -1,4 +1,4 @@
-<%= include( 'elements/process.html',
+<% include( 'elements/process.html',
                'table'       => 'inventory_class',
                'viewall_dir' => 'browse',
            )

Index: quick-cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/quick-cust_pkg.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- quick-cust_pkg.cgi	22 Mar 2004 11:05:58 -0000	1.8
+++ quick-cust_pkg.cgi	23 Aug 2006 22:25:37 -0000	1.9
@@ -1,25 +1,27 @@
-<%
-
-#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, );
+%
+%
+%#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) {
+%
 
-if ($error) {
-%>
 <!-- mason kludge -->
-<%
-  eidiot($error);
-} else {
-  print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum".
-                       "#cust_pkg". $cust_pkg[0]->pkgnum );
-}
+%
+%  eidiot($error);
+%} else {
+%  print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum".
+%                       "#cust_pkg". $cust_pkg[0]->pkgnum );
+%}
+%
+%
 
-%>
 

Index: part_referral.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/part_referral.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- part_referral.html	10 Aug 2006 11:55:50 -0000	1.1
+++ part_referral.html	23 Aug 2006 22:25:37 -0000	1.2
@@ -1,4 +1,4 @@
-<%= include( 'elements/process.html',
+<% include( 'elements/process.html',
                  'table'       => 'part_referral',
                  'viewall_dir' => 'browse',
            )

Index: svc_phone.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_phone.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- svc_phone.html	12 Jul 2006 00:20:22 -0000	1.1
+++ svc_phone.html	23 Aug 2006 22:25:37 -0000	1.2
@@ -1,4 +1,4 @@
-<%= include( 'elements/svc_Common.html',
+<% include( 'elements/svc_Common.html',
                'table'    => 'svc_phone',
            )
 %>

Index: cust_refund.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_refund.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cust_refund.cgi	14 Sep 2004 13:00:47 -0000	1.2
+++ cust_refund.cgi	23 Aug 2006 22:25:37 -0000	1.3
@@ -1,42 +1,43 @@
-<%
-
-$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!";
-my $custnum = $1;
-my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
-  or die "unknown custnum $custnum";
-
-my $error = '';
-if ( $cgi->param('payby') =~ /^(CARD|CHEK)$/ ) { 
-  my %payby2bop = (
-  'CARD' => 'CC',
-  'CHEK' => 'ECHECK',
-  );
-  my $bop = $payby2bop{$1};
-  $cgi->param('refund') =~ /^(\d*)(\.\d{2})?$/
-    or die "illegal refund amount ". $cgi->param('refund');
-  my $refund = "$1$2";
-  $cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!";
-  my $paynum = $1;
-  my $reason = $cgi->param('reason');
-  $error = $cust_main->realtime_refund_bop( $bop, 'amount' => $refund,
-                                                  'paynum' => $paynum,
-                                                  'reason' => $reason, );
-} else {
-  die 'unimplemented';
-  #my $new = new FS::cust_refund ( {
-  #  map {
-  #    $_, scalar($cgi->param($_));
-  #  } ( fields('cust_refund'), 'paynum' )
-  #} );
-  #$error = $new->insert;
-}
-
-
-if ( $error ) {
-  $cgi->param('error', $error);
-  print $cgi->redirect(popurl(2). "cust_refund.cgi?". $cgi->query_string );
-} else {
-  print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
-}
+%
+%
+%$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!";
+%my $custnum = $1;
+%my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+%  or die "unknown custnum $custnum";
+%
+%my $error = '';
+%if ( $cgi->param('payby') =~ /^(CARD|CHEK)$/ ) { 
+%  my %payby2bop = (
+%  'CARD' => 'CC',
+%  'CHEK' => 'ECHECK',
+%  );
+%  my $bop = $payby2bop{$1};
+%  $cgi->param('refund') =~ /^(\d*)(\.\d{2})?$/
+%    or die "illegal refund amount ". $cgi->param('refund');
+%  my $refund = "$1$2";
+%  $cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!";
+%  my $paynum = $1;
+%  my $reason = $cgi->param('reason');
+%  $error = $cust_main->realtime_refund_bop( $bop, 'amount' => $refund,
+%                                                  'paynum' => $paynum,
+%                                                  'reason' => $reason, );
+%} else {
+%  die 'unimplemented';
+%  #my $new = new FS::cust_refund ( {
+%  #  map {
+%  #    $_, scalar($cgi->param($_));
+%  #  } ( fields('cust_refund'), 'paynum' )
+%  #} );
+%  #$error = $new->insert;
+%}
+%
+%
+%if ( $error ) {
+%  $cgi->param('error', $error);
+%  print $cgi->redirect(popurl(2). "cust_refund.cgi?". $cgi->query_string );
+%} else {
+%  print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
+%}
+%
+%
 
-%>

Index: part_bill_event.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/part_bill_event.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- part_bill_event.cgi	14 May 2004 12:25:45 -0000	1.6
+++ part_bill_event.cgi	23 Aug 2006 22:25:37 -0000	1.7
@@ -1,54 +1,55 @@
-<%
-
-my $eventpart = $cgi->param('eventpart');
-
-my $old = qsearchs('part_bill_event',{'eventpart'=>$eventpart}) if $eventpart;
-
-#s/days/seconds/
-$cgi->param('seconds', int( $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 = join(', ', $cgi->param($field) );
-    $cgi->param($field, $value); #in case it errors out
-    $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");
-}
+%
+%
+%my $eventpart = $cgi->param('eventpart');
+%
+%my $old = qsearchs('part_bill_event',{'eventpart'=>$eventpart}) if $eventpart;
+%
+%#s/days/seconds/
+%$cgi->param('seconds', int( $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 = join(', ', $cgi->param($field) );
+%    $cgi->param($field, $value); #in case it errors out
+%    $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");
+%}
+%
+%
 
-%>
 

Index: rate_region.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/rate_region.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- rate_region.cgi	20 Nov 2004 17:26:54 -0000	1.1
+++ rate_region.cgi	23 Aug 2006 22:25:37 -0000	1.2
@@ -1,51 +1,52 @@
-<%
-
-my $regionnum = $cgi->param('regionnum');
-
-my $old = qsearchs('rate_region', { 'regionnum' => $regionnum } ) if $regionnum;
-
-my $new = new FS::rate_region ( {
-  map {
-    $_, scalar($cgi->param($_));
-  } ( fields('rate_region') )
-} );
-
-my $countrycode = $cgi->param('countrycode');
-my @npa = split(/\s*,\s*/, $cgi->param('npa'));
-$npa[0] = '' unless @npa;
-my @rate_prefix = map {
-                        new FS::rate_prefix {
-                          'countrycode' => $countrycode,
-                          'npa'         => $_,
-                        }
-                      } @npa;
-
-my @dest_detail = map {
-  my $ratenum = $_->ratenum;
-  new FS::rate_detail {
-    'ratenum'  => $ratenum,
-    map { $_ => $cgi->param("$_$ratenum") }
-        qw( min_included min_charge sec_granularity )
-  };
-} qsearch('rate', {} );
-
-
-my $error;
-if ( $regionnum ) {
-  $error = $new->replace($old, 'rate_prefix' => \@rate_prefix,
-                               'dest_detail' => \@dest_detail, );
-} else {
-  $error = $new->insert( 'rate_prefix' => \@rate_prefix,
-                         'dest_detail' => \@dest_detail, );
-  $regionnum = $new->getfield('regionnum');
-}
-
-if ( $error ) {
-  $cgi->param('error', $error);
-  print $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string );
-} else { 
-  #print $cgi->redirect(popurl(3). "browse/rate_region.cgi");
-  print $cgi->redirect(popurl(3). "browse/rate.cgi");
-}
+%
+%
+%my $regionnum = $cgi->param('regionnum');
+%
+%my $old = qsearchs('rate_region', { 'regionnum' => $regionnum } ) if $regionnum;
+%
+%my $new = new FS::rate_region ( {
+%  map {
+%    $_, scalar($cgi->param($_));
+%  } ( fields('rate_region') )
+%} );
+%
+%my $countrycode = $cgi->param('countrycode');
+%my @npa = split(/\s*,\s*/, $cgi->param('npa'));
+%$npa[0] = '' unless @npa;
+%my @rate_prefix = map {
+%                        new FS::rate_prefix {
+%                          'countrycode' => $countrycode,
+%                          'npa'         => $_,
+%                        }
+%                      } @npa;
+%
+%my @dest_detail = map {
+%  my $ratenum = $_->ratenum;
+%  new FS::rate_detail {
+%    'ratenum'  => $ratenum,
+%    map { $_ => $cgi->param("$_$ratenum") }
+%        qw( min_included min_charge sec_granularity )
+%  };
+%} qsearch('rate', {} );
+%
+%
+%my $error;
+%if ( $regionnum ) {
+%  $error = $new->replace($old, 'rate_prefix' => \@rate_prefix,
+%                               'dest_detail' => \@dest_detail, );
+%} else {
+%  $error = $new->insert( 'rate_prefix' => \@rate_prefix,
+%                         'dest_detail' => \@dest_detail, );
+%  $regionnum = $new->getfield('regionnum');
+%}
+%
+%if ( $error ) {
+%  $cgi->param('error', $error);
+%  print $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string );
+%} else { 
+%  #print $cgi->redirect(popurl(3). "browse/rate_region.cgi");
+%  print $cgi->redirect(popurl(3). "browse/rate.cgi");
+%}
+%
+%
 
-%>

Index: svc_domain.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_domain.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- svc_domain.cgi	10 Feb 2002 13:21:31 -0000	1.4
+++ svc_domain.cgi	23 Aug 2006 22:25:37 -0000	1.5
@@ -1,31 +1,32 @@
-<%
-
-#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");
-}
+%
+%
+%#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");
+%}
+%
+%
 
-%>

Index: cust_main_county.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_main_county.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cust_main_county.cgi	28 Feb 2004 22:40:17 -0000	1.8
+++ cust_main_county.cgi	23 Aug 2006 22:25:37 -0000	1.9
@@ -1,30 +1,31 @@
-<%
-
-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");
+%
+%
+%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");
+%
+%
 
-%>

Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/part_pkg.cgi,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- part_pkg.cgi	8 Oct 2005 00:47:20 -0000	1.15
+++ part_pkg.cgi	23 Aug 2006 22:25:37 -0000	1.16
@@ -1,61 +1,62 @@
-<%
-
-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')
-} );
-
-my %pkg_svc = map { $_ => scalar($cgi->param("pkg_svc$_")) }
-              map { $_->svcpart }
-              qsearch('part_svc', {} );
-
-my $error;
-my $custnum = '';
-if ( $cgi->param('taxclass') eq '(select)' ) {
-
-  $error = 'Must select a tax class';
-
-} elsif ( $pkgpart ) {
-
-  $error = $new->replace( $old,
-                          pkg_svc     => \%pkg_svc,
-                          primary_svc => scalar($cgi->param('pkg_svc_primary')),
-                        );
-} else {
-
-  $error = $new->insert(  pkg_svc     => \%pkg_svc,
-                          primary_svc => scalar($cgi->param('pkg_svc_primary')),
-                          cust_pkg    => $cgi->param('pkgnum'),
-                          custnum_ref => \$custnum,
-                       );
-  $pkgpart = $new->pkgpart;
-}
-
-if ( $error ) {
-  $cgi->param('error', $error );
-  print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string );
-} elsif ( $custnum )  {
-  print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
-} else {
-  print $cgi->redirect(popurl(3). "browse/part_pkg.cgi");
-}
+%
+%
+%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')
+%} );
+%
+%my %pkg_svc = map { $_ => scalar($cgi->param("pkg_svc$_")) }
+%              map { $_->svcpart }
+%              qsearch('part_svc', {} );
+%
+%my $error;
+%my $custnum = '';
+%if ( $cgi->param('taxclass') eq '(select)' ) {
+%
+%  $error = 'Must select a tax class';
+%
+%} elsif ( $pkgpart ) {
+%
+%  $error = $new->replace( $old,
+%                          pkg_svc     => \%pkg_svc,
+%                          primary_svc => scalar($cgi->param('pkg_svc_primary')),
+%                        );
+%} else {
+%
+%  $error = $new->insert(  pkg_svc     => \%pkg_svc,
+%                          primary_svc => scalar($cgi->param('pkg_svc_primary')),
+%                          cust_pkg    => $cgi->param('pkgnum'),
+%                          custnum_ref => \$custnum,
+%                       );
+%  $pkgpart = $new->pkgpart;
+%}
+%
+%if ( $error ) {
+%  $cgi->param('error', $error );
+%  print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string );
+%} elsif ( $custnum )  {
+%  print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
+%} else {
+%  print $cgi->redirect(popurl(3). "browse/part_pkg.cgi");
+%}
+%
+%
 
-%>

Index: svc_acct_pop.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_acct_pop.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- svc_acct_pop.cgi	10 Feb 2002 13:21:31 -0000	1.4
+++ svc_acct_pop.cgi	23 Aug 2006 22:25:37 -0000	1.5
@@ -1,28 +1,29 @@
-<%
-
-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");
-}
+%
+%
+%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");
+%}
+%
+%
 
-%>

Index: agent_payment_gateway.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/agent_payment_gateway.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- agent_payment_gateway.html	18 Aug 2005 05:41:24 -0000	1.1
+++ agent_payment_gateway.html	23 Aug 2006 22:25:37 -0000	1.2
@@ -1,25 +1,26 @@
-<%
-
-$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum";
-my $agent = qsearchs('agent', { 'agentnum' => $1 } );
-die "agentnum $1 not found" unless $agent;
-
-#my $old
-
-my @new = map {
-                my $cardtype = $_;
-                new FS::agent_payment_gateway {
-                  ( map { $_ => scalar($cgi->param($_)) }
-                                    fields('agent_payment_gateway')
-                  ),
-                  'cardtype' => $cardtype,
-                };
-              }
-              $cgi->param('cardtype');
-
-foreach my $new (@new) {
-  my $error = $new->insert;
-  die $error if $error;
-}
-
-%><%= $cgi->redirect(popurl(3). "browse/agent.cgi") %>
+%
+%
+%$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum";
+%my $agent = qsearchs('agent', { 'agentnum' => $1 } );
+%die "agentnum $1 not found" unless $agent;
+%
+%#my $old
+%
+%my @new = map {
+%                my $cardtype = $_;
+%                new FS::agent_payment_gateway {
+%                  ( map { $_ => scalar($cgi->param($_)) }
+%                                    fields('agent_payment_gateway')
+%                  ),
+%                  'cardtype' => $cardtype,
+%                };
+%              }
+%              $cgi->param('cardtype');
+%
+%foreach my $new (@new) {
+%  my $error = $new->insert;
+%  die $error if $error;
+%}
+%
+%
+<% $cgi->redirect(popurl(3). "browse/agent.cgi") %>

Index: agent_type.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/agent_type.cgi,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- agent_type.cgi	14 May 2006 16:47:30 -0000	1.7
+++ agent_type.cgi	23 Aug 2006 22:25:37 -0000	1.8
@@ -1,36 +1,37 @@
-<%
-
-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');
-}
-#$error  ||= $new->process_m2m( );
-
-if ( $error ) {
-  $cgi->param('error', $error);
-  print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string );
-} else {
-
-  my $error = $new->process_m2m(
-    'link_table'   => 'type_pkgs',
-    'target_table' => 'part_pkg',
-    'params'       => scalar($cgi->Vars)
-  );
-  die $error if $error;
-
-  print $cgi->redirect(popurl(3). "browse/agent_type.cgi");
-}
+%
+%
+%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');
+%}
+%#$error  ||= $new->process_m2m( );
+%
+%if ( $error ) {
+%  $cgi->param('error', $error);
+%  print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string );
+%} else {
+%
+%  my $error = $new->process_m2m(
+%    'link_table'   => 'type_pkgs',
+%    'target_table' => 'part_pkg',
+%    'params'       => scalar($cgi->Vars)
+%  );
+%  die $error if $error;
+%
+%  print $cgi->redirect(popurl(3). "browse/agent_type.cgi");
+%}
+%
+%
 
-%>

Index: svc_external.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_external.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- svc_external.cgi	23 Dec 2003 02:36:38 -0000	1.1
+++ svc_external.cgi	23 Aug 2006 22:25:37 -0000	1.2
@@ -1,29 +1,30 @@
-<%
-
-$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");
-}
+%
+%
+%$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");
+%}
+%
+%
 
-%>

Index: payment_gateway.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/payment_gateway.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- payment_gateway.html	5 Feb 2006 12:27:20 -0000	1.3
+++ payment_gateway.html	23 Aug 2006 22:25:37 -0000	1.4
@@ -1,33 +1,34 @@
-<%
-
-my $gatewaynum = $cgi->param('gatewaynum');
-
-my $old = qsearchs('payment_gateway',{'gatewaynum'=>$gatewaynum}) if $gatewaynum;
-
-my $new = new FS::payment_gateway ( {
-  map {
-    $_, scalar($cgi->param($_));
-  } fields('payment_gateway')
-} );
-
-my @options = split(/\r?\n/, $cgi->param('gateway_options') );
-pop @options
-  if scalar(@options) % 2 && $options[-1] =~ /^\s*$/;
-my %options = @options;
-
-my $error;
-if ( $gatewaynum ) {
-  $error=$new->replace($old, \%options);
-} else {
-  $error=$new->insert(\%options);
-  $gatewaynum=$new->getfield('gatewaynum');
-}
-
-if ( $error ) {
-  $cgi->param('error', $error);
-  print $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string );
-} else { 
-  print $cgi->redirect(popurl(3). "browse/payment_gateway.html");
-}
+%
+%
+%my $gatewaynum = $cgi->param('gatewaynum');
+%
+%my $old = qsearchs('payment_gateway',{'gatewaynum'=>$gatewaynum}) if $gatewaynum;
+%
+%my $new = new FS::payment_gateway ( {
+%  map {
+%    $_, scalar($cgi->param($_));
+%  } fields('payment_gateway')
+%} );
+%
+%my @options = split(/\r?\n/, $cgi->param('gateway_options') );
+%pop @options
+%  if scalar(@options) % 2 && $options[-1] =~ /^\s*$/;
+%my %options = @options;
+%
+%my $error;
+%if ( $gatewaynum ) {
+%  $error=$new->replace($old, \%options);
+%} else {
+%  $error=$new->insert(\%options);
+%  $gatewaynum=$new->getfield('gatewaynum');
+%}
+%
+%if ( $error ) {
+%  $cgi->param('error', $error);
+%  print $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string );
+%} else { 
+%  print $cgi->redirect(popurl(3). "browse/payment_gateway.html");
+%}
+%
+%
 
-%>

Index: pkg_class.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/pkg_class.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pkg_class.html	22 Apr 2006 00:58:39 -0000	1.1
+++ pkg_class.html	23 Aug 2006 22:25:37 -0000	1.2
@@ -1,4 +1,4 @@
-<%= include( 'elements/process.html',
+<% include( 'elements/process.html',
                'table'       => 'pkg_class',
                'viewall_dir' => 'browse',
            )

Index: cust_svc.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_svc.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cust_svc.cgi	30 Jul 2004 04:54:41 -0000	1.1
+++ cust_svc.cgi	23 Aug 2006 22:25:37 -0000	1.2
@@ -1,30 +1,30 @@
-<%
-
-my $svcnum = $cgi->param('svcnum');
-
-my $old = qsearchs('cust_svc',{'svcnum'=>$svcnum}) if $svcnum;
-
-my $new = new FS::cust_svc ( {
-  map {
-    $_, scalar($cgi->param($_));
-  } fields('cust_svc')
-} );
-
-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). "cust_svc.cgi?". $cgi->query_string );
-  eidiot($error);
-} else { 
-  my $svcdb = $new->part_svc->svcdb;
-  print $cgi->redirect(popurl(3). "view/$svcdb.cgi?$svcnum");
-}
-
-
+%
+%
+%my $svcnum = $cgi->param('svcnum');
+%
+%my $old = qsearchs('cust_svc',{'svcnum'=>$svcnum}) if $svcnum;
+%
+%my $new = new FS::cust_svc ( {
+%  map {
+%    $_, scalar($cgi->param($_));
+%  } fields('cust_svc')
+%} );
+%
+%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). "cust_svc.cgi?". $cgi->query_string );
+%  eidiot($error);
+%} else { 
+%  my $svcdb = $new->part_svc->svcdb;
+%  print $cgi->redirect(popurl(3). "view/$svcdb.cgi?$svcnum");
+%}
+%
+%

Index: domain_record.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/domain_record.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- domain_record.cgi	23 May 2002 13:00:08 -0000	1.2
+++ domain_record.cgi	23 Aug 2006 22:25:37 -0000	1.3
@@ -1,34 +1,36 @@
-<%
-
-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');
-}
+%
+%
+%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
+%
 
-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");
-}
+%
+%  eidiot($error);
+%} else { 
+%  my $svcnum = $new->svcnum;
+%  print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum");
+%}
+%
+%
 
-%>

Index: access_group.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/access_group.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- access_group.html	18 Jun 2006 12:54:48 -0000	1.2
+++ access_group.html	23 Aug 2006 22:25:37 -0000	1.3
@@ -1,4 +1,4 @@
-<%= include( 'elements/process.html',
+<% include( 'elements/process.html',
                'table'       => 'access_group',
                'viewall_dir' => 'browse',
                'process_m2m' => { 'link_table'   => 'access_groupagent',

Index: generic.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/generic.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- generic.cgi	21 Apr 2003 21:29:35 -0000	1.2
+++ generic.cgi	23 Aug 2006 22:25:37 -0000	1.3
@@ -1,70 +1,71 @@
-<%
-
-# 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());
+%
+%
+%# 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);
+%}
+%
 
-if($error) {
-  $cgi->param('error', $error);
-  print $cgi->redirect($redirect_error . '?' . $cgi->query_string);
-} else {
-  print $cgi->redirect($redirect_ok);
-}
-%>

Index: part_svc.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/part_svc.cgi,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- part_svc.cgi	25 Sep 2005 08:13:35 -0000	1.13
+++ part_svc.cgi	23 Aug 2006 22:25:37 -0000	1.14
@@ -1,3 +1,4 @@
-<%
-  my $server = new FS::UI::Web::JSRPC 'FS::part_svc::process', $cgi;
-%><%= $server->process %>
+%
+%  my $server = new FS::UI::Web::JSRPC 'FS::part_svc::process', $cgi;
+%
+<% $server->process %>

Index: quick-charge.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/quick-charge.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- quick-charge.cgi	8 Oct 2005 00:47:20 -0000	1.4
+++ quick-charge.cgi	23 Aug 2006 22:25:37 -0000	1.5
@@ -1,41 +1,43 @@
-<%
-
-#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( $error, $cust_main);
-if ( $cgi->param('taxclass') eq '(select)' ) {
-
-
- $error = 'Must select a tax class';
-} else {
-
-  my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
-    or die "unknown custnum $custnum";
-
-  $error = $cust_main->charge(
-    $amount,
-    $cgi->param('pkg'),
-    '$'. sprintf("%.2f",$amount),
-    $cgi->param('taxclass')
-  );
-
-}
+%
+%
+%#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( $error, $cust_main);
+%if ( $cgi->param('taxclass') eq '(select)' ) {
+%
+%
+% $error = 'Must select a tax class';
+%} else {
+%
+%  my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+%    or die "unknown custnum $custnum";
+%
+%  $error = $cust_main->charge(
+%    $amount,
+%    $cgi->param('pkg'),
+%    '$'. sprintf("%.2f",$amount),
+%    $cgi->param('taxclass')
+%  );
+%
+%}
+%
+%if ($error) {
+%
 
-if ($error) {
-%>
 <!-- mason kludge -->
-<%
-  eidiot($error);
-} else {
-  print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum" );
-}
+%
+%  eidiot($error);
+%} else {
+%  print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum" );
+%}
+%
+%
 
-%>
 

Index: cust_main_county-collapse.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_main_county-collapse.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cust_main_county-collapse.cgi	28 Feb 2004 22:40:41 -0000	1.4
+++ cust_main_county-collapse.cgi	23 Aug 2006 22:25:37 -0000	1.5
@@ -1,35 +1,36 @@
-<%
-
-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");
+%
+%
+%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");
+%
+%
 
-%>

Index: router.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/router.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- router.cgi	22 Oct 2003 19:10:13 -0000	1.4
+++ router.cgi	23 Aug 2006 22:25:37 -0000	1.5
@@ -1,67 +1,68 @@
-<%
-
-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");
+%
+%
+%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");
+%
+%
 
-%>

Index: svc_broadband.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_broadband.cgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- svc_broadband.cgi	12 Feb 2005 03:02:48 -0000	1.5
+++ svc_broadband.cgi	23 Aug 2006 22:25:37 -0000	1.6
@@ -1,36 +1,37 @@
-<%
-
-$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);
-  print $cgi->redirect(popurl(2). "svc_broadband.cgi?". $cgi->query_string );
-} else {
-  print $cgi->redirect(popurl(3). "view/svc_broadband.cgi?" . $svcnum );
-}
+%
+%
+%$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);
+%  print $cgi->redirect(popurl(2). "svc_broadband.cgi?". $cgi->query_string );
+%} else {
+%  print $cgi->redirect(popurl(3). "view/svc_broadband.cgi?" . $svcnum );
+%}
+%
+%
 
-%>

Index: access_user.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/access_user.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- access_user.html	14 May 2006 16:47:30 -0000	1.1
+++ access_user.html	23 Aug 2006 22:25:37 -0000	1.2
@@ -1,4 +1,4 @@
-<%= include( 'elements/process.html',
+<% include( 'elements/process.html',
                'table'       => 'access_user',
                'viewall_dir' => 'browse',
                'process_m2m' => { 'link_table'   => 'access_usergroup',

Index: cust_main_county-expand.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_main_county-expand.cgi,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cust_main_county-expand.cgi	9 May 2002 12:38:40 -0000	1.7
+++ cust_main_county-expand.cgi	23 Aug 2006 22:25:37 -0000	1.8
@@ -1,58 +1,59 @@
-<%
-
-$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!";
-}
-
- at 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");
+%
+%
+%$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");
+%
+%
 
-%>

Index: cust_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_pay.cgi,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cust_pay.cgi	13 Aug 2006 10:25:58 -0000	1.10
+++ cust_pay.cgi	23 Aug 2006 22:25:37 -0000	1.11
@@ -1,54 +1,56 @@
-<%
-
-$cgi->param('linknum') =~ /^(\d+)$/
-  or die "Illegal linknum: ". $cgi->param('linknum');
-my $linknum = $1;
-
-$cgi->param('link') =~ /^(custnum|invnum|popup)$/
-  or die "Illegal link: ". $cgi->param('link');
-my $field = my $link = $1;
-$field = 'custnum' if $field eq 'popup';
-
-my $_date = str2time($cgi->param('_date'));
-
-my $new = new FS::cust_pay ( {
-  $field => $linknum,
-  _date  => $_date,
-  map {
-    $_, scalar($cgi->param($_));
-  } qw(paid 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 ( $field eq 'invnum' ) {
-  print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum");
-} elsif ( $field 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 ( $link eq 'popup' ) {
-
-    %><%= header('Payment entered') %>
+%
+%
+%$cgi->param('linknum') =~ /^(\d+)$/
+%  or die "Illegal linknum: ". $cgi->param('linknum');
+%my $linknum = $1;
+%
+%$cgi->param('link') =~ /^(custnum|invnum|popup)$/
+%  or die "Illegal link: ". $cgi->param('link');
+%my $field = my $link = $1;
+%$field = 'custnum' if $field eq 'popup';
+%
+%my $_date = str2time($cgi->param('_date'));
+%
+%my $new = new FS::cust_pay ( {
+%  $field => $linknum,
+%  _date  => $_date,
+%  map {
+%    $_, scalar($cgi->param($_));
+%  } qw(paid 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 ( $field eq 'invnum' ) {
+%  print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum");
+%} elsif ( $field 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 ( $link eq 'popup' ) {
+%
+%    
+<% header('Payment entered') %>
     <SCRIPT TYPE="text/javascript">
       window.top.location.reload();
     </SCRIPT>
 
     </BODY></HTML>
-    <%
-
-  } elsif ( $link eq 'custnum' ) {
-    print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum");
-  } else {
-    die "unknown link $link";
-  }
-
-}
+%
+%
+%  } elsif ( $link eq 'custnum' ) {
+%    print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum");
+%  } else {
+%    die "unknown link $link";
+%  }
+%
+%}
+%
+%
 
-%>

Index: svc_forward.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_forward.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- svc_forward.cgi	10 Feb 2002 13:21:31 -0000	1.4
+++ svc_forward.cgi	23 Aug 2006 22:25:37 -0000	1.5
@@ -1,29 +1,30 @@
-<%
-
-$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");
-}
+%
+%
+%$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");
+%}
+%
+%
 
-%>

Index: REAL_cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/REAL_cust_pkg.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- REAL_cust_pkg.cgi	22 Dec 2004 14:06:45 -0000	1.6
+++ REAL_cust_pkg.cgi	23 Aug 2006 22:25:37 -0000	1.7
@@ -1,34 +1,35 @@
-<%
-
-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;
-my $error;
-if ( $hash{'bill'} != $old->bill        # if the next bill date was changed
-     && $hash{'bill'} < time            # to a date in the past
-     && ! $cgi->param('bill_areyousure') # and it wasn't confirmed
-   )
-{
-  $error = '_bill_areyousure';
-} else {
-  $new = new FS::cust_pkg \%hash;
-  $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" );
-}
+%
+%
+%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;
+%my $error;
+%if ( $hash{'bill'} != $old->bill        # if the next bill date was changed
+%     && $hash{'bill'} < time            # to a date in the past
+%     && ! $cgi->param('bill_areyousure') # and it wasn't confirmed
+%   )
+%{
+%  $error = '_bill_areyousure';
+%} else {
+%  $new = new FS::cust_pkg \%hash;
+%  $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" );
+%}
+%
+%
 
-%>

Index: msgcat.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/msgcat.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- msgcat.cgi	10 Apr 2002 13:42:49 -0000	1.2
+++ msgcat.cgi	23 Aug 2006 22:25:37 -0000	1.3
@@ -1,20 +1,21 @@
-<%
-
-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");
-}
+%
+%
+%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");
+%}
+%
+%
 
-%>

Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_acct.cgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- svc_acct.cgi	23 Mar 2002 16:16:00 -0000	1.5
+++ svc_acct.cgi	23 Aug 2006 22:25:37 -0000	1.6
@@ -1,49 +1,50 @@
-<%
-
-$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 );
-}
+%
+%
+%$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 );
+%}
+%
+%
 
-%>

Index: part_export.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/part_export.cgi,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- part_export.cgi	20 Jun 2002 01:29:21 -0000	1.7
+++ part_export.cgi	23 Aug 2006 22:25:37 -0000	1.8
@@ -1,39 +1,40 @@
-<%
-
-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");
-}
+%
+%
+%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");
+%}
+%
+%
 
-%>

Index: cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_pkg.cgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cust_pkg.cgi	4 Oct 2002 12:57:06 -0000	1.5
+++ cust_pkg.cgi	23 Aug 2006 22:25:37 -0000	1.6
@@ -1,43 +1,44 @@
-<%
-
-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");
-}
+%
+%
+%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");
+%}
+%
+%
 
-%>

Index: prepay_credit.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/prepay_credit.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- prepay_credit.cgi	31 Jan 2006 04:26:54 -0000	1.2
+++ prepay_credit.cgi	23 Aug 2006 22:25:37 -0000	1.3
@@ -1,51 +1,57 @@
+%
+%my $hashref = {};
+%
+%my $agent = '';
+%if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
+%  $agent = qsearchs('agent', { 'agentnum' => $hashref->{agentnum}=$1 } );
+%}
+%
+%my $error = '';
+%
+%my $num = 0;
+%if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) {
+%  $num = $1;
+%} else {
+%  $error = 'Illegal number of prepaid cards: '. $cgi->param('num');
+%}
+%
+%$hashref->{amount} = $cgi->param('amount');
+%$hashref->{seconds} = $cgi->param('seconds') * $cgi->param('multiplier');
+%
+%$error ||= FS::prepay_credit::generate( $num,
+%                                        scalar($cgi->param('type')), 
+%                                        $hashref
+%                                      );
+%
+%unless ( ref($error) ) {
+%  $cgi->param('error', $error );
+%
 <%
-my $hashref = {};
-
-my $agent = '';
-if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
-  $agent = qsearchs('agent', { 'agentnum' => $hashref->{agentnum}=$1 } );
-}
-
-my $error = '';
-
-my $num = 0;
-if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) {
-  $num = $1;
-} else {
-  $error = 'Illegal number of prepaid cards: '. $cgi->param('num');
-}
-
-$hashref->{amount} = $cgi->param('amount');
-$hashref->{seconds} = $cgi->param('seconds') * $cgi->param('multiplier');
-
-$error ||= FS::prepay_credit::generate( $num,
-                                        scalar($cgi->param('type')), 
-                                        $hashref
-                                      );
-
-unless ( ref($error) ) {
-  $cgi->param('error', $error );
-%><%=
   $cgi->redirect(popurl(3). "edit/prepay_credit.cgi?". $cgi->query_string )
-%><% } else { %>
+%>
+% } else { 
 
-<%= include("/elements/header.html", "$num prepaid cards generated".
+
+<% include("/elements/header.html", "$num prepaid cards generated".
               ( $agent ? ' for '.$agent->agent : '' ),
             menubar( 'Main menu' => popurl(3) )
           )
 %>
 
 <FONT SIZE="+1">
-<% foreach my $card ( @$error ) { %>
-  <code><%= $card %></code>
+% foreach my $card ( @$error ) { 
+
+  <code><% $card %></code>
   -
-  <%= $hashref->{amount} ? sprintf('$%.2f', $hashref->{amount} ) : '' %>
-  <%= $hashref->{amount} && $hashref->{seconds} ? 'and' : '' %>
-  <%= $hashref->{seconds} ? duration_exact($hashref->{seconds}) : '' %>
+  <% $hashref->{amount} ? sprintf('$%.2f', $hashref->{amount} ) : '' %>
+  <% $hashref->{amount} && $hashref->{seconds} ? 'and' : '' %>
+  <% $hashref->{seconds} ? duration_exact($hashref->{seconds}) : '' %>
   <br>
-<% } %>
+% } 
+
 
 </FONT>
 
 </BODY></HTML>
-<% } %>
+% } 
+

Index: bulk-cust_svc.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/bulk-cust_svc.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- bulk-cust_svc.cgi	16 Nov 2005 13:14:47 -0000	1.1
+++ bulk-cust_svc.cgi	23 Aug 2006 22:25:37 -0000	1.2
@@ -1,3 +1,4 @@
-<%
-  my $server = new FS::UI::Web::JSRPC 'FS::part_svc::process_bulk_cust_svc', $cgi;
-%><%= $server->process %>
+%
+%  my $server = new FS::UI::Web::JSRPC 'FS::part_svc::process_bulk_cust_svc', $cgi;
+%
+<% $server->process %>

Index: reg_code.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/reg_code.cgi,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- reg_code.cgi	31 Jan 2006 04:26:54 -0000	1.3
+++ reg_code.cgi	23 Aug 2006 22:25:37 -0000	1.4
@@ -1,44 +1,50 @@
+%
+%
+%$cgi->param('agentnum') =~ /^(\d+)$/
+%  or eidiot 'illegal agentnum '. $cgi->param('agentnum');
+%my $agentnum = $1;
+%my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
+%
+%my $error = '';
+%
+%my $num = 0;
+%if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) {
+%  $num = $1;
+%} else {
+%  $error = 'Illegal number of codes: '. $cgi->param('num');
+%}
+%
+%my @pkgparts = 
+%  map  { /^pkgpart(.*)$/; $1 }
+%  grep { $cgi->param($_) }
+%  grep { /^pkgpart/ }
+%  $cgi->param;
+%
+%$error ||= $agent->generate_reg_codes($num, \@pkgparts);
+%
+%unless ( ref($error) ) {
+%  $cgi->param('error'. $error );
+%
 <%
-
-$cgi->param('agentnum') =~ /^(\d+)$/
-  or eidiot 'illegal agentnum '. $cgi->param('agentnum');
-my $agentnum = $1;
-my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
-
-my $error = '';
-
-my $num = 0;
-if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) {
-  $num = $1;
-} else {
-  $error = 'Illegal number of codes: '. $cgi->param('num');
-}
-
-my @pkgparts = 
-  map  { /^pkgpart(.*)$/; $1 }
-  grep { $cgi->param($_) }
-  grep { /^pkgpart/ }
-  $cgi->param;
-
-$error ||= $agent->generate_reg_codes($num, \@pkgparts);
-
-unless ( ref($error) ) {
-  $cgi->param('error'. $error );
-%><%=
   $cgi->redirect(popurl(3). "edit/reg_code.cgi?". $cgi->query_string )
-%><% } else { %>
+%>
+% } else { 
 
-<%= include("/elements/header.html","$num registration codes generated for ". $agent->agent, menubar(
+
+<% include("/elements/header.html","$num registration codes generated for ". $agent->agent, menubar(
   'Main menu'       => popurl(3),
   'View all agents' => popurl(3). 'browse/agent.cgi',
 ) ) %>
 
 <PRE><FONT SIZE="+1">
-<% foreach my $code ( @$error ) { %>
-  <%= $code %>
-<% } %>
+% foreach my $code ( @$error ) { 
+
+  <% $code %>
+% } 
+
 
 </FONT></PRE>
 
 </BODY></HTML>
-<% } %>
+% } 
+



More information about the freeside-commits mailing list