X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=inline;f=httemplate%2Fedit%2Fprocess%2Felements%2Fprocess.html;h=1b9318725ae49c6e91b7313ddbbbab6c7b340e77;hb=90e15da7354b55cc5461b58ac087096ed47e0240;hp=2d39e9dced551352fac55b33f64b41556692549b;hpb=e4e9e2f1fe6f48cf22486962c6bf84f50d201358;p=freeside.git diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html index 2d39e9dce..1b9318725 100644 --- a/httemplate/edit/process/elements/process.html +++ b/httemplate/edit/process/elements/process.html @@ -34,6 +34,11 @@ Example: 'clear_on_error' => [ 'form_field1', 'form_field2', ... ], + ## message will be returned to redirect page as cookie and read by header.html + ## append =status, =warning, =error to change color of message box. Default is status + ## status is green, warning is yellow, and error is red + 'message' => [ 'My message=status', 'Please restart=warning' ], + #pass an arrayref of hashrefs for multiple m2ms or m2names #be certain you incorporate m2m_Common if you see error: param @@ -62,6 +67,15 @@ Example: 'fields' => [qw( fieldname fieldname2 )], }, + 'process_locale' => 'fieldname', # update entries in the _msgcat table + + '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 @@ -70,6 +84,13 @@ Example: #return an error string or empty for no error 'precheck_callback' => sub { my( $cgi ) = @_; }, + #after the new object is created + #return an error string or empty for no error + 'post_new_object_callback' => sub { my( $cgi, $object ) = @_; }, + + #run right before replacing (not run for inserts) + 'edit_callback' => sub { my( $new, $old ) = @_; }, + #after everything's inserted 'noerror_callback' => sub { my( $cgi, $object ) = @_; }, @@ -77,6 +98,9 @@ Example: # for use with tables that are FS::option_Common (among other things) 'args_callback' => sub { my( $cgi, $object ) = @_; }, + # if no errors after package insert or replace will update services attached to package. + 'update_svc' => sub { my( $cgi, $object ) = @_; }, + 'debug' => 1, #turns on debugging output #agent virtualization @@ -90,10 +114,13 @@ Example: %doc> %if ( $error ) { +% ## flatten any array refs so multi selects are sticky on error +% for my $param ($cgi->param) { +% if (ref($cgi->param($param)) eq "ARRAY") { +% $cgi->param($param, (join ",", @{$cgi->param($param)})); +% } +% } % -% 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 @@ -111,48 +138,92 @@ 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'} ) %>