X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fprogress-init.html;h=de3c6b761393cbb397b75043a2d9eb9c923ebb75;hp=2728240efa0638bc87a60f69e5e46f7187591f06;hb=ac3296dc4d9c1c7ff3646df6496a4f49d9e07b9b;hpb=600e9b690d7649e8cde7a9a4cd1089fcb432d238 diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 2728240ef..de3c6b761 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -13,8 +13,7 @@ In misc/something.html: #or { message => 'Finished!' }, #or { url => $p.'where_to_go.html', message => 'Finished' }, - # which displays the message, then waits for confirmation before - # redirecting to the URL. + # which recirects to the URL and displays the message as a status #or { popup_url => $p.'popup_contents.html' } # which loads that URL into the popup after completion #or { url => $p.'where_to_go.html', @@ -96,16 +95,16 @@ function <%$key%>process () { document.<%$formname%>.submit.disabled=true; } - overlib( 'Submitting job to server...', WIDTH, 444, HEIGHT, 168, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); + overlib( 'Submitting job to server...', WIDTH, 444, HEIGHT, 168, CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0, TEXTPADDING, 0, BASE, 0, BGCOLOR, '#333399', CGCOLOR, '#333399', FGCOLOR, '#f8f8f8' ); + // 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++) { @@ -127,6 +126,8 @@ function <%$key%>process () { } } + Hash.push('key', '<%$key%>'); + // jsrsPOST = true; // jsrsExecute( '<% $action %>', <%$key%>myCallback, 'start_job', Hash ); @@ -140,7 +141,7 @@ function <%$key%>myCallback( jobnum ) { var url = <% $progress_url->as_string |js_string %>; url = url.replace('_JOBNUM_', jobnum); - overlib( OLiframeContent(url, 444, 168, '<% $popup_name %>'), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0 ); + overlib( OLiframeContent(url, 444, 168, '<% $popup_name %>', 0), CAPTION, 'Please wait...', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', CLOSECLICK, MIDX, 0, MIDY, 0, TEXTPADDING, 0, BASE, 0, BGCOLOR, '#333399', CGCOLOR, '#333399', FGCOLOR, '#f8f8f8' ); } @@ -155,19 +156,27 @@ my %dest_info; if ( ref($url_or_message) ) { #its a message or something %dest_info = map { $_ => $url_or_message->{$_} } grep { $url_or_message->{$_} } - qw( message url popup_url error_url ); + qw( message url popup_url error_url reload_with_error ); } else { # it can also just be a url %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-'.random_id();