X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fprogress-init.html;h=0c2b8165a13e44aaaa41bc6e2670002837511b26;hp=2ec248e322c01545e29f644d06c8943989dba79a;hb=f822e27a1e00594332ffa487a1c284234c5580a6;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924 diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 2ec248e32..0c2b8165a 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -17,6 +17,9 @@ In misc/something.html: # redirecting to the URL. #or { popup_url => $p.'popup_contents.html' } # which loads that URL into the popup after completion + #or { url => $p.'where_to_go.html', + error_url => $p.'where_we_just_were.html' } + # to redirect somewhere different on error ) %> -<%once> -my $noinit = 0; - <%init> my( $formname, $fields, $action, $url_or_message, $key ) = @_; $key = '' unless defined $key; -my $url_or_message_link; +my %dest_info; if ( ref($url_or_message) ) { #its a message or something - $url_or_message_link = 'message='. uri_escape( $url_or_message->{'message'} ); - $url_or_message_link .= ';url='. uri_escape( $url_or_message->{'url'} ) - if $url_or_message->{'url'}; - $url_or_message_link = 'popup_url=' .uri_escape( $url_or_message->{'popup_url'} ) - if $url_or_message->{'popup_url'}; + %dest_info = map { $_ => $url_or_message->{$_} } + grep { $url_or_message->{$_} } + qw( message url popup_url error_url ); +} else { + # it can also just be a url + %dest_info = ( 'url' => $url_or_message ); +} +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 { - $url_or_message_link = "url=$url_or_message"; + %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();