diff options
author | ivan <ivan> | 2009-12-28 19:20:25 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-12-28 19:20:25 +0000 |
commit | 03ceab71dad1e5eb366865d304e5e459cc905ce4 (patch) | |
tree | 18b4532289a0237ae694b1ad5c033b25f448bd7c /httemplate/elements/contact.html | |
parent | 5950a980cef4968ac59ca8041d2204e6d98e7a3d (diff) |
beginning of prospect/CRM/contact work
Diffstat (limited to 'httemplate/elements/contact.html')
-rw-r--r-- | httemplate/elements/contact.html | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html new file mode 100644 index 000000000..38703bfef --- /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> |