% 'phonetypenum' => $1,
% });
% if ( $contact_phone ) {
-% $value = $contact_phone->phonenum;
+% $value = $contact_phone->phonenum_pretty;
% $value .= 'x'.$contact_phone->extension
% if $contact_phone->extension;
% $value = '+'. $contact_phone->countrycode. " $value"
% }
<TD>
- <INPUT TYPE = "text"
- NAME = "<%$name%>_<%$field%>"
- ID = "<%$id%>_<%$field%>"
- SIZE = "<% $size{$field} || 15 %>"
- VALUE = "<% scalar($cgi->param($name."_$field"))
- || $value |h %>"
- <% $onchange %>
- ><BR>
+% if ( $field eq 'selfservice_access' ) {
+ <SELECT NAME = "<%$name%>_<%$field%>"
+ ID = "<%$id%>_<%$field%>"
+ >
+ <OPTION VALUE="">Disabled
+% if ( $value || $self_base_url ) {
+ <OPTION VALUE="Y" <% $value eq 'Y' ? 'SELECTED' : '' %>>Enabled
+% if ( $value eq 'Y' && $self_base_url ) {
+ <OPTION VALUE="R">Re-email
+% }
+% }
+ </SELECT>
+
+% } else {
+ <INPUT TYPE = "text"
+ NAME = "<%$name%>_<%$field%>"
+ ID = "<%$id%>_<%$field%>"
+ SIZE = "<% $size{$field} || 14 %>"
+ VALUE = "<% scalar($cgi->param($name."_$field"))
+ || $value |h %>"
+ <% $onchange %>
+ >
+% }
+ <BR>
<FONT SIZE="-1"><% $label{$field} %></FONT>
</TD>
+% }
+% my $pwd_change_label = 'change password';
+% $pwd_change_label = 'setup password' unless $contact->_password;
+% if ($curr_value) {
+ <TD>
+ <span STYLE="white-space: nowrap">
+ <& /elements/change_password.html,
+ 'contact_num' => $curr_value,
+ 'custnum' => $opt{'custnum'},
+ 'curr_value' => '',
+ 'label' => $pwd_change_label,
+ &>
+ </span>
+ <br>
+ <FONT SIZE="-1">Password</FONT>
+ </TD>
% }
</TR>
</TABLE>
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';
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;