summaryrefslogtreecommitdiff
path: root/httemplate/elements/contact.html
diff options
context:
space:
mode:
authorivan <ivan>2009-12-28 19:20:25 +0000
committerivan <ivan>2009-12-28 19:20:25 +0000
commit03ceab71dad1e5eb366865d304e5e459cc905ce4 (patch)
tree18b4532289a0237ae694b1ad5c033b25f448bd7c /httemplate/elements/contact.html
parent5950a980cef4968ac59ca8041d2204e6d98e7a3d (diff)
beginning of prospect/CRM/contact work
Diffstat (limited to 'httemplate/elements/contact.html')
-rw-r--r--httemplate/elements/contact.html72
1 files changed, 72 insertions, 0 deletions
diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html
new file mode 100644
index 0000000..38703bf
--- /dev/null
+++ b/httemplate/elements/contact.html
@@ -0,0 +1,72 @@
+% unless ( $opt{'js_only'} ) {
+
+ <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
+
+ <TABLE>
+ <TR>
+ <TD>
+ <INPUT TYPE = "text"
+ NAME = "<%$name%>_first"
+ ID = "<%$id%>_id"
+ VALUE = "<% $contact->first |h %>"
+ <% $onchange %>
+ ><BR>
+ <FONT SIZE="-2">First name</FONT>
+ </TD>
+ <TD>
+ <INPUT TYPE = "text"
+ NAME = "<%$name%>_last"
+ ID = "<%$id%>_id"
+ VALUE = "<% $contact->get('last') |h %>"
+ <% $onchange %>
+ ><BR>
+ <FONT SIZE="-2">Last name</FONT>
+ </TD>
+ <TD>
+ <INPUT TYPE = "text"
+ NAME = "<%$name%>_title"
+ ID = "<%$id%>_id"
+ VALUE = "<% $contact->title |h %>"
+ <% $onchange %>
+ ><BR>
+ <FONT SIZE="-2">Title/Position</FONT>
+ </TD>
+ <TD>
+ <INPUT TYPE = "text"
+ NAME = "<%$name%>_comment"
+ ID = "<%$id%>_id"
+ VALUE = "<% $contact->comment |h %>"
+ <% $onchange %>
+ ><BR>
+ <FONT SIZE="-2">Comment</FONT>
+ </TD>
+ </TR>
+ </TABLE>
+
+% }
+<%init>
+
+my( %opt ) = @_;
+
+my $name = $opt{'element_name'} || $opt{'field'} || 'contactnum';
+my $id = $opt{'id'} || 'contactnum';
+
+my $curr_value = $opt{'curr_value'} || $opt{'value'};
+
+my $onchange = '';
+if ( $opt{'onchange'} ) {
+ $onchange = $opt{'onchange'};
+ $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
+ $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
+ #callbacks should act the same
+ $onchange = 'onChange="'. $onchange. '"';
+}
+
+my $contact;
+if ( $curr_value ) {
+ $contact = qsearchs('contact', { 'contactnum' => $curr_value } );
+} else {
+ $contact = new FS::contact {};
+}
+
+</%init>