2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
26 {* This file builds html for address block inline edit *}
27 {$form.oplock_ts.html}
28 <table class="form-layout crm-edit-address-form crm-inline-edit-form">
31 <div class="crm-submit-buttons">
32 {include file="CRM/common/formButtons.tpl"}
34
35 <a class="button delete-button" href="#" style="display:inline-block;float:none;"><div class="icon delete-icon"></div> {ts}Delete{/ts}</a>
42 <span class="crm-address-element location_type_id-address-element">
43 {$form.address.$blockId.location_type_id.label} {$form.address.$blockId.location_type_id.html}
49 <span class="crm-address-element is_primary-address-element">{$form.address.$blockId.is_primary.html}</span>
50 <span class="crm-address-element is_billing-address-element">{$form.address.$blockId.is_billing.html}</span>
54 {* include shared address template *}
55 {include file="CRM/Contact/Form/ShareAddress.tpl"}
59 <table id="address_table_{$blockId}" class="form-layout-compressed">
60 {* build address block w/ address sequence. *}
61 {foreach item=addressElement from=$addressSequence}
62 {include file=CRM/Contact/Form/Edit/Address/$addressElement.tpl}
64 {include file=CRM/Contact/Form/Edit/Address/geo_code.tpl}
70 <div class="crm-edit-address-custom_data crm-inline-edit-form crm-address-custom-set-block-{$blockId}">
71 {include file="CRM/Contact/Form/Edit/Address/CustomData.tpl"}
74 <script type="text/javascript">
75 {/literal}{* // Enforce unique location_type_id fields *}{literal}
76 cj('#address_{/literal}{$blockId}{literal}_location_type_id').change(function() {
79 var container = ele.closest('div.crm-inline-edit.address');
80 container.data('location-type-id', '');
83 cj('.crm-inline-edit.address').each(function() {
84 if (ok && cj(this).data('location-type-id') == lt) {
85 var label = cj('option:selected', ele).text();
87 ele.crmError(label + "{/literal} {ts escape='js'}has already been assigned to another address. Please select another location for this address.{/ts}"{literal});
92 container.data('location-type-id', lt);
96 {/literal}{* // Enforce unique is_primary fields *}{literal}
97 cj(':checkbox[id*="[is_primary"]', 'form#Address_{/literal}{$blockId}{literal}').change(function() {
98 if (this.defaultChecked) {
99 cj(this).crmError("{/literal} {ts escape='js'}Please choose another address to be primary before changing this one.{/ts}{literal}");
100 cj(this).prop('checked', true);
103 {/literal}{* // Reset location_type_id when cancel button pressed *}{literal}
104 cj(':submit[name$=cancel]', 'form#Address_{/literal}{$blockId}{literal}').click(function() {
105 var container = cj(this).closest('div.crm-inline-edit.address');
106 var origValue = container.attr('data-location-type-id') || '';
107 container.data('location-type-id', origValue);
110 {if $masterAddress.$blockId}
111 CRM.alert('{ts escape="js" 1=$masterAddress.$blockId}This address is shared with %1 contact record(s). Modifying this address will automatically update the shared address for these contacts.{/ts}', '{ts escape="js"}Editing Master Address{/ts}', 'info', {ldelim}expires: 0{rdelim});