From 3f23bdfaef8eb6bb092b72ea741b63e243f8ab19 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 29 Mar 2008 08:15:45 +0000 Subject: 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 --- httemplate/misc/cancel_cust.html | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'httemplate/misc/cancel_cust.html') 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, -- cgit v1.2.1