From 26deea8eb085dcb06295e6795f72f2844bcd3fe1 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 1 Apr 2003 06:55:01 +0000 Subject: cancel button for customers (closes: Bug#25) --- httemplate/misc/cust_main-cancel.cgi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 httemplate/misc/cust_main-cancel.cgi (limited to 'httemplate/misc/cust_main-cancel.cgi') diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi new file mode 100755 index 000000000..526e128a4 --- /dev/null +++ b/httemplate/misc/cust_main-cancel.cgi @@ -0,0 +1,16 @@ +<% + +#untaint custnum +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/ || die "Illegal custnum"; +my $custnum = $1; + +my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); + +my $error = $cust_main->cancel; +eidiot($error) if $error; + +#print $cgi->redirect($p. "view/cust_main.cgi?". $cust_main->custnum); +print $cgi->redirect($p); + +%> -- cgit v1.2.1 From 9163d831264988af6065139c7531d59a1bb29c10 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 22 Jan 2004 00:11:01 +0000 Subject: report cancellation errors properly --- httemplate/misc/cust_main-cancel.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/misc/cust_main-cancel.cgi') diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi index 526e128a4..257c3384f 100755 --- a/httemplate/misc/cust_main-cancel.cgi +++ b/httemplate/misc/cust_main-cancel.cgi @@ -7,8 +7,8 @@ my $custnum = $1; my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); -my $error = $cust_main->cancel; -eidiot($error) if $error; +my @errors = $cust_main->cancel; +eidiot(join(' / ', @errors)) if scalar(@errors); #print $cgi->redirect($p. "view/cust_main.cgi?". $cust_main->custnum); print $cgi->redirect($p); -- cgit v1.2.1