diff options
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/contact.html | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/httemplate/elements/contact.html b/httemplate/elements/contact.html index 8abce058e..979c26b49 100644 --- a/httemplate/elements/contact.html +++ b/httemplate/elements/contact.html @@ -45,14 +45,30 @@ % } <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> % } @@ -64,6 +80,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,10 +109,11 @@ 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; |