diff options
author | ivan <ivan> | 2008-03-29 08:15:45 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-03-29 08:15:45 +0000 |
commit | 3f23bdfaef8eb6bb092b72ea741b63e243f8ab19 (patch) | |
tree | 38afeaebc98c09ae571c3ed4193d7a97cb54dac0 /httemplate/misc/cancel_cust.html | |
parent | ca292755ee3fc2027707b046352414e06ad45584 (diff) |
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
Diffstat (limited to 'httemplate/misc/cancel_cust.html')
-rw-r--r-- | httemplate/misc/cancel_cust.html | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/httemplate/misc/cancel_cust.html b/httemplate/misc/cancel_cust.html index bb4e1904a..74362f862 100644 --- a/httemplate/misc/cancel_cust.html +++ b/httemplate/misc/cancel_cust.html @@ -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, |