projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
popup iframes don't have predictable names anymore, so locate submit buttons by id...
[freeside.git]
/
httemplate
/
misc
/
cancel_cust.html
diff --git
a/httemplate/misc/cancel_cust.html
b/httemplate/misc/cancel_cust.html
index
a757aa6
..
5c2e036
100644
(file)
--- a/
httemplate/misc/cancel_cust.html
+++ b/
httemplate/misc/cancel_cust.html
@@
-1,9
+1,6
@@
<% include('/elements/header-popup.html', 'Cancel customer' ) %>
<% include('/elements/header-popup.html', 'Cancel customer' ) %>
-% if ( $cgi->param('error') ) {
- <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT>
- <BR><BR>
-% }
+<% include('/elements/error.html') %>
<FORM NAME="cust_cancel_popup" ACTION="<% popurl(1) %>cust_main-cancel.cgi" METHOD=POST>
<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
<FORM NAME="cust_cancel_popup" ACTION="<% popurl(1) %>cust_main-cancel.cgi" METHOD=POST>
<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
@@
-20,9
+17,8
@@
<% include('/elements/tr-select-reason.html',
'field' => 'reasonnum',
'reason_class' => 'C',
<% include('/elements/tr-select-reason.html',
'field' => 'reasonnum',
'reason_class' => 'C',
- #XXX these need to be sticky on errors too...
- #'curr_value' => '',
- 'control_button' => 'document.cust_cancel_popup.submit',
+ 'cgi' => $cgi,
+ 'control_button' => "document.getElementById('confirm_cancel_cust_button')",
)
%>
)
%>
@@
-30,7
+26,7
@@
<BR>
<P ALIGN="CENTER">
<BR>
<P ALIGN="CENTER">
-<INPUT TYPE="submit" NAME="submit"
VALUE="Cancel customer" disabled='true'
> <INPUT TYPE="BUTTON" VALUE="Don't cancel" onClick="parent.cClick();">
+<INPUT TYPE="submit" NAME="submit"
ID="confirm_cancel_cust_button" VALUE="Cancel customer" DISABLED
> <INPUT TYPE="BUTTON" VALUE="Don't cancel" onClick="parent.cClick();">
</FORM>
</BODY>
</FORM>
</BODY>
@@
-38,22
+34,21
@@
<%init>
<%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') ) {
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,
'table' => 'cust_main',
'hashref' => { 'custnum' => $custnum },
'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,