X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcontact.html;h=ef74481c046be2a2b932d800901b5314097ba3e5;hb=ec7e8155fce544f19f2b6734476ed6db8c200aa9;hp=8abce058ea61cedc87a912b21defc427d86036d0;hpb=24f8d52f90be8e99b10734f49d451e1e70afdfbc;p=freeside.git diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html index 8abce058e..ef74481c0 100644 --- a/httemplate/elements/contact.html +++ b/httemplate/elements/contact.html @@ -9,7 +9,7 @@ " - <% $onchange %> - >
+% if ( $field eq 'selfservice_access' ) { + + +% } else { + " + <% $onchange %> + > +% } +
<% $label{$field} %> % } @@ -64,6 +82,9 @@ my( %opt ) = @_; +my $conf = new FS::Conf; +my $self_base_url = $conf->config('selfservice_server-base_url'); + my $name = $opt{'element_name'} || $opt{'field'} || 'contactnum'; my $id = $opt{'id'} || 'contactnum'; @@ -81,19 +102,35 @@ if ( $opt{'onchange'} ) { my @contact_class = qsearch('contact_class', { 'disabled' => '' }); my $contact; +my $X_contact; if ( $curr_value ) { $contact = qsearchs('contact', { 'contactnum' => $curr_value } ); + if ( $opt{'custnum'} ) { + $X_contact = qsearchs('cust_contact', { + 'contactnum' => $curr_value, + 'custnum' => $opt{'custnum'}, + }); + } elsif ( $opt{'prospectnum'} ) { + $X_contact = qsearchs('prospect_contact', { + 'contactnum' => $curr_value, + 'prospectnum' => $opt{'prospectnum'}, + }); + } else { + die 'neither custnum nor prospectnum specified'; + } } else { $contact = new FS::contact {}; + $X_contact = new FS::cust_contact; #arbitrary, it could be prospect_contact } my %size = ( 'title' => 12 ); tie my %label, 'Tie::IxHash', - 'first' => 'First name', - 'last' => 'Last name', - 'title' => 'Title/Position', - 'emailaddress' => 'Email', + 'first' => 'First name', + 'last' => 'Last name', + 'title' => 'Title/Position', + 'emailaddress' => 'Email', + 'selfservice_access' => 'Self-service' ; my $first = 0;