[freeside-commits] freeside/httemplate/edit/process part_pkg.cgi, 1.18, 1.18.2.1 svc_acct.cgi, 1.7, 1.7.2.1

Jeff Finucane,420,, jeff at wavetail.420.am
Wed Apr 11 20:18:27 PDT 2007


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

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	part_pkg.cgi svc_acct.cgi 
Log Message:
input and output on data volume fields specified with k,m,g,or t (backport)

Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_acct.cgi,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -d -r1.7 -r1.7.2.1
--- svc_acct.cgi	5 Dec 2006 02:37:14 -0000	1.7
+++ svc_acct.cgi	12 Apr 2007 03:18:25 -0000	1.7.2.1
@@ -23,6 +23,11 @@
 %#unmunge usergroup
 %$cgi->param('usergroup', [ $cgi->param('radius_usergroup') ] );
 %
+%#unmunge bytecounts
+%foreach (map { $_,$_."_threshold" } qw( upbytes downbytes totalbytes )) {
+%  $cgi->param($_, FS::UI::Web::parse_bytecount($cgi->param($_)) );
+%}
+%
 %my %hash = $svcnum ? $old->hash : ();
 %map {
 %    $hash{$_} = scalar($cgi->param($_));

Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/part_pkg.cgi,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -u -d -r1.18 -r1.18.2.1
--- part_pkg.cgi	8 Feb 2007 09:13:21 -0000	1.18
+++ part_pkg.cgi	12 Apr 2007 03:18:25 -0000	1.18.2.1
@@ -6,11 +6,17 @@
 %
 %my $old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart;
 %
+%tie my %plans, 'Tie::IxHash', %{ FS::part_pkg::plan_info() };
+%my $href = $plans{$cgi->param('plan')}->{'fields'};
+%
 %#fixup plandata
 %my $plandata = $cgi->param('plandata');
 %my @plandata = split(',', $plandata);
 %$cgi->param('plandata', 
-%  join('', map { "$_=". join(', ', $cgi->param($_)). "\n" } @plandata )
+%  join('', map { my $parser = sub { shift };
+%                 $parser = $href->{$_}{parse} if exists($href->{$_}{parse});
+%                 "$_=". join(', ', &$parser($cgi->param($_))). "\n"
+%               } @plandata )
 %);
 %
 %foreach (qw( setuptax recurtax disabled )) {



More information about the freeside-commits mailing list