diff options
author | ivan <ivan> | 2008-03-15 22:19:02 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-03-15 22:19:02 +0000 |
commit | 5e5e516a6c108142b078917b5558ca5cc7648f96 (patch) | |
tree | 053c8efd8c641ebb6e42b2b527e12346441a0b70 /httemplate/edit | |
parent | 25db05cd149b6e86523848db4f060a1df5a7d56b (diff) |
slightly better voip_cdr package edit: use radio buttons for selecting long things
Diffstat (limited to 'httemplate/edit')
-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 49f691bfd..8ec594b94 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -283,19 +283,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'; @@ -316,13 +322,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 { @@ -331,6 +337,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>'; |