fix disappearing email invoice on errors, finally (closes: Bug#35)
[freeside.git] / httemplate / edit / part_export.cgi
index fbc698e..839a114 100644 (file)
@@ -49,8 +49,11 @@ my $widget = new HTML::Widgets::SelectLayers(
       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">!;
@@ -63,8 +66,13 @@ my $widget = new HTML::Widgets::SelectLayers(
           #}
         }
         $html .= '</SELECT>';
+      } elsif ( $type eq 'textarea' ) {
+        $html .= qq!<TEXTAREA NAME="$option" COLS=80 WRAP="virtual">!.
+                 qq!$value</TEXTAREA>!;
       } elsif ( $type eq 'text' ) {
         $html .= qq!<INPUT TYPE="text" NAME="$option" VALUE="$value" SIZE=64>!;
+      } elsif ( $type eq 'checkbox' ) {
+        $html .= qq!<INPUT TYPE="checkbox" NAME="$option" VALUE="1">!;
       } else {
         $html .= "unknown type $type";
       }