summaryrefslogtreecommitdiff
path: root/httemplate/browse
diff options
context:
space:
mode:
authorivan <ivan>2010-04-30 02:32:39 +0000
committerivan <ivan>2010-04-30 02:32:39 +0000
commit6873aec01740ea7c70a5e20a3f3bce6e76bca410 (patch)
tree64298627d0396ab78310ce9f5059665a5f8c1bdd /httemplate/browse
parent2ac302e18d723563692cdbbd74f3e9e5331a3014 (diff)
communigate (phase 2): rules: show conditions/actions on rule browse, fix rule edit for conditions and actions without op/param, fix rule edit stickiness on errors. RT#7514
Diffstat (limited to 'httemplate/browse')
-rw-r--r--httemplate/browse/cgp_rule.html40
1 files changed, 38 insertions, 2 deletions
diff --git a/httemplate/browse/cgp_rule.html b/httemplate/browse/cgp_rule.html
index 3bf4d69bd..ea11d62bf 100644
--- a/httemplate/browse/cgp_rule.html
+++ b/httemplate/browse/cgp_rule.html
@@ -7,13 +7,15 @@
'order_by' => 'ORDER BY priority DESC',
},
'count_query' => $count_query,
- 'header' => [ 'Priority', 'Name', '' ],
+ 'header' => [ 'Priority', 'Name', 'Conditions', 'Actions', '' ],
'fields' => [ sub { shift->priority || 'Inactive'; },
'name',
+ $condition_sub,
+ $action_sub,
sub { 'Delete'; },
],
#'align'
- 'links' => [ $edit_sub, $edit_sub, $del_sub ],
+ 'links' => [ $edit_sub, $edit_sub, '', '', $del_sub ],
)
%>
<%init>
@@ -40,6 +42,40 @@ my $html_init =
qq(<A HREF="$view">View this $svc_label</A><BR><BR>).
qq!<A HREF="${p}edit/cgp_rule.html?svcnum=$svcnum">Add new rule</A><BR><BR>!;
+my $condition_sub = sub {
+ my $cgp_rule = shift;
+
+ [ map {
+ [
+ { data => $_->condition,
+ #align =>
+ },
+ { data => $_->op,
+ align => 'center',
+ },
+ { data => $_->params,
+ #align =>
+ },
+ ];
+ }
+ $cgp_rule->cgp_rule_condition
+ ];
+};
+
+my $action_sub = sub {
+ my $cgp_rule = shift;
+
+ [ map {
+ [
+ { data => $_->action },
+ #{ data => '<pre>'.$_->params.'</pre>' }, #gets very big.. limit to
+ { data => $_->params }, # some actions?
+ ];
+ }
+ $cgp_rule->cgp_rule_action
+ ];
+};
+
my $edit_sub = [ $p.'edit/cgp_rule.html?', 'rulenum' ];
my $del_sub = [ $p.'misc/delete-cgp_rule.html?', 'rulenum' ]; #XXX javascript areyousure or something