X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fprogress-init.html;h=0c2b8165a13e44aaaa41bc6e2670002837511b26;hb=e215fc213a1eb9a3365cecf5ce82f1a58f154cd6;hp=7844f56788ecdf6af889976a7f7cdcdf411f515b;hpb=fbff7663ff6fb115bcd4dae2eb991b90339bf68d;p=freeside.git diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 7844f5678..0c2b8165a 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -1,47 +1,111 @@ -<% - my( $formname, $fields, $action, $url_or_message, $key ) = @_; - $key = '' unless defined $key; - - my $url_or_message_link; - if ( ref($url_or_message) ) { #its a message or something - $url_or_message_link = - 'message='. uri_escape( $url_or_message->{'message'} ) - } else { - $url_or_message_link = "url=$url_or_message"; - } -%> +<%doc> +Example: +In misc/something.html: + +
+ - + +<& /elements/init_overlib.html &> + + +<%init> + +my( $formname, $fields, $action, $url_or_message, $key ) = @_; +$key = '' unless defined $key; + +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 ); +} 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 { + %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(); + +%init>