diff options
Diffstat (limited to 'httemplate/edit/cust_main/contact.html')
-rw-r--r-- | httemplate/edit/cust_main/contact.html | 212 |
1 files changed, 212 insertions, 0 deletions
diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html new file mode 100644 index 000000000..51c0960ca --- /dev/null +++ b/httemplate/edit/cust_main/contact.html @@ -0,0 +1,212 @@ +<% &ntable("#cccccc") %> + +<TR> + <TH ALIGN="right"><%$r%><% mt('Contact name (last, first)') |h %></TH> + <TD COLSPAN=7> + <INPUT TYPE="text" NAME="<%$pre%>last" VALUE="<% $cust_main->get($pre.'last') |h %>" onChange="<% $onchange %>" <%$disabled%> <%$style%>> , + <INPUT TYPE="text" NAME="<%$pre%>first" VALUE="<% $cust_main->get($pre.'first') |h %>" onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +% if ( $conf->exists('show_ss') && !$pre ) { + + <TD ALIGN="right"><% mt('SS#') |h %></TD> + <TD><INPUT TYPE="text" NAME="ss" VALUE="<% $opt{ss} %>" SIZE=11></TD> +% } elsif ( !$pre ) { + + <TD><INPUT TYPE="hidden" NAME="ss" VALUE="<% $opt{ss} %>"></TD> +% } + + +</TR> + +% if ( $conf->exists('cust-email-high-visibility') && !$pre ) { + <TR> + <TD ALIGN="right" WIDTH="200"> + <% $conf->exists('cust_main-require_invoicing_list_email') ? $r : '' %>Email address(es) + </TD> + <TD bgcolor="#FFFF00"> + <INPUT TYPE="text" NAME="invoicing_list" VALUE="<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) %>"> + </TD> + </TR> +% } + +% unless ( $conf->exists('cust-edit-alt-field-order') ) { +<TR> + <TD ALIGN="right"><% mt('Company') |h %></TD> + <TD COLSPAN=7> + <INPUT TYPE="text" NAME="<%$pre%>company" VALUE="<% $cust_main->get($pre.'company') |h %>" SIZE=70 onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +</TR> + +<& /elements/location.html, + 'prefix' => $pre, + 'object' => $cust_main, + 'onchange' => $onchange, + 'disabled' => $disabled, + 'style' => \@style, + 'same_checked' => $opt{'same_checked'}, + 'geocode' => $opt{'geocode'}, + 'censustract' => $opt{'censustract'}, +&> + +<TR> + <TD ALIGN="right"><% $daytime_label %></TD> + <TD COLSPAN=5> + <INPUT TYPE="text" NAME="<%$pre%>daytime" VALUE="<% $cust_main->get($pre.'daytime') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +</TR> + +<TR> + <TD ALIGN="right"><% $night_label %></TD> + <TD COLSPAN=5> + <INPUT TYPE="text" NAME="<%$pre%>night" VALUE="<% $cust_main->get($pre.'night') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +</TR> + +<TR> + <TD ALIGN="right"><% $mobile_label %></TD> + <TD COLSPAN=5> + <INPUT TYPE="text" NAME="<%$pre%>mobile" VALUE="<% $cust_main->get($pre.'mobile') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +</TR> + +<TR> + <TD ALIGN="right"><% mt('Fax') |h %></TD> + <TD COLSPAN=5> + <INPUT TYPE="text" NAME="<%$pre%>fax" VALUE="<% $cust_main->get($pre.'fax') %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +</TR> + +% } else { + +<TR> + <TD ALIGN="right"><% $daytime_label %></TD> + <TD COLSPAN=5> + <INPUT TYPE="text" NAME="<%$pre%>daytime" VALUE="<% $cust_main->get($pre.'daytime') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +</TR> + +<TR> + <TD ALIGN="right"><% $night_label %></TD> + <TD COLSPAN=5> + <INPUT TYPE="text" NAME="<%$pre%>night" VALUE="<% $cust_main->get($pre.'night') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +</TR> + +<TR> + <TD ALIGN="right"><% $mobile_label %></TD> + <TD COLSPAN=5> + <INPUT TYPE="text" NAME="<%$pre%>mobile" VALUE="<% $cust_main->get($pre.'mobile') %>" SIZE=18 onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +</TR> + +<& /elements/location.html, + 'prefix' => $pre, + 'object' => $cust_main, + 'onchange' => $onchange, + 'disabled' => $disabled, + 'style' => \@style, + 'same_checked' => $opt{'same_checked'}, + 'geocode' => $opt{'geocode'}, + 'censustract' => $opt{'censustract'}, +&> + +<TR> + <TD ALIGN="right"><% mt('Fax') |h %></TD> + <TD COLSPAN=5> + <INPUT TYPE="text" NAME="<%$pre%>fax" VALUE="<% $cust_main->get($pre.'fax') %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +</TR> + +<TR> + <TD ALIGN="right"><% mt('Company') |h %></TD> + <TD COLSPAN=7> + <INPUT TYPE="text" NAME="<%$pre%>company" VALUE="<% $cust_main->get($pre.'company') |h %>" SIZE=70 onChange="<% $onchange %>" <%$disabled%> <%$style%>> + </TD> +</TR> + +% } + +% if ( $conf->exists('show_stateid') && !$pre ) { + +<TR> + <TD ALIGN="right"><% $stateid_label %></TD> + <TD><INPUT TYPE="text" NAME="stateid" VALUE="<% $opt{stateid} %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%> <%$style%>></TD> + <TD ALIGN="right"><% $stateid_state_label %></TD> + <TD><& /elements/select-state.html, + 'state' => $cust_main->stateid_state, + 'country' => $cust_main->country, + 'prefix' => 'stateid_', + 'onchange' => $onchange, + 'disabled' => $disabled, + 'style' => \@style, + &> + </TD> +</TR> +% } elsif ( !$pre ) { + + <TD><INPUT TYPE="hidden" NAME="stateid" VALUE="<% $opt{stateid} %>"></TD> + <TD><INPUT TYPE="hidden" NAME="stateid_state" VALUE="<% $cust_main->stateid_state %>"></TD> +% } + +</TABLE> +<%$r%><% mt('required fields') |h %><BR> + +<%init> + +my %opt = @_; +my $cust_main = $opt{'cust_main'}; +my $pre = $opt{'pre'}; +my $onchange = $opt{'onchange'}; +my $disabled = $opt{'disabled'}; +my @style = ( $opt{'style'} ? @{ $opt{'style'} } : () ); + +my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : ''; + +my $conf = new FS::Conf; + +foreach (qw(ss stateid)) { + $opt{$_} = $cust_main->masked($_) unless exists $opt{$_}; +} + +#false laziness with ship state +my $countrydefault = $conf->config('countrydefault') || 'US'; +$cust_main->set($pre.'country', $countrydefault ) + unless $cust_main->get($pre.'country'); + +my $statedefault = $conf->config('statedefault') + || ($countrydefault eq 'US' ? 'CA' : ''); +$cust_main->set($pre.'state', $statedefault ) + unless $cust_main->get($pre.'state') + || $cust_main->get($pre.'country') ne $countrydefault; + +$cust_main->set('stateid_state', $cust_main->state ) + unless $pre || $cust_main->get('stateid_state'); + +$opt{geocode} ||= $cust_main->get('geocode'); + +if ( $conf->exists('cust_main-require_censustract') ) { + $opt{censustract} ||= $cust_main->censustract; +} + +my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/ + ? 'Day Phone' + : FS::Msgcat::_gettext('daytime'); +my $night_label = FS::Msgcat::_gettext('night') =~/^(night)?$/ + ? 'Night Phone' + : FS::Msgcat::_gettext('night') || 'Night Phone'; +my $mobile_label = FS::Msgcat::_gettext('mobile') =~/^(mobile)?$/ + ? 'Mobile Phone' + : FS::Msgcat::_gettext('mobile') || 'Mobile Phone'; + +my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/ + ? 'Driver’s License' + : FS::Msgcat::_gettext('stateid') || 'Driver’s License'; +my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/ + ? 'Driver’s License State' + : FS::Msgcat::_gettext('stateid_state') || 'Driver’s License State'; + +my $r = qq!<font color="#ff0000">*</font> !; + +my @invoicing_list = $cust_main->invoicing_list; + +</%init> |