X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fprogress-init.html;h=de3c6b761393cbb397b75043a2d9eb9c923ebb75;hb=474e879c6c47d23aa155d6f4b9c7a51b8badf8d9;hp=41feaac4b28e9ce13cbf77a92069e8a67e3c09fb;hpb=4d599c8ce382f51d7bfbb4172cdc73a2c8bd400d;p=freeside.git diff --git a/httemplate/elements/progress-init.html b/httemplate/elements/progress-init.html index 41feaac4b..de3c6b761 100644 --- a/httemplate/elements/progress-init.html +++ b/httemplate/elements/progress-init.html @@ -1,41 +1,122 @@ -<% - my( $formname, $fields, $action, $success_url, $key ) = @_; - $key = '' unless defined $key; +<%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 reload_with_error ); +} 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>