summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-09-05 14:47:53 -0700
committerMark Wells <mark@freeside.biz>2014-09-05 14:47:53 -0700
commit529413f23d545179ff07ac393713a225a78014c2 (patch)
tree64f4f409e03efbda006523f8aadc0a35e9be7a1e /httemplate/edit/process
parentb13dda3c202b7eb07167e6423ee71c63f18cdac1 (diff)
validate parameter in balance_age condition, #15045
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r--httemplate/edit/process/part_event.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/httemplate/edit/process/part_event.html b/httemplate/edit/process/part_event.html
index a8c434c1a..481439d53 100644
--- a/httemplate/edit/process/part_event.html
+++ b/httemplate/edit/process/part_event.html
@@ -85,6 +85,21 @@
if ( $cgi->param('_initialize') ) {
$cgi->param('disabled', 'Y');
}
+
+ my $balance_age_rx = qr/^(condition.+)\.balance_age\.age$/;
+
+ foreach my $param ( keys %{ $cgi->Vars() } ){
+
+ next unless ( $param =~ /$balance_age_rx/ );
+ next unless $cgi->param($1) eq 'balance_age';
+
+ my $errstr = FS::part_event::Condition::balance_age->
+ check_options( { age => $cgi->param($param),
+ age_units => $cgi->param("${param}_units") } );
+
+ return $errstr if $errstr;
+ }
+
return '';
},
'noerror_callback' => sub {