[freeside-commits] freeside/httemplate/misc order_pkg.html, 1.3, 1.4 cancel_cust.html, 1.3, 1.4

Ivan,,, ivan at wavetail.420.am
Sat Mar 29 01:15:47 PDT 2008


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

Modified Files:
	order_pkg.html cancel_cust.html 
Log Message:
okay.  and thank goodness its on 1.9.  really fix error reporting on quick package order this time.  have to change cust cancel popup slightly too, but its for the better (easier custnum parsing).  and lastly make it easier for reason selection to be reused without stickiness-on-errors being a big pain in the ass

Index: cancel_cust.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/cancel_cust.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cancel_cust.html	13 Jan 2008 21:14:18 -0000	1.3
+++ cancel_cust.html	29 Mar 2008 08:15:45 -0000	1.4
@@ -17,8 +17,7 @@
 <% include('/elements/tr-select-reason.html',
              'field'          => 'reasonnum',
              'reason_class'   => 'C',
-             #XXX these need to be sticky on errors too...
-             #'curr_value'     => '',
+             'cgi'            => $cgi,
              'control_button' => 'document.cust_cancel_popup.submit',
           )
 %>
@@ -35,24 +34,21 @@
 
 <%init>
 
-my($custnum, $reasonnum, $submit, $cust_main, $curuser, $class); 
+my $reasonnum = '';
+my($submit, $class);
+
+$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
+my $custnum = $1;
+
 if ( $cgi->param('error') ) {
-  $custnum        = $cgi->param('custnum');
-  $reasonnum     = $cgi->param('reasonnum');
-} else {
-  my( $query ) = $cgi->keywords;
-  if ( $query =~ /^(\d+)$/ ) {
-    $custnum  = $1;
-  } else {
-    die "illegal query ". $cgi->keywords;
-  }
+  $reasonnum = $cgi->param('reasonnum');
 }
 
-$curuser = $FS::CurrentUser::CurrentUser;
+my $curuser = $FS::CurrentUser::CurrentUser;
 
 die "access denied" unless $curuser->access_right('Cancel customer');
 
-$cust_main = qsearchs( {
+my $cust_main = qsearchs( {
   'table'     => 'cust_main',
   'hashref'   => { 'custnum' => $custnum },
   'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,

Index: order_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/order_pkg.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- order_pkg.html	13 Jan 2008 21:08:27 -0000	1.3
+++ order_pkg.html	29 Mar 2008 08:15:45 -0000	1.4
@@ -10,6 +10,8 @@
 }
 </SCRIPT>
 
+<% include('/elements/error.html') %>
+
 <FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/quick-cust_pkg.cgi" METHOD="POST">
 
 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $cust_main->custnum %>">
@@ -19,8 +21,9 @@
   <TH ALIGN="right">Package</TH>
   <TD>
     <% include('/elements/select-cust-part_pkg.html',
-                 'cust_main' => $cust_main,
-                 'onchange'  => 'enable_order_pkg',
+                 'curr_value' => scalar( $cgi->param('pkgpart') ),
+                 'cust_main'  => $cust_main,
+                 'onchange'   => 'enable_order_pkg',
               )
     %>
   </TD>
@@ -50,8 +53,7 @@
 
 my $conf = new FS::Conf;
 
-my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
+$cgi->param('custnum') =~ /^(\d+)$/;
 my $custnum = $1;
 my $cust_main = qsearchs({
   'table'     => 'cust_main',



More information about the freeside-commits mailing list