textarea for SQL external statements, RT#78543
authorIvan Kohler <ivan@freeside.biz>
Wed, 31 Oct 2018 19:04:36 +0000 (12:04 -0700)
committerIvan Kohler <ivan@freeside.biz>
Wed, 31 Oct 2018 19:04:36 +0000 (12:04 -0700)
FS/FS/part_pkg/sql_external.pm
httemplate/edit/part_pkg.cgi

index a3866f3..3cdfe99 100644 (file)
@@ -44,6 +44,7 @@ our @detail_cols = ( qw(amount format duration phonenum accountcode
                        'default' => '',
                      },
     'query' => { 'name' => 'SQL query',
                        'default' => '',
                      },
     'query' => { 'name' => 'SQL query',
+                'type' => 'textarea',
                  'default' => '',
                },
 
                  'default' => '',
                },
 
index 84aac5b..a6a2a89 100755 (executable)
@@ -987,6 +987,14 @@ my $html_bottom = sub {
                      : $href->{$field}{'default'} ).
                  qq!">!;
   
                      : $href->{$field}{'default'} ).
                  qq!">!;
   
+      } elsif ( $href->{$field}{'type'} eq 'textarea' ) {
+
+        $html .= qq!<TEXTAREA NAME="${layer}__$field">!.
+                 ( exists($options{$field})
+                     ? &$format($options{$field})
+                     : $href->{$field}{'default'} ).
+                 qq!</TEXTAREA>!;
+
       } elsif ( $href->{$field}{'type'} eq 'checkbox' ) {
   
         $html .= qq!<INPUT TYPE="checkbox" NAME="${layer}__$field" VALUE=1 !.
       } elsif ( $href->{$field}{'type'} eq 'checkbox' ) {
   
         $html .= qq!<INPUT TYPE="checkbox" NAME="${layer}__$field" VALUE=1 !.