X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fprogress-init.html;h=0c2b8165a13e44aaaa41bc6e2670002837511b26;hp=5b42aa1a8cd8c82162b0adddde3f659c72ea7400;hb=f822e27a1e00594332ffa487a1c284234c5580a6;hpb=46ba9270a226ef01d0c29635373aef09ae42d372 diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 5b42aa1a8..0c2b8165a 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -98,14 +98,14 @@ function <%$key%>process () { overlib( 'Submitting job to server...', WIDTH, 444, HEIGHT, 168, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); + // jQuery .serializeArray() maybe? + var copy_fields = <% encode_json(\%copy_fields) %>; var Hash = new Array(); var x = 0; var fieldName; for (var i = 0; i.elements.length; i++) { field = document.<%$formname%>.elements[i]; - if ( <% join(' || ', map { "(field.name.indexOf('$_') > -1)" } @$fields ) %> - ) - { + if ( <% $all_fields %> || copy_fields[ field.name ] ) { if ( field.type == 'select-multiple' ) { //alert('select-multiple ' + field.name); for (var j=0; j < field.options.length; j++) { @@ -161,15 +161,23 @@ if ( ref($url_or_message) ) { #its a message or something %dest_info = ( 'url' => $url_or_message ); } -my $progress_url = URI->new($fsurl.'elements/progress-popup.html'); +my $progress_url = URI->new($fsurl.'misc/progress-popup.html'); $progress_url->query_form( 'jobnum' => '_JOBNUM_', 'formname' => $formname, %dest_info, ); +my $all_fields = 0; +my %copy_fields; +if (grep '/^ALL$/', @$fields) { + $all_fields = 1; +} else { + %copy_fields = map { $_ => 1 } @$fields; +} + #stupid safari is caching the "location" of popup iframs, and submitting them #instead of displaying them. this should prevent that. -my $popup_name = 'popup-'.time. "-$$-". rand() * 2**32; +my $popup_name = 'popup-'.random_id();