[freeside-commits] freeside/httemplate/edit/process
part_bill_event.cgi, 1.8, 1.9
Jeff Finucane,420,,
jeff at wavetail.420.am
Sun Oct 22 21:21:05 PDT 2006
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail:/tmp/cvs-serv31107/httemplate/edit/process
Modified Files:
part_bill_event.cgi
Log Message:
events should attach reasons
Index: part_bill_event.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/part_bill_event.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- part_bill_event.cgi 18 Oct 2006 23:07:08 -0000 1.8
+++ part_bill_event.cgi 23 Oct 2006 04:21:03 -0000 1.9
@@ -31,23 +31,19 @@
% my $rnum;
% my $rtype;
% my $reasonm;
-% if ($eventcode =~ /cancel/) {
-% $cgi->param('creason') =~ /^(-?\d+)$/ || die "Invalid creason";
-% $rnum = $1;
-% if ($rnum == -1) {
-% $cgi->param('newcreasonT') =~ /^(\d+)$/ || die "Invalid newcreasonT";
-% $rtype = $1;
-% $cgi->param('newcreason') =~ /^([\s\w]+)$/ || die "Invalid newcreasonT";
-% $reasonm = $1;
-% }
-% }
-% if ($eventcode =~ /suspend/) {
-% $cgi->param('sreason') =~ /^(-?\d+)$/ || die "Invalid sreason";
+% my $class = '';
+% $class='c' if ($eventcode =~ /cancel/);
+% $class='s' if ($eventcode =~ /suspend/);
+% if ($class) {
+% $cgi->param("${class}reason") =~ /^(-?\d+)$/
+% or $error = "Invalid ${class}reason";
% $rnum = $1;
% if ($rnum == -1) {
-% $cgi->param('newsreasonT') =~ /^(\d+)$/ || die "Invalid newsreasonT";
+% $cgi->param("new${class}reasonT") =~ /^(\d+)$/
+% or $error = "Invalid new${class}reasonT";
% $rtype = $1;
-% $cgi->param('newsreason') =~ /^([\s\w]+)$/ || die "Invalid newsreasonT";
+% $cgi->param("new${class}reason") =~ /^([\s\w]+)$/
+% or $error = "Invalid new${class}reason";
% $reasonm = $1;
% }
% }
@@ -57,6 +53,11 @@
% 'reason_type' => $rtype,
% });
% $error = $reason->insert or $rnum = $reason->reasonnum;
+% unless ($error) {
+% $cgi->param("${class}reason", $rnum);
+% $cgi->param("new${class}reason", '');
+% $cgi->param("new${class}reasonT", '');
+% }
% }
%
% unless($error){
@@ -84,5 +85,3 @@
%}
%
%
-
-
More information about the freeside-commits
mailing list