summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
authorjeff <jeff>2007-04-12 03:16:43 +0000
committerjeff <jeff>2007-04-12 03:16:43 +0000
commit0dd05e9ff98263d2d42b419b1e278a5a3bc594b2 (patch)
treeef42a5ed621c73699e3973fd14ef22abdd3a5823 /httemplate/edit/process
parentb611f02e479f4a7f9840f59f773d282b1c13b62f (diff)
input and output on data volume fields specified with k,m,g,or t
Diffstat (limited to 'httemplate/edit/process')
-rwxr-xr-xhttemplate/edit/process/part_pkg.cgi8
-rwxr-xr-xhttemplate/edit/process/svc_acct.cgi5
2 files changed, 12 insertions, 1 deletions
diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi
index 1158222b6..5fc59c14d 100755
--- a/httemplate/edit/process/part_pkg.cgi
+++ b/httemplate/edit/process/part_pkg.cgi
@@ -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 )) {
diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi
index 30552c846..65ac5c176 100755
--- a/httemplate/edit/process/svc_acct.cgi
+++ b/httemplate/edit/process/svc_acct.cgi
@@ -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($_));