From 2ac302e18d723563692cdbbd74f3e9e5331a3014 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 29 Apr 2010 07:40:46 +0000 Subject: communigate (phase 2): rules: adding conditions and actions to rule edit. RT#7514 --- httemplate/elements/select-cgp_rule_condition.html | 113 ++++++++++++++------- 1 file changed, 74 insertions(+), 39 deletions(-) (limited to 'httemplate/elements/select-cgp_rule_condition.html') diff --git a/httemplate/elements/select-cgp_rule_condition.html b/httemplate/elements/select-cgp_rule_condition.html index eaf7211fa..0c305d916 100644 --- a/httemplate/elements/select-cgp_rule_condition.html +++ b/httemplate/elements/select-cgp_rule_condition.html @@ -1,25 +1,42 @@ % unless ( $opt{'js_only'} ) { + + + <% include( 'select.html', - %opt, - 'options' => \@conditions, - 'labels' => { '' => 'Select Condition' }, - 'onchange' => $key.'_changed', + 'field' => $name.'_condition', + 'id' => $id.'_condition', + 'options' => \@conditions, + 'curr_value' => scalar($cgi->param($name.'_condition')) + || $cgp_rule_condition->condition, + 'labels' => { '' => 'Select Condition' }, + 'onchange' => $name.'_changed', ) %> + <% include( 'select.html', - 'name' => $opt{'field'}.'_op', - 'id' => $key.'_op', - 'options' => \@op, - #XXX curr op + 'field' => $name.'_op', + 'id' => $id.'_op', + 'options' => \@op, + 'curr_value' => scalar($cgi->param($name.'_op')) + || $cgp_rule_condition->op, + 'disabled' => $disabled, + 'style' => $style, ) %> + <% include( 'input-text.html', - 'name' => $opt{'field'}.'_params', - 'id' => $key.'_params', - #XXX curr value... anything else? + 'field' => $name.'_params', + 'id' => $id.'_params', + 'curr_value' => scalar($cgi->param($name.'_params')) + || $cgp_rule_condition->params, + 'disabled' => $disabled, + 'style' => $style, + 'nodarken_disabled' => 1, ) %> + % # could add more UI sugar for date/time ranges, string #lists, etc. + % } % unless ( $opt{'html_only'} || $opt{'js_only'} ) {