From 6f402df348017146e248ecaae2c71c0a9d708ea4 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 29 Apr 2010 07:40:47 +0000 Subject: communigate (phase 2): rules: adding conditions and actions to rule edit. RT#7514 --- httemplate/edit/cgp_rule.html | 32 +++++++++++++++++--------------- httemplate/edit/process/cgp_rule.html | 14 ++++++++++++-- 2 files changed, 29 insertions(+), 17 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cgp_rule.html b/httemplate/edit/cgp_rule.html index 6f2d80161..adf993f25 100644 --- a/httemplate/edit/cgp_rule.html +++ b/httemplate/edit/cgp_rule.html @@ -10,29 +10,31 @@ }, 'fields' => [ 'name', 'comment', - { 'field' => 'priority', - 'type' => 'select', - 'options' => [ 0 .. 10 ], - 'labels' => { 0 => 'Inactive' }, + { 'field' => 'priority', + 'type' => 'select', + 'options' => [ 0 .. 10 ], + 'labels' => { 0 => 'Inactive' }, }, - { 'field' => 'svcnum', 'type' => 'hidden', }, - { 'type' => 'tablebreak-tr-title', - 'value' => 'Conditions', + { 'field' => 'svcnum', 'type' => 'hidden', }, + { 'type' => 'tablebreak-tr-title', + 'value' => 'Conditions', }, - { 'field' => 'ruleconditionnum', - 'type' => 'select-cgp_rule_condition', + { 'field' => 'ruleconditionnum', + 'type' => 'select-cgp_rule_condition', 'o2m_table' => 'cgp_rule_condition', - 'm2_label' => 'Condition', + 'm2_label' => 'Condition', #XXX m2_error_callback + 'm2_error_callback' => sub {}, }, - { 'type' => 'tablebreak-tr-title', - 'value' => 'Actions', + { 'type' => 'tablebreak-tr-title', + 'value' => 'Actions', }, - { 'field' => 'ruleactionnum', - 'type' => 'select-cgp_rule_action', + { 'field' => 'ruleactionnum', + 'type' => 'select-cgp_rule_action', 'o2m_table' => 'cgp_rule_action', - 'm2_label' => 'Action', + 'm2_label' => 'Action', #XXX m2_error_callback + 'm2_error_callback' => sub {}, }, ], 'new_callback' => sub { my( $cgi, $cgp_rule ) = @_; diff --git a/httemplate/edit/process/cgp_rule.html b/httemplate/edit/process/cgp_rule.html index 3880b56b9..f427b6ccf 100644 --- a/httemplate/edit/process/cgp_rule.html +++ b/httemplate/edit/process/cgp_rule.html @@ -1,6 +1,16 @@ <% include( 'elements/process.html', - 'table' => 'cgp_rule', - 'redirect' => $redirect, + 'table' => 'cgp_rule', + 'redirect' => $redirect, + 'process_o2m' => [ + { + 'table' => 'cgp_rule_condition', + 'fields' => [qw( condition op params )], + }, + { + 'table' => 'cgp_rule_action', + 'fields' => [qw( action params )], + }, + ], ) %> <%init> -- cgit v1.2.1