removing 17 year old obsolete file
[freeside.git] / httemplate / edit / cust_main / contact.html
index d93d417..c2ebb09 100644 (file)
-<% &ntable("#cccccc") %>
+<TABLE CLASS="fsinnerbox">
 
 <TR>
-  <TH ALIGN="right"><%$r%>Contact&nbsp;name<BR>(last,&nbsp;first)</TH>
-  <TD COLSPAN=5>
-    <INPUT TYPE="text" NAME="<%$pre%>last" VALUE="<% $cust_main->get($pre.'last') %>" onChange="<% $onchange %>" <%$disabled%>> , 
-    <INPUT TYPE="text" NAME="<%$pre%>first" VALUE="<% $cust_main->get($pre.'first') %>" onChange="<% $onchange %>" <%$disabled%>>
+  <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">SS#</TD>
+  <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>
-
-<TR>
-  <TD ALIGN="right">Company</TD>
-  <TD COLSPAN=7>
-    <INPUT TYPE="text" NAME="<%$pre%>company" VALUE="<% $cust_main->get($pre.'company') %>" SIZE=70 onChange="<% $onchange %>" <%$disabled%>>
-  </TD>
 </TR>
 
-<TR>
-  <TH ALIGN="right"><%$r%>Address</TH>
-  <TD COLSPAN=7>
-    <INPUT TYPE="text" NAME="<%$pre%>address1" VALUE="<% $cust_main->get($pre.'address1') %>" SIZE=70 onChange="<% $onchange %>" <%$disabled%>>
-  </TD>
-</TR>
-
-% my $address2_label_style =
-%   ( $disabled
-%     || ! $conf->exists('cust_main-require_address2')
-%     || ( !$pre && !$opt{'same_checked'} )
-%   )
-%     ? 'visibility:hidden'
-%     : '';
-
-<TR>
-  <TD ALIGN="right"><FONT ID="<% $pre %>address2_required" color="#ff0000" STYLE="<% $address2_label_style %>">*</FONT>&nbsp;<FONT ID="<% $pre %>address2_label" STYLE="<% $address2_label_style %>"><B>Unit&nbsp;#</B></FONT></TD>
-  <TD COLSPAN=7>
-    <INPUT TYPE="text" NAME="<%$pre%>address2" VALUE="<% $cust_main->get($pre.'address2') %>" SIZE=70 onChange="<% $onchange %>" <%$disabled%>>
-  </TD>
-</TR>
-
-<TR>
-  <TH ALIGN="right"><%$r%>City</TH>
-  <TD>
-    <INPUT TYPE="text" NAME="<%$pre%>city" VALUE="<% $cust_main->get($pre.'city') %>" onChange="<% $onchange %>" <%$disabled%>>
-  </TD>
-  <TH ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</TH>
-  <TD>
-    <% include('/elements/select-county.html', %select_hash ) %>
-  </TD>
-  <TH ALIGN="right"><%$r%>State</TH>
-  <TD>
-    <% include('/elements/select-state.html', %select_hash ) %>
-  </TD>
-  <TH><%$r%>Zip</TH>
-  <TD>
-    <INPUT TYPE="text" NAME="<%$pre%>zip" VALUE="<% $cust_main->get($pre.'zip') %>" SIZE=10 onChange="<% $onchange %>" <%$disabled%>>
-  </TD>
-</TR>
+% if ( $conf->exists('cust-email-high-visibility') && !$pre ) {
+    <TR>
+      <TD ALIGN="right" WIDTH="200">
+        <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum) 
+          ? $r : '' %>Email address(es)
+      </TD>
+      <TD bgcolor="#FFFF00">
+        <INPUT TYPE="text" NAME="invoicing_list" VALUE="<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) %>">
+      </TD>
+    </TR>
+% }
 
-<TR>
-  <TH ALIGN="right"><%$r%>Country</TH>
-  <TD COLSPAN=5><% include('/elements/select-country.html', %select_hash ) %></TD>
-% if ( !$pre ) { 
-  <TD><INPUT TYPE="hidden" NAME="geocode" VALUE="<% $opt{geocode} %>"></TD>
-% } 
+% unless ( $conf->exists('cust-edit-alt-field-order') ) { #standard order
 
-</TR>
+  <& company &>
+  <& location &>
+  <& phones &>
+  <& fax &>
 
-<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%>>
-  </TD>
-</TR>
+% } else { #alternate field order
 
-<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%>>
-  </TD>
-</TR>
+  <& phones &>
+  <& location &>
+  <& fax &>
+  <& company &>
 
-<TR>
-  <TD ALIGN="right">Fax</TD>
-  <TD COLSPAN=5>
-    <INPUT TYPE="text" NAME="<%$pre%>fax" VALUE="<% $cust_main->get($pre.'fax') %>" SIZE=12 onChange="<% $onchange %>" <%$disabled%>>
-  </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%>></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><% include('/elements/select-state.html',
+  <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 ) { 
 % } 
 
 </TABLE>
-<%$r%>required fields<BR>
+<%$r%><% mt('required fields') |h %><BR>
+
+<%def company>
+% my $display = ($cust_main->residential_commercial eq 'Commercial')
+%                 ? '' : 'none';
+  <TR ID="<%$pre%>company_row" STYLE="display:<%$display%>">
+    <TD ALIGN="right"><% mt('Company') |h %></TD>
+    <TD COLSPAN=7>
+      <INPUT TYPE="text" NAME="<%$pre%>company" ID="<%$pre%>company" VALUE="<% $cust_main->get($pre.'company') |h %>" SIZE=60 onChange="<% $onchange %>" <%$disabled%> <%$style%>>
+    </TD>
+  </TR>
+</%def>
+
+<%def location>
+  <& /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'},
+  &>
+</%def>
+
+<%def phones>
+  <& /elements/tr-cust_main-phones.html,
+       'prefix'       => $pre,
+       'cust_main'    => $cust_main,
+       'onchange'     => $onchange,
+       'disabled'     => $disabled,
+       'style'        => $style,
+  &>
+</%def>
+
+<%def fax>
+  <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>
+</%def>
+
+<%once>
+
+my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
+
+</%once>
+<%shared>
+
+my( %opt, $cust_main, $pre, $onchange, $disabled, @style, $style );
 
+</%shared>
 <%init>
 
-#my( $cust_main, $pre, $onchange, $disabled, %opt ) = @_;
-my %opt = @_;
-my $cust_main = $opt{'cust_main'};
-my $pre       = $opt{'pre'};
-my $onchange  = $opt{'onchange'};
-my $disabled  = $opt{'disabled'};
+%opt = @_;
+$cust_main = $opt{'cust_main'};
+$pre       = $opt{'pre'};
+$onchange  = $opt{'onchange'};
+$disabled  = $opt{'disabled'};
+@style     = ( $opt{'style'} ? @{ $opt{'style'} } : () );
+
+$style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : '';
 
 my $conf = new FS::Conf;
 
@@ -150,35 +153,10 @@ $cust_main->set($pre.'state', $statedefault )
 $cust_main->set('stateid_state', $cust_main->state )
   unless $pre || $cust_main->get('stateid_state');
 
-#my($county_html, $state_html, $country_html) =
-#  FS::cust_main_county::regionselector( $cust_main->get($pre.'county'),
-#                                        $cust_main->get($pre.'state'),
-#                                        $cust_main->get($pre.'country'),
-#                                        $pre,
-#                                        $onchange,
-#                                        $disabled,
-#                                      );
-
-my %select_hash = (
-  'county'   => $cust_main->get($pre.'county'),
-  'state'    => $cust_main->get($pre.'state'),
-  'country'  => $cust_main->get($pre.'country'),
-  'prefix'   => $pre,
-  'onchange' => $onchange,
-  'disabled' => $disabled,
-);
-
-my @counties = counties( $cust_main->get($pre.'state'),
-                         $cust_main->get($pre.'country'),
-                       );
-my $county_style = scalar(@counties) > 1 ? '' : 'STYLE="visibility:hidden"';
-
-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';
+$opt{geocode} ||= $cust_main->get('geocode');
+
+$opt{censustract} ||= $cust_main->censustract;
+
 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
                   ? 'Driver&rsquo;s License'
                   : FS::Msgcat::_gettext('stateid') || 'Driver&rsquo;s License';
@@ -186,6 +164,8 @@ my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_st
                         ? 'Driver&rsquo;s License State'
                         : FS::Msgcat::_gettext('stateid_state') || 'Driver&rsquo;s License State';
 
-my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
+my @invoicing_list = $cust_main->invoicing_list;
+
+my $agentnum = $cust_main->agentnum if $cust_main->custnum;
 
 </%init>