quick payment tool improvements, RT10698
[freeside.git] / httemplate / elements / location.html
index 07aaa69..b5f7640 100644 (file)
@@ -18,7 +18,7 @@ Example:
 </%doc>
 
 <TR>
-  <TH ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %></TH>
+  <<%$th%> ALIGN="right"><%$r%><% $opt{'address1_label'} || 'Address' %></<%$th%>>
   <TD COLSPAN=7>
     <INPUT TYPE     = "text"
            NAME     = "<%$pre%>address1"
@@ -31,41 +31,71 @@ Example:
     >
   </TD>
 </TR>
+<TR>
+      <TD ALIGN="right"><FONT ID="<% $pre %>address2_required" color="#ff0000" <% $address2_label_style %>>*</FONT>&nbsp;<FONT ID="<% $pre %>address2_label" <% $address2_label_style %>><B>Unit&nbsp;#</B></FONT></TD>
+      <TD COLSPAN=7>
+       <INPUT TYPE     = "text"
+              NAME     = "<%$pre%>address2"
+              ID       = "<%$pre%>address2"
+              VALUE    = "<% $object->get($pre.'address2') |h %>"
+              SIZE     = 54
+              onChange = "<% $onchange %>"
+              <% $disabled %>
+              <% $style %>
+       >
+      </TD>
+</TR>
+
 
+% if ( $opt{'alt_format'} ) { 
 <TR>
-  <TD ALIGN="right"><FONT ID="<% $pre %>address2_required" color="#ff0000" <% $address2_label_style %>>*</FONT>&nbsp;<FONT ID="<% $pre %>address2_label" <% $address2_label_style %>><B>Unit&nbsp;#</B></FONT></TD>
-  <TD COLSPAN=7>
-    <INPUT TYPE     = "text"
-           NAME     = "<%$pre%>address2"
-           ID       = "<%$pre%>address2"
-           VALUE    = "<% $object->get($pre.'address2') |h %>"
-           SIZE     = 54
-           onChange = "<% $onchange %>"
-           <% $disabled %>
-           <% $style %>
-    >
-  </TD>
+    <<%$th%> ALIGN="right">Location Type</<%$th%>>
+    <TD><INPUT         TYPE="text" 
+               NAME="location_type" 
+               ID="location_type"
+               VALUE="<% $object->get('location_type') |h %>"
+               SIZE="10"
+              <% $disabled %>
+              <% $style %>
+       >
+    </TD>
+    <TD></TD>
+    <<%$th%> ALIGN="right">Number</<%$th%>>
+    <TD><INPUT TYPE="text" 
+               NAME="location_number"
+               ID="location_number"
+               VALUE="<% $object->get('location_number') |h %>"
+               SIZE="5"
+              <% $disabled %>
+              <% $style %>
+       >
+    </TD>
+    <<%$th%> ALIGN="right">Kind</<%$th%>>
+    <TD>
+    <% include('/elements/select.html',
+             'cgi'       => $cgi,
+            'field'    => 'location_kind',
+            'disabled' => $disabled,
+            'style' => $style, 
+            'options'  => \@location_kind_options,
+            'labels'   => $location_kind_labels,
+            'curr_value' => $cgi->param('location_kind'),
+         )
+    %>
+    </TD>
 </TR>
+% } 
 
 <TR>
-  <TH ALIGN="right"><%$r%>City</TH>
-  <TD WIDTH="1">
-    <INPUT TYPE     = "text"
-           NAME     = "<%$pre%>city"
-           ID       = "<%$pre%>city"
-           VALUE    = "<% $object->get($pre.'city') |h %>"
-           onChange = "<% $onchange %>"
-           <% $disabled %>
-           <% $style %>
-    >
-  </TD>
-  <TH ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</TH>
+  <<%$th%> ALIGN="right"><%$r%>City</<%$th%>>
+  <TD WIDTH="1"><% include('/elements/city.html', %select_hash) %></TD>
+  <<%$th%> ALIGN="right" ID="<%$pre%>countylabel" <%$county_style%>><%$r%>County</<%$th%>>
   <TD><% include('/elements/select-county.html', %select_hash ) %></TD>
-  <TH ALIGN="right" WIDTH="1"><%$r%>State</TH>
+  <<%$th%> ALIGN="right" WIDTH="1"><%$r%>State</<%$th%>>
   <TD WIDTH="1">
     <% include('/elements/select-state.html', %select_hash ) %>
   </TD>
-  <TH><%$r%>Zip</TH>
+  <<%$th%>><%$r%>Zip</<%$th%>>
   <TD>
     <INPUT TYPE     = "text"
            NAME     = "<%$pre%>zip"
@@ -80,7 +110,7 @@ Example:
 </TR>
 
 <TR>
-  <TH ALIGN="right"><%$r%>Country</TH>
+  <<%$th%> ALIGN="right"><%$r%>Country</<%$th%>>
   <TD COLSPAN=6><% include('/elements/select-country.html', %select_hash ) %></TD>
 </TR>
 
@@ -88,7 +118,7 @@ Example:
   <INPUT TYPE="hidden" NAME="geocode" VALUE="<% $opt{geocode} %>">
 % } else {
 %   if ( $pre eq 'ship_' && $conf->exists('cust_main-require_censustract') ) {
-      <TR><TH ALIGN="right">Census tract<BR>(automatic)</TH>
+      <TR><<%$th%> ALIGN="right">Census tract<BR>(automatic)</<%$th%>>
         <TD>
           <INPUT TYPE="text" NAME="censustract" VALUE="<% $opt{censustract} %>">
         </TD>
@@ -123,7 +153,7 @@ $object->set($pre.'state', $statedefault )
          || $object->get($pre.'country') ne $countrydefault;
 
 my @style = ();
-push @style, 'background-color: #dddddd"' if $disabled;
+push @style, 'background-color: #dddddd' if $disabled;
 
 my @address2_label_style = ();
 push @address2_label_style, 'visibility:hidden'
@@ -152,6 +182,7 @@ my $county_style =
     : '';
 
 my %select_hash = (
+  'city'     => $object->get($pre.'city'),
   'county'   => $object->get($pre.'county'),
   'state'    => $object->get($pre.'state'),
   'country'  => $object->get($pre.'country'),
@@ -161,4 +192,9 @@ my %select_hash = (
   'style'    => \@style,
 );
 
+my $th = $opt{'no_bold'} ? 'TD' : 'TH';
+
+my @location_kind_options = ( '', 'R', 'B' );
+my $location_kind_labels = { '' => '', 'R' => 'Residential', 'B' => 'Business' };
+
 </%init>