X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcontact.html;h=779905234381c54dd209e8ce822fd80bd97f9eb7;hb=6016bc83d369186275044bd8539f66a3cb03c4cb;hp=490ba2303c5e26531f384cdde956473fa359d183;hpb=a72a10f754f7465121d6137bb3dcee0a21ea6443;p=freeside.git diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html index 490ba2303..779905234 100644 --- a/httemplate/elements/contact.html +++ b/httemplate/elements/contact.html @@ -2,9 +2,9 @@ - +
-% if ( @contact_class ) { +% if ( @contact_class && ! $opt{name_only} ) { % } +% my $pwd_change_label = 'change password'; +% $pwd_change_label = 'setup password' unless $contact->_password; +% if ($curr_value) { + +% }
- " - <% $onchange %> - >
+% if ( $field eq 'selfservice_access' ) { + + +% } else { + " + <% $onchange %> + > +% } +
<% $label{$field} %>
+ + <& /elements/change_password.html, + 'contact_num' => $curr_value, + 'custnum' => $opt{'custnum'}, + 'curr_value' => '', + 'label' => $pwd_change_label, + &> + +
+ Password +
@@ -64,6 +96,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'; @@ -90,15 +125,16 @@ if ( $curr_value ) { 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; foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) { - next if $phone_type->typename eq 'Home'; + next if $phone_type->typename =~ /^(Home|Fax)$/; my $f = 'phonetypenum'.$phone_type->phonetypenum; $label{$f} = $phone_type->typename. ' phone'; $size{$f} = $first++ ? 10 : 15; @@ -106,6 +142,6 @@ foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) { $label{'comment'} = 'Comment'; -my @fields = keys %label; +my @fields = $opt{'name_only'} ? qw( first last ) : keys %label;