[freeside-commits] freeside/httemplate/edit part_pkg.cgi, 1.68, 1.69 part_svc.cgi, 1.57, 1.58 svc_acct.cgi, 1.46, 1.47
Jeff Finucane,420,,
jeff at wavetail.420.am
Wed Apr 11 20:16:45 PDT 2007
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail:/tmp/cvs-serv7777/httemplate/edit
Modified Files:
part_pkg.cgi part_svc.cgi svc_acct.cgi
Log Message:
input and output on data volume fields specified with k,m,g,or t
Index: part_svc.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_svc.cgi,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- part_svc.cgi 10 Feb 2007 06:13:15 -0000 1.57
+++ part_svc.cgi 12 Apr 2007 03:16:43 -0000 1.58
@@ -166,12 +166,13 @@
%
% foreach my $field (@fields) {
%
-% my $part_svc_column = $part_svc->part_svc_column($field);
-% my $value = $part_svc_column->columnvalue;
-% my $flag = $part_svc_column->columnflag;
% #my $def = $defs{$layer}{$field};
% my $def = FS::part_svc->svc_table_fields($layer)->{$field};
% my $label = $def->{'def_label'} || $def->{'label'};
+% my $formatter = $def->{'format'} || sub { shift };
+% my $part_svc_column = $part_svc->part_svc_column($field);
+% my $value = &$formatter($part_svc_column->columnvalue);
+% my $flag = $part_svc_column->columnflag;
%
% if ( $bgcolor eq $bgcolor1 ) {
% $bgcolor = $bgcolor2;
Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_acct.cgi,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- svc_acct.cgi 8 Apr 2007 00:41:51 -0000 1.46
+++ svc_acct.cgi 12 Apr 2007 03:16:43 -0000 1.47
@@ -386,27 +386,27 @@
</TR>
% }
%
-% if ( $curuser->access_right('Edit usage') ) {
-% my %label = ( seconds => 'Seconds',
-% upbytes => 'Upload bytes',
-% downbytes => 'Download bytes',
-% totalbytes => 'Total bytes',
-% );
-% foreach my $uf (keys %label) {
-% my $tf = $uf . "_threshold";
-% if ( $svc_acct->$tf ne '' ) {
-
+% my %label = ( seconds => 'Time',
+% upbytes => 'Upload bytes',
+% downbytes => 'Download bytes',
+% totalbytes => 'Total bytes',
+% );
+% foreach my $uf (keys %label) {
+% my $tf = $uf . "_threshold";
+% if ( $curuser->access_right('Edit usage') ) {
<TR>
<TD ALIGN="right"><% $label{$uf} %> remaining</TD>
- <TD><INPUT TYPE="text" NAME="<% $uf %>" VALUE="<% $svc_acct->$uf %>"></TD>
+ <TD><INPUT TYPE="text" NAME="<% $uf %>" VALUE="<% $svc_acct->$uf %>">(blank disables)</TD>
</TR>
<TR>
<TD ALIGN="right"><% $label{$uf} %> threshold</TD>
- <TD><INPUT TYPE="text" NAME="<% $tf %>" VALUE="<% $svc_acct->$tf %>">(blank or zero disables <% lc($label{$uf}) %> remaining)</TD>
+ <TD><INPUT TYPE="text" NAME="<% $tf %>" VALUE="<% $svc_acct->$tf %>">(blank disables)</TD>
</TR>
-% }
+% }else{
+ <INPUT TYPE="hidden" NAME="<% $uf %>" VALUE="<% $svc_acct->$uf %>">
+ <INPUT TYPE="hidden" NAME="<% $tf %>" VALUE="<% $svc_acct->$tf %>">
% }
-% }
+% }
%
%foreach my $r ( grep { /^r(adius|[cr])_/ } fields('svc_acct') ) {
% $r =~ /^^r(adius|[cr])_(.+)$/ or next; #?
Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_pkg.cgi,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- part_pkg.cgi 26 Feb 2007 17:54:18 -0000 1.68
+++ part_pkg.cgi 12 Apr 2007 03:16:43 -0000 1.69
@@ -323,10 +323,12 @@
%
% $html .= '<TR><TD ALIGN="right">'. $href->{$field}{'name'}. '</TD><TD>';
%
+% my $format = sub { shift };
+% $format = $href->{$field}{'format'} if exists($href->{$field}{'format'});
% if ( ! exists($href->{$field}{'type'}) ) {
% $html .= qq!<INPUT TYPE="text" NAME="$field" VALUE="!.
% ( exists($plandata{$field})
-% ? $plandata{$field}
+% ? &$format($plandata{$field})
% : $href->{$field}{'default'} ).
% qq!">!;
% } elsif ( $href->{$field}{'type'} eq 'checkbox' ) {
More information about the freeside-commits
mailing list