X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fprogress-init.html;h=e38dde65f12700b5668d2206dfccbae53a9563c2;hb=50f247ce6da7497428ce772d3c37c6cba3b9c736;hp=1c96a54ac9ed6fcc74b1cd546f9212a03467b48f;hpb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;p=freeside.git diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 1c96a54ac..e38dde65f 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -1,17 +1,81 @@ -% -% 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, +); + +#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>