X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Felements%2Fedit.html;h=8ba703a2f5064d3c5185e7d5c09448b7eb3094e6;hb=86448cce000b5c1db8e33b7884b6acd6ea7906c6;hp=377a56c791cf5a61fdd85799c0b73e57be9ce9a6;hpb=9e878943532b9ecb84bac1db76c05cf9bc09d2cc;p=freeside.git diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 377a56c79..8ba703a2f 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -358,6 +358,7 @@ Example: % #contact % 'custnum' => $f->{'custnum'}, % 'prospectnum' => $f->{'prospectnum'}, +% % ); % % $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}), @@ -370,7 +371,7 @@ Example: % qw( formatted_value ), #fixed % qw( country ), #select-country % qw( width height config ), #htmlarea -% qw( alt_format ), #select-cust_location +% qw( is_optional alt_format ), #select-cust_location % qw( classnum ), # select-inventory_item % qw( aligned ), # columnstart % qw( debug ), # select-table @@ -640,6 +641,15 @@ Example: return; } +% if ( exists( $f->{'js_spawn_test'} ) ) { + // XXX check a passed-in hook here and optionall return + if ( <% $f->{'js_spawn_test'} %> ) { + // then go ahead and spawn + } else { + return; + } +% } + // change the label on the last entry & add a remove button var prev_label = document.getElementById('<% $field %>_label' + <%$field%>_fieldnum ); prev_label.innerHTML = ' <% $f->{'m2_label'} || $field %>'; @@ -862,7 +872,9 @@ my $pkey = dbdef->table($table)->primary_key; #? $opt{'primary_key'} || my $fields = $opt{'fields'} #|| [ grep { $_ ne $pkey } dbdef->table($table)->columns ]; || [ grep { $_ ne $pkey } fields($table) ]; -#my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields; +my @actualfields = map { ref($_) ? $_->{'field'} : $_ } @$fields; + +push @actualfields, $pkey; my $js_form_validate = {}; @@ -905,7 +917,7 @@ if ( $opt{'embed'} ) { $mode = 'error'; $object = $class->new( { - map { $_ => scalar($cgi->param($_)) } fields($table) + map { $_ => scalar($cgi->param($_)) } @actualfields }); &{$opt{'error_callback'}}( $cgi, $object, $fields, \%opt )