projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
oops, last bit for reg codes
[freeside.git]
/
httemplate
/
edit
/
part_export.cgi
diff --git
a/httemplate/edit/part_export.cgi
b/httemplate/edit/part_export.cgi
index
486bd43
..
b3d42bd
100644
(file)
--- a/
httemplate/edit/part_export.cgi
+++ b/
httemplate/edit/part_export.cgi
@@
-46,27
+46,38
@@
my $widget = new HTML::Widgets::SelectLayers(
foreach my $option ( keys %{$exports->{$layer}{options}} ) {
my $optinfo = $exports->{$layer}{options}{$option};
foreach my $option ( keys %{$exports->{$layer}{options}} ) {
my $optinfo = $exports->{$layer}{options}{$option};
+ die "Retreived non-ref export info option from $layer export: $optinfo"
+ unless ref($optinfo);
my $label = $optinfo->{label};
my $type = defined($optinfo->{type}) ? $optinfo->{type} : 'text';
my $value = $cgi->param($option)
my $label = $optinfo->{label};
my $type = defined($optinfo->{type}) ? $optinfo->{type} : 'text';
my $value = $cgi->param($option)
- || $part_export->option($option)
- || (exists $optinfo->{default} ? $optinfo->{default} : '');
+ || ( $part_export->exportnum && $part_export->option($option) )
+ || ( (exists $optinfo->{default} && !$part_export->exportnum)
+ ? $optinfo->{default}
+ : ''
+ );
$html .= qq!<TR><TD ALIGN="right">$label</TD><TD>!;
if ( $type eq 'select' ) {
$html .= qq!<SELECT NAME="$option">!;
foreach my $select_option ( @{$optinfo->{options}} ) {
#if ( ref($select_option) ) {
#} else {
$html .= qq!<TR><TD ALIGN="right">$label</TD><TD>!;
if ( $type eq 'select' ) {
$html .= qq!<SELECT NAME="$option">!;
foreach my $select_option ( @{$optinfo->{options}} ) {
#if ( ref($select_option) ) {
#} else {
- $selected = $select_option eq $value ? ' SELECTED' : '';
+
my
$selected = $select_option eq $value ? ' SELECTED' : '';
$html .= qq!<OPTION VALUE="$select_option"$selected>!.
qq!$select_option</OPTION>!;
#}
}
$html .= '</SELECT>';
} elsif ( $type eq 'textarea' ) {
$html .= qq!<OPTION VALUE="$select_option"$selected>!.
qq!$select_option</OPTION>!;
#}
}
$html .= '</SELECT>';
} elsif ( $type eq 'textarea' ) {
- $html .= qq!<TEXTAREA NAME="$option">$value</TEXTAREA>!;
+ $html .= qq!<TEXTAREA NAME="$option" COLS=80 ROWS=8 WRAP="virtual">!.
+ encode_entities($value). '</TEXTAREA>';
} elsif ( $type eq 'text' ) {
} elsif ( $type eq 'text' ) {
- $html .= qq!<INPUT TYPE="text" NAME="$option" VALUE="$value" SIZE=64>!;
+ $html .= qq!<INPUT TYPE="text" NAME="$option" VALUE="!.
+ encode_entities($value). '" SIZE=64>';
+ } elsif ( $type eq 'checkbox' ) {
+ $html .= qq!<INPUT TYPE="checkbox" NAME="$option" VALUE="1"!;
+ $html .= ' CHECKED' if $value;
+ $html .= '>';
} else {
$html .= "unknown type $type";
}
} else {
$html .= "unknown type $type";
}