X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Felements%2Fprocess.html;h=fd12c61d9cb6f22612170f887a77af0618fdb8e2;hb=e9a7ae3aadab31f34c6bacb2376f817ecd4d7d8d;hp=24064f942f8322f4cae927a558751c1ce33f9c54;hpb=424ae31847c4fd44e6ed55ec275c8e668c7d2b51;p=freeside.git diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html index 24064f942..fd12c61d9 100644 --- a/httemplate/edit/process/elements/process.html +++ b/httemplate/edit/process/elements/process.html @@ -59,12 +59,27 @@ Example: 'process_o2m' => { 'table' => table_name', 'num_col' => 'column', #if column name is different in #link_table than source_table + 'fields' => [qw( fieldname fieldname2 )], }, + 'process_upload' => { + 'process' => 'misc/mytable-import.html', + # fields to pass to the back end job, besides the + # primary key of the object + 'fields' => [qw( fieldname fieldname2 )], + }, + + 'skip_process' => 0, #boolean, if set true, will skip the main table + #add/edit processing and only run any linked table + #process_ items + #checks CGI params and whatever else before much else runs #return an error string or empty for no error 'precheck_callback' => sub { my( $cgi ) = @_; }, + #after the new object is created + 'post_new_object_callback' => sub { my( $cgi, $object ) = @_; }, + #after everything's inserted 'noerror_callback' => sub { my( $cgi, $object ) = @_; }, @@ -86,9 +101,6 @@ Example: %doc> %if ( $error ) { % -% my $edit_ext = $opt{'edit_ext'} || 'html'; -% my $url = $opt{'error_redirect'} || popurl(2)."$table.$edit_ext"; - % #my $query = $m->scomp('/elements/create_uri_query'); % #$cgi->redirect("$url?$query"); % if ( length($cgi->query_string) > 1920 ) { #stupid IE 2083 URL limit @@ -106,17 +118,70 @@ Example: % " attempting to set redirect$session to ". $cgi->query_string."\n"; % } % -<% $cgi->redirect("$url?redirect=$session") %> +<% $cgi->redirect("$error_redirect?redirect=$session") %> % % } else { % -<% $cgi->redirect("$url?". $cgi->query_string ) %> +<% $cgi->redirect("$error_redirect?". $cgi->query_string ) %> % -% } +% } % % #different ways of handling success % -%} elsif ( $opt{'popup_reload'} ) { +%} elsif ( $opt{'process_upload'} and @uploaded_files ) { +% +% # construct a form to pass all the requested fields, the +% +<& /elements/header.html &> +
+ +<& /elements/footer.html &> + +% } elsif ( $opt{'progress_init'} ) { +% # some false laziness with the above +% my ($form_name, $job_fields) = @{ $opt{'progress_init'} }; + + +<& /elements/footer.html &> + +% } elsif ( $opt{'popup_reload'} ) { <% include('/elements/header-popup.html', $opt{'popup_reload'} ) %> @@ -128,26 +193,8 @@ Example: