+--------------------------------------------------------------------+
*}
<div id="location" class="form-item">
- <table class="form-layout">
- <tr>
- <td>
- {$form.location_type.label}<br />
- {$form.location_type.html}
- <div class="description" >
- {ts}Location search uses the PRIMARY location for each contact by default.{/ts}<br />
- {ts}To search by specific location types (e.g. Home, Work...), check one or more boxes above.{/ts}
- </div>
- </td>
- <td colspan="2">
- <div id="streetAddress">
- {$form.street_address.label}<br />
- {$form.street_address.html|crmAddClass:big}
-{if $parseStreetAddress}
- <br /><a href="#" title="{ts}Use Address Elements{/ts}" onClick="processAddressFields( 'addressElements' , 1 );return false;">{ts}Use Address Elements{/ts}</a>
- </div>
- <div id="addressElements" class=hiddenElement>
- <table class="crm-block crm-form-block advanced-search-address-elements">
- <tr><td>{$form.street_number.label}<br />{$form.street_number.html}<br /><span class="description nowrap">{ts}or ODD / EVEN{/ts}</td>
+ <table class="form-layout">
+ <tr>
+ <td>
+ {$form.location_type.label}<br />
+ {$form.location_type.html}
+ <div class="description" >
+ {ts}Location search uses the PRIMARY location for each contact by default.{/ts}<br />
+ {ts}To search by specific location types (e.g. Home, Work...), check one or more boxes above.{/ts}
+ </div>
+ </td>
+ <td colspan="2">
+ <div id="streetAddress">
+ {$form.street_address.label}<br />
+ {$form.street_address.html|crmAddClass:big}
+ {if $parseStreetAddress}
+ <br /><a href="#" title="{ts}Use Address Elements{/ts}" onClick="processAddressFields( 'addressElements' , 1 );return false;">{ts}Use Address Elements{/ts}</a>
+ </div>
+ <div id="addressElements" class=hiddenElement>
+ <table class="crm-block crm-form-block advanced-search-address-elements">
+ <tr><td>{$form.street_number.label}<br />{$form.street_number.html}<br /><span class="description nowrap">{ts}or ODD / EVEN{/ts}</td>
<td>{$form.street_name.label}<br />{$form.street_name.html}</td>
<td>{$form.street_unit.label}<br />{$form.street_unit.html|crmAddClass:four}</td>
- </tr>
- <tr>
- <td colspan="3"><a href="#" title="{ts}Use Complete Address{/ts}" onClick="processAddressFields( 'streetAddress', 1 );return false;">{ts}Use Street Address{/ts}</a></td>
</tr>
- </table>
- </div>
-{/if}
- <br />
- {$form.city.label}<br />
- {$form.city.html}
- </td>
+ <tr>
+ <td colspan="3"><a href="#" title="{ts}Use Complete Address{/ts}" onClick="processAddressFields( 'streetAddress', 1 );return false;">{ts}Use Street Address{/ts}</a></td>
+ </tr>
+ </table>
+ </div>
+ {/if}
+ <br />
+ {$form.city.label}<br />
+ {$form.city.html}
+ </td>
</tr>
<tr>
- <td>
- {if $form.postal_code.html}
- <table class="inner-table">
- <tr>
<td>
- {$form.postal_code.label}<br />
- {$form.postal_code.html}
- </td>
- <td>
-
- <label>{ts}OR{/ts}</label>
-
- </td>
- <td><label>{ts}Postal Code{/ts}</label>
- {$form.postal_code_low.label|replace:'-':'<br />'}
- {$form.postal_code_low.html|crmAddClass:six}
- {$form.postal_code_high.label}
- {$form.postal_code_high.html|crmAddClass:six}
- </td>
- </tr>
- <tr>
- <td colspan="2"> </td>
- <td>{$form.prox_distance.label}<br />{$form.prox_distance.html} {$form.prox_distance_unit.html}</td>
- </tr>
- <tr>
- <td colspan="2">{$form.address_name.label}<br />
- {$form.address_name.html|crmAddClass:medium}
- </td>
- <td>{$form.world_region.label}<br />
- {$form.world_region.html}
- </td>
- </tr>
- <tr>
- <td colspan="2">{$form.county.label}<br />
- {$form.county.html}
+ {if $form.postal_code.html}
+ <table class="inner-table">
+ <tr>
+ <td>
+ {$form.postal_code.label}<br />
+ {$form.postal_code.html}
+ </td>
+ <td>
+
+ <label>{ts}OR{/ts}</label>
+
+ </td>
+ <td><label>{ts}Postal Code{/ts}</label>
+ {$form.postal_code_low.label|replace:'-':'<br />'}
+ {$form.postal_code_low.html|crmAddClass:six}
+ {$form.postal_code_high.label}
+ {$form.postal_code_high.html|crmAddClass:six}
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2"> </td>
+ <td>{$form.prox_distance.label}<br />{$form.prox_distance.html} {$form.prox_distance_unit.html}</td>
+ </tr>
+ <tr>
+ <td colspan="2">{$form.address_name.label}<br />
+ {$form.address_name.html|crmAddClass:medium}
+ </td>
+ <td>{$form.world_region.label}<br />
+ {$form.world_region.html}
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">{$form.county.label}<br />
+ {$form.county.html}
+ </td>
+ <td>{$form.country.label}<br />
+ {$form.country.html}
+ </td>
+ </tr>
+ </table>
+ {/if}
</td>
- <td>{$form.country.label}<br />
- {$form.country.html}
+ <td>{$form.state_province.label}<br />
+ {$form.state_province.html}
</td>
- </tr>
- </table>
- {/if}
- </td>
- <td>{$form.state_province.label}<br />
- {$form.state_province.html}
- </td>
</tr>
{if $addressGroupTree}
- <tr>
- <td colspan="2">
+ <tr>
+ <td colspan="2">
{include file="CRM/Custom/Form/Search.tpl" groupTree=$addressGroupTree showHideLinks=false}
- </td>
- </tr>
+ </td>
+ </tr>
{/if}
- </table>
+ </table>
</div>
{if $parseStreetAddress eq 1}
-{literal}
-<script type="text/javascript">
-function processAddressFields( name, loadData ) {
- if ( name == 'addressElements' ) {
- if ( loadData ) {
- cj( '#street_address' ).val( '' );
- }
+ {literal}
+ <script type="text/javascript">
+ function processAddressFields(name, loadData) {
+ if (name == 'addressElements') {
+ if (loadData) {
+ cj('#street_address').val('');
+ }
- cj('#addressElements').show();
- cj('#streetAddress').hide();
- } else {
- if ( loadData ) {
- cj( '#street_name' ).val( '' );
- cj( '#street_unit' ).val( '' );
- cj( '#street_number' ).val( '' );
- }
+ cj('#addressElements').show();
+ cj('#streetAddress').hide();
+ } else {
+ if (loadData) {
+ cj('#street_name, #street_unit, #street_number').val('');
+ }
- cj('#streetAddress').show();
- cj('#addressElements').hide();
- }
+ cj('#streetAddress').show();
+ cj('#addressElements').hide();
+ }
-}
+ }
-CRM.$(function($) {
- if ( $('#street_name').val( ).length > 0 ||
- $('#street_unit').val( ).length > 0 ||
- $('#street_number').val( ).length > 0 ) {
- processAddressFields( 'addressElements', 1 );
- }
-}
-);
+ CRM.$(function($) {
+ if ($('#street_name').val().length > 0 ||
+ $('#street_unit').val().length > 0 ||
+ $('#street_number').val().length > 0) {
+ processAddressFields('addressElements', 1);
+ }
+ }
+ );
-</script>
-{/literal}
+ </script>
+ {/literal}
{/if}