[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 8824f2dc4410251c89e4913c713ceb11bb312e88

Mark Wells mark at 420.am
Mon Apr 9 13:13:18 PDT 2012


The branch, FREESIDE_2_3_BRANCH has been updated
       via  8824f2dc4410251c89e4913c713ceb11bb312e88 (commit)
      from  1fcfa917490094be40c0db373502ded2671b1017 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8824f2dc4410251c89e4913c713ceb11bb312e88
Author: Mark Wells <mark at freeside.biz>
Date:   Mon Apr 9 13:12:31 2012 -0700

    duplicate checking on 2.3, #17290

diff --git a/httemplate/misc/xmlhttp-cust_main-duplicates.html b/httemplate/misc/xmlhttp-cust_main-duplicates.html
new file mode 100644
index 0000000..6654b3e
--- /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>

-----------------------------------------------------------------------

Summary of changes:
 httemplate/misc/xmlhttp-cust_main-duplicates.html |   68 +++++++++++++++++++++
 1 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100644 httemplate/misc/xmlhttp-cust_main-duplicates.html




More information about the freeside-commits mailing list