diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2012-04-09 18:04:57 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2012-04-09 18:04:57 -0700 |
| commit | 4ec5b193c5234d54b7c676e21927d7de934258e5 (patch) | |
| tree | 81ad80f26a77f45f4a382b48333a1e5c2d7d3c0a /httemplate/misc/xmlhttp-cust_main-duplicates.html | |
| parent | dbd9550c7379a9d8881e33ec84ce2d6701995806 (diff) | |
| parent | 8824f2dc4410251c89e4913c713ceb11bb312e88 (diff) | |
Merge branch 'FREESIDE_2_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_2_3_BRANCH
Diffstat (limited to 'httemplate/misc/xmlhttp-cust_main-duplicates.html')
| -rw-r--r-- | httemplate/misc/xmlhttp-cust_main-duplicates.html | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/httemplate/misc/xmlhttp-cust_main-duplicates.html b/httemplate/misc/xmlhttp-cust_main-duplicates.html new file mode 100644 index 000000000..6654b3e39 --- /dev/null +++ b/httemplate/misc/xmlhttp-cust_main-duplicates.html @@ -0,0 +1,68 @@ +% if ( @cust_main ) { +<CENTER><BR><B>Duplicate customer</B><BR> +Choose an existing customer +<TABLE WIDTH="300px"> +<FORM name="DuplicateForm"> +% foreach (@cust_main) { +% my $custnum = $_->custnum; +<TR> + <TD ALIGN="right" VALIGN="top"><B><% $custnum %>: </B></TD> + <TD ALIGN="left"> + <% $_->name %>—<B><FONT COLOR="#<%$_->statuscolor%>"><%$_->ucfirst_cust_status%></FONT></B><BR> +<% $_->address1 %><BR> +<% $_->city %>, <% $_->state %> <% $_->zip %> + </TD> + <TD ALIGN="center"> + <INPUT TYPE="radio" NAME="dup_custnum" VALUE="<%$custnum%>"> + </TD> +</TR> +% } #foreach cust_main +</FORM> +</TABLE> +<TABLE WIDTH="100%"> +<TR> + <TD ALIGN="center"> + <BUTTON TYPE="button" onclick="submit_continue();"> + <IMG SRC="<%$p%>images/error.png"> Create a new customer + </BUTTON> + </TD> + <TD ALIGN="center"> + <BUTTON TYPE="button" onclick="<% $set_to_customer %>"> + <IMG SRC="<%$p%>images/tick.png"> Use the selected customer + </BUTTON> + </TD> +</TR> +<TR> + <TD COLSPAN=2 ALIGN="center"> + <BUTTON TYPE="button" onclick="submit_abort();"> + <IMG SRC="<%$p%>images/cross.png"> Cancel submission + </BUTTON> + </TD> +</TR> +% } +%# else return nothing +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('List customers'); + +my $conf = new FS::Conf; + +my $sub = $cgi->param('sub'); +my $hashref = decode_json($cgi->param('arg')); +my @cust_main = qsearch('cust_main', $hashref); + +my $set_to_customer = <<EOF; + var custnum_array = document.getElementsByName('dup_custnum'); + var custnum; + for(i=0; i<custnum_array.length; i++) { + if(custnum_array[i].checked) { + custnum = custnum_array[i].value; + } + } + //alert('Setting to customer '+custnum); + document.CustomerForm.elements['duplicate_of_custnum'].value = custnum; + submit_continue(); +EOF + +</%init> |
