X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcontact.html;h=850c2540d6156c882c95446c2819bd984050b923;hb=59776b97e0d82e30e9a50c76d16f302309fff76d;hp=3fbcc05187f268b9dd8a1c09adb8d4068227d4b9;hpb=571291dda91dd92db80660aa3d67333b0c88fc34;p=freeside.git diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html index 3fbcc0518..850c2540d 100644 --- a/httemplate/elements/contact.html +++ b/httemplate/elements/contact.html @@ -50,17 +50,34 @@ % if ( $field eq 'selfservice_access' ) { + + <& /elements/change_password.html, + 'contact_num' => $curr_value, + 'custnum' => $opt{'custnum'}, + 'curr_value' => '', + 'no_label_display' => '1', + 'noformtag' => '1', + 'pre_pwd_field_label' => $id.'_', + &> + % } elsif ( $field eq 'invoice_dest' ) { % my $curr_value = $cgi->param($name . '_' . $field); % $curr_value = $value if !defined($curr_value); @@ -94,6 +111,7 @@ 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'; @@ -126,12 +144,17 @@ if ( $curr_value ) { 'contactnum' => $curr_value, 'prospectnum' => $opt{'prospectnum'}, }); + $opt{'for_prospect'} = 1; } else { die 'neither custnum nor prospectnum specified'; } } else { $contact = new FS::contact {}; - $X_contact = new FS::cust_contact; #arbitrary, it could be prospect_contact + if ($opt{'for_prospect'}) { + $X_contact = new FS::prospect_contact; + } else { + $X_contact = new FS::cust_contact; + } } my %size = ( 'title' => 12 ); @@ -140,11 +163,14 @@ tie my %label, 'Tie::IxHash', 'first' => 'First name', 'last' => 'Last name', 'title' => 'Title/Position', - 'emailaddress' => 'Email', - 'invoice_dest' => 'Send invoices', - 'selfservice_access' => 'Self-service' + 'emailaddress' => 'Email' ; +unless ($opt{'for_prospect'}) { + $label{'invoice_dest'} = 'Send invoices'; + $label{'selfservice_access'} = 'Self-service'; +} + my $first = 0; foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) { next if $phone_type->typename =~ /^(Home|Fax)$/; @@ -157,4 +183,7 @@ $label{'comment'} = 'Comment'; my @fields = $opt{'name_only'} ? qw( first last ) : keys %label; +my $pwd_change_label = 'Change Password'; +$pwd_change_label = 'Setup Password' unless $contact->_password; +