[freeside-commits] freeside/httemplate/edit cgp_rule.html, 1.1.2.4, 1.1.2.5
Ivan,,,
ivan at wavetail.420.am
Thu Apr 29 19:17:35 PDT 2010
- Previous message: [freeside-commits] freeside/FS/FS cgp_rule_action.pm, 1.1.2.2, 1.1.2.3 cgp_rule_condition.pm, 1.1.2.2, 1.1.2.3 Schema.pm, 1.168.2.36, 1.168.2.37 Mason.pm, 1.19.2.6, 1.19.2.7
- Next message: [freeside-commits] freeside/httemplate/elements select-cgp_rule_action.html, 1.1.2.5, 1.1.2.6 select-cgp_rule_condition.html, 1.1.2.4, 1.1.2.5
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv19127/httemplate/edit
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/edit/cgp_rule.html,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -w -d -r1.1.2.4 -r1.1.2.5
--- cgp_rule.html 29 Apr 2010 07:40:47 -0000 1.1.2.4
+++ cgp_rule.html 30 Apr 2010 02:17:33 -0000 1.1.2.5
@@ -23,8 +23,7 @@
'type' => 'select-cgp_rule_condition',
'o2m_table' => 'cgp_rule_condition',
'm2_label' => 'Condition',
- #XXX m2_error_callback
- 'm2_error_callback' => sub {},
+ 'm2_error_callback' => $m2_error_callback_cond,
},
{ 'type' => 'tablebreak-tr-title',
'value' => 'Actions',
@@ -33,8 +32,7 @@
'type' => 'select-cgp_rule_action',
'o2m_table' => 'cgp_rule_action',
'm2_label' => 'Action',
- #XXX m2_error_callback
- 'm2_error_callback' => sub {},
+ 'm2_error_callback' => $m2_error_callback_action,
},
],
'new_callback' => sub { my( $cgi, $cgp_rule ) = @_;
@@ -48,7 +46,57 @@
my %opt = @_;
-#my $svcnum #huh XXX
#my $viewall_url = $p. "browse/$table.html?svcnum=$svcnum";
+my $m2_error_callback_cond = sub {
+ my($cgi, $object) = @_;
+
+ my @fields = qw( condition op params );
+ my @gfields = ( '', map "_$_", @fields );
+
+ map {
+ if ( /^ruleconditionnum(\d+)$/ ) {
+ my $num = $1;
+ if ( grep $cgi->param("ruleconditionnum$num$_"), @gfields ) {
+ my $x = new FS::cgp_rule_condition {
+ 'ruleconditionnum' => $cgi->param("ruleconditionnum$num"),
+ map { $_ => scalar($cgi->param("ruleconditionnum${num}_$_")) } @fields,
+ };
+ $x;
+ } else {
+ ();
+ }
+ } else {
+ ();
+ }
+ }
+ $cgi->param;
+};
+
+my $m2_error_callback_action = sub {
+ my($cgi, $object) = @_;
+
+ my @fields = qw( action params );
+ my @gfields = ( '', map "_$_", @fields );
+
+ map {
+ if ( /^ruleactionnum(\d+)$/ ) {
+ my $num = $1;
+ if ( grep $cgi->param("ruleactionnum$num$_"), @gfields ) {
+ my $x = new FS::cgp_rule_condition {
+ 'ruleactionnum' => $cgi->param("ruleactionnum$num"),
+ map { $_ => scalar($cgi->param("ruleactionnum${num}_$_")) } @fields,
+ };
+ $x;
+ } else {
+ ();
+ }
+ } else {
+ ();
+ }
+ }
+ $cgi->param;
+
+};
+
</%init>
- Previous message: [freeside-commits] freeside/FS/FS cgp_rule_action.pm, 1.1.2.2, 1.1.2.3 cgp_rule_condition.pm, 1.1.2.2, 1.1.2.3 Schema.pm, 1.168.2.36, 1.168.2.37 Mason.pm, 1.19.2.6, 1.19.2.7
- Next message: [freeside-commits] freeside/httemplate/elements select-cgp_rule_action.html, 1.1.2.5, 1.1.2.6 select-cgp_rule_condition.html, 1.1.2.4, 1.1.2.5
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list