diff options
author | ivan <ivan> | 2008-03-15 22:18:59 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-03-15 22:18:59 +0000 |
commit | 9464e3517fcae6a735c14b3fb15b91f3886a884a (patch) | |
tree | d6c80dc740553a75dd8564e8381cb2bc1564523d /httemplate | |
parent | bc561a1b7853d292a0c8b83ef16b5f7b8b8389d3 (diff) |
slightly better voip_cdr package edit: use radio buttons for selecting long things
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/edit/part_pkg.cgi | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index ec001cb0c..b1851a7ba 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -286,19 +286,25 @@ Line-item revenue recognition % % 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}) % ? &$format($plandata{$field}) % : $href->{$field}{'default'} ). % qq!" onChange="fchanged(this)">!; +% % } elsif ( $href->{$field}{'type'} eq 'checkbox' ) { +% % $html .= qq!<INPUT TYPE="checkbox" NAME="$field" VALUE=1 !. % ( exists($plandata{$field}) && $plandata{$field} % ? ' CHECKED' % : '' % ). '>'; +% % } elsif ( $href->{$field}{'type'} =~ /^select/ ) { +% % $html .= '<SELECT'; % $html .= ' MULTIPLE' % if $href->{$field}{'type'} eq 'select_multiple'; @@ -319,13 +325,13 @@ Line-item revenue recognition % } % } elsif ( $href->{$field}{'select_options'} ) { % foreach my $key ( keys %{ $href->{$field}{'select_options'} } ) { -% my $value = $href->{$field}{'select_options'}{$key}; +% my $label = $href->{$field}{'select_options'}{$key}; % $html .= qq!<OPTION VALUE="$key"!. -% ( $plandata{$field} =~ /(^|, *)$value *(,|$)/ +% ( $plandata{$field} =~ /(^|, *)$key *(,|$)/ #XXX fix % ? ' SELECTED' % : '' % ). -% '>'. $value; +% '>'. $label; % } % % } else { @@ -334,6 +340,22 @@ Line-item revenue recognition % '</font>'; % } % $html .= '</SELECT>'; +% +% } elsif ( $href->{$field}{'type'} eq 'radio' ) { +% +% my $radio = +% qq!<INPUT TYPE="radio" NAME="$field" onChange="fchanged(this)"!; +% +% foreach my $key ( keys %{ $href->{$field}{'options'} } ) { +% my $label = $href->{$field}{'options'}{$key}; +% $html .= qq!$radio VALUE="$key"!. +% ( $plandata{$field} =~ /(^|, *)$key *(,|$)/ #XXX fix +% ? ' CHECKED' +% : '' +% ). +% "> $label<BR>"; +% } +% % } % % $html .= '</TD></TR>'; |