summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r--httemplate/edit/process/elements/process.html7
-rw-r--r--httemplate/edit/process/saved_search.html15
2 files changed, 22 insertions, 0 deletions
diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html
index 89a38f4f6..60aaf749a 100644
--- a/httemplate/edit/process/elements/process.html
+++ b/httemplate/edit/process/elements/process.html
@@ -79,6 +79,9 @@ Example:
#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 ) = @_; },
@@ -269,6 +272,10 @@ foreach my $value ( @values ) {
}
}
+ if ( $opt{'post_new_object_callback'} ) {
+ &{ $opt{'post_new_object_callback'} }( $cgi, $new );
+ }
+
if ( $opt{'agent_virt'} ) {
if ( ! $new->agentnum
diff --git a/httemplate/edit/process/saved_search.html b/httemplate/edit/process/saved_search.html
new file mode 100644
index 000000000..7ae7e0d78
--- /dev/null
+++ b/httemplate/edit/process/saved_search.html
@@ -0,0 +1,15 @@
+<& elements/process.html,
+ 'table' => 'saved_search',
+ 'popup_reload' => 'Saving',
+ 'post_new_object_callback' => $callback,
+&>
+<%init>
+
+my $callback = sub {
+ my ($cgi, $obj) = @_;
+ $obj->usernum( $FS::CurrentUser::CurrentUser->usernum );
+ # if this would change it from its existing owner, replace_check
+ # will refuse
+};
+
+</%init>