[freeside-commits] freeside/httemplate/browse cgp_rule.html, 1.1.2.2, 1.1.2.3

Ivan,,, ivan at wavetail.420.am
Thu Apr 29 19:17:34 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv19127/httemplate/browse

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	cgp_rule.html 
Log Message:
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

Index: cgp_rule.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/cgp_rule.html,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -w -d -r1.1.2.2 -r1.1.2.3
--- cgp_rule.html	23 Apr 2010 06:43:40 -0000	1.1.2.2
+++ cgp_rule.html	30 Apr 2010 02:17:32 -0000	1.1.2.3
@@ -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 @@
   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
 



More information about the freeside-commits mailing list