summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2010-06-07 02:39:35 +0000
committerivan <ivan>2010-06-07 02:39:35 +0000
commit31a9c95e5b7125ef666248699fff31f1f8211364 (patch)
tree3673d519ac208bbf6b4ecc174511d3cef99a1501 /httemplate/edit
parentda99804133e55d5ce02402645b593a6de06d1947 (diff)
domain rules based on templates (rules from other domains), RT#7514
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/process/cgp_rule.html6
-rw-r--r--httemplate/edit/process/elements/process.html11
2 files changed, 17 insertions, 0 deletions
diff --git a/httemplate/edit/process/cgp_rule.html b/httemplate/edit/process/cgp_rule.html
index 965341384..5326587cb 100644
--- a/httemplate/edit/process/cgp_rule.html
+++ b/httemplate/edit/process/cgp_rule.html
@@ -11,6 +11,12 @@
'fields' => [qw( action params )],
},
],
+ 'noerror_callback' => sub {
+ my( $cgi, $object ) = @_;
+ my $error = $object->svc_export;
+ #shit, not a good place for error handling :/
+ die $error if $error;
+ },
)
%>
<%init>
diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html
index 87cadb774..ebbc2f778 100644
--- a/httemplate/edit/process/elements/process.html
+++ b/httemplate/edit/process/elements/process.html
@@ -65,6 +65,9 @@ Example:
#return an error string or empty for no error
'precheck_callback' => sub { my( $cgi ) = @_; },
+ #after everything's inserted
+ 'noerror_callback' => sub { my( $cgi, $object ) = @_; },
+
#supplies arguments to insert() and replace()
# for use with tables that are FS::option_Common (among other things)
'args_callback' => sub { my( $cgi, $object ) = @_; },
@@ -298,12 +301,20 @@ if ( !$error && $opt{'process_o2m'} ) {
if ( $error ) {
+
$cgi->param('error', $error);
if ( $opt{'clear_on_error'} && scalar(@{$opt{'clear_on_error'}}) ) {
foreach my $field (@{$opt{'clear_on_error'}}) {
$cgi->param($field, '')
}
}
+
+} else {
+
+ if ( $opt{'noerror_callback'} ) {
+ &{ $opt{'noerror_callback'} }( $cgi, $new );
+ }
+
}
</%init>