removing 17 year old obsolete file
[freeside.git] / httemplate / edit / cust_main / contact.html
1 <TABLE CLASS="fsinnerbox">
2
3 <TR>
4   <TH ALIGN="right"><%$r%><% mt('Contact name (last, first)') |h %></TH>
5   <TD COLSPAN=7>
6     <INPUT TYPE="text" NAME="<%$pre%>last" VALUE="<% $cust_main->get($pre.'last') |h %>" onChange="<% $onchange %>" <%$disabled%> <%$style%>> , 
7     <INPUT TYPE="text" NAME="<%$pre%>first" VALUE="<% $cust_main->get($pre.'first') |h %>" onChange="<% $onchange %>" <%$disabled%> <%$style%>>
8   </TD>
9 % if ( $conf->exists('show_ss') && !$pre ) { 
10
11   <TD ALIGN="right"><% mt('SS#') |h %></TD>
12   <TD><INPUT TYPE="text" NAME="ss" VALUE="<% $opt{ss} %>" SIZE=11></TD>
13 % } elsif ( !$pre ) { 
14
15   <TD><INPUT TYPE="hidden" NAME="ss" VALUE="<% $opt{ss} %>"></TD>
16 % } 
17 </TR>
18
19 % if ( $conf->exists('cust-email-high-visibility') && !$pre ) {
20     <TR>
21       <TD ALIGN="right" WIDTH="200">
22         <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum) 
23           ? $r : '' %>Email address(es)
24       </TD>
25       <TD bgcolor="#FFFF00">
26         <INPUT TYPE="text" NAME="invoicing_list" VALUE="<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) %>">
27       </TD>
28     </TR>
29 % }
30
31 % unless ( $conf->exists('cust-edit-alt-field-order') ) { #standard order
32
33   <& company &>
34   <& location &>
35   <& phones &>
36   <& fax &>
37
38 % } else { #alternate field order
39
40   <& phones &>
41   <& location &>
42   <& fax &>
43   <& company &>
44
45 % }
46
47 % if ( $conf->exists('show_stateid') && !$pre ) { 
48
49 <TR>
50   <TD ALIGN="right"><% $stateid_label %></TD>
51   <TD><INPUT TYPE="text" NAME="stateid" VALUE="<% $opt{stateid} %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%> <%$style%>></TD>
52   <TD ALIGN="right"><% $stateid_state_label %></TD>
53   <TD><& /elements/select-state.html,
54                    'state'    => $cust_main->stateid_state,
55                    'country'  => $cust_main->country,
56                    'prefix'   => 'stateid_',
57                    'onchange' => $onchange,
58                    'disabled' => $disabled,
59                    'style'    => \@style,
60       &>
61   </TD>
62 </TR>
63 % } elsif ( !$pre ) { 
64
65   <TD><INPUT TYPE="hidden" NAME="stateid" VALUE="<% $opt{stateid} %>"></TD>
66   <TD><INPUT TYPE="hidden" NAME="stateid_state" VALUE="<% $cust_main->stateid_state %>"></TD>
67 % } 
68
69 </TABLE>
70 <%$r%><% mt('required fields') |h %><BR>
71
72 <%def company>
73 % my $display = ($cust_main->residential_commercial eq 'Commercial')
74 %                 ? '' : 'none';
75   <TR ID="<%$pre%>company_row" STYLE="display:<%$display%>">
76     <TD ALIGN="right"><% mt('Company') |h %></TD>
77     <TD COLSPAN=7>
78       <INPUT TYPE="text" NAME="<%$pre%>company" ID="<%$pre%>company" VALUE="<% $cust_main->get($pre.'company') |h %>" SIZE=60 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
79     </TD>
80   </TR>
81 </%def>
82
83 <%def location>
84   <& /elements/location.html,
85                'prefix'       => $pre,
86                'object'       => $cust_main,
87                'onchange'     => $onchange,
88                'disabled'     => $disabled,
89                'style'        => \@style,
90                'same_checked' => $opt{'same_checked'},
91                'geocode'      => $opt{'geocode'},
92                'censustract'  => $opt{'censustract'},
93   &>
94 </%def>
95
96 <%def phones>
97   <& /elements/tr-cust_main-phones.html,
98        'prefix'       => $pre,
99        'cust_main'    => $cust_main,
100        'onchange'     => $onchange,
101        'disabled'     => $disabled,
102        'style'        => $style,
103   &>
104 </%def>
105
106 <%def fax>
107   <TR>
108     <TD ALIGN="right"><% mt('Fax') |h %></TD>
109     <TD COLSPAN=5>
110       <INPUT TYPE="text" NAME="<%$pre%>fax" VALUE="<% $cust_main->get($pre.'fax') %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
111     </TD>
112   </TR>
113 </%def>
114
115 <%once>
116
117 my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
118
119 </%once>
120 <%shared>
121
122 my( %opt, $cust_main, $pre, $onchange, $disabled, @style, $style );
123
124 </%shared>
125 <%init>
126
127 %opt = @_;
128 $cust_main = $opt{'cust_main'};
129 $pre       = $opt{'pre'};
130 $onchange  = $opt{'onchange'};
131 $disabled  = $opt{'disabled'};
132 @style     = ( $opt{'style'} ? @{ $opt{'style'} } : () );
133
134 $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
135
136 my $conf = new FS::Conf;
137
138 foreach (qw(ss stateid)) {
139   $opt{$_} = $cust_main->masked($_) unless exists $opt{$_};
140 }
141
142 #false laziness with ship state
143 my $countrydefault = $conf->config('countrydefault') || 'US';
144 $cust_main->set($pre.'country', $countrydefault )
145   unless $cust_main->get($pre.'country');
146
147 my $statedefault = $conf->config('statedefault')
148                    || ($countrydefault eq 'US' ? 'CA' : '');
149 $cust_main->set($pre.'state', $statedefault )
150   unless $cust_main->get($pre.'state')
151          || $cust_main->get($pre.'country') ne $countrydefault;
152
153 $cust_main->set('stateid_state', $cust_main->state )
154   unless $pre || $cust_main->get('stateid_state');
155
156 $opt{geocode} ||= $cust_main->get('geocode');
157
158 $opt{censustract} ||= $cust_main->censustract;
159
160 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
161                   ? 'Driver&rsquo;s License'
162                   : FS::Msgcat::_gettext('stateid') || 'Driver&rsquo;s License';
163 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
164                         ? 'Driver&rsquo;s License State'
165                         : FS::Msgcat::_gettext('stateid_state') || 'Driver&rsquo;s License State';
166
167 my @invoicing_list = $cust_main->invoicing_list;
168
169 my $agentnum = $cust_main->agentnum if $cust_main->custnum;
170
171 </%init>