2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
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 provides the HTML for the on-behalf-of form. Can also be used for related contact edit form. *}
27 <fieldset id="for_organization" class="for_organization-group">
28 <legend>{$fieldSetTitle}</legend>
29 {if $contact_type eq 'Individual'}
31 {if $contactEditMode}<fieldset><legend></legend>{/if}
32 <table class="form-layout-compressed">
34 <td>{$form.prefix_id.label}</td>
35 <td>{$form.first_name.label}</td>
36 <td>{$form.middle_name.label}</td>
37 <td>{$form.last_name.label}</td>
38 <td>{$form.suffix_id.label}</td>
41 <td>{$form.prefix_id.html}</td>
42 <td>{$form.first_name.html}</td>
43 <td>{$form.middle_name.html|crmAddClass:eight}</td>
44 <td>{$form.last_name.html}</td>
45 <td>{$form.suffix_id.html}</td>
49 {if $contactEditMode}</fieldset>{/if}
52 {elseif $contact_type eq 'Household'}
54 {if $contactEditMode}<fieldset><legend></legend>{/if}
55 <table class="form-layout-compressed">
57 <td>{$form.household_name.label}</td>
60 <td>{$form.household_name.html|crmAddClass:big}</td>
63 {if $contactEditMode}</fieldset>{/if}
66 {elseif $contact_type eq 'Organization'}
69 <fieldset><legend></legend>
71 <div class="crm-section organizationName-section">
72 {if $relatedOrganizationFound}
73 <div class="section crm-section">
74 <div class="content">{$form.org_option.html}</div>
76 <div id="select_org" class="crm-section select_org-section">
77 <div class="label">{$form.organization_name.label}</div>
78 <div class="content">{$form.organization_id.html|crmAddClass:big}</div>
81 <div id="create_org" class="crm-section create_org-section">
82 <div class="label">{$form.organization_name.label}</div>
83 <div class="content">{$form.organization_name.html|crmAddClass:big}</div>
84 <div class="clear"></div>
93 {* Display the address block *}
94 {assign var=index value=1}
97 <fieldset><legend>{ts}Phone and Email{/ts}</legend>
98 <table class="form-layout-compressed">
100 <td class='label' width="25%">{$form.phone.$index.phone.label}</td>
101 <td class='value'>{$form.phone.$index.phone.html}</td>
104 <td class='label'>{$form.email.$index.email.label}</td>
105 <td class='value'>{$form.email.$index.email.html}</td>
111 {if $contactEditMode}<fieldset><legend>{ts}Address{/ts}</legend>{/if}
112 <div class="crm-section address-section">
113 {if !$contactEditMode}
114 <div class="crm-section {$form.phone.$index.phone.id}-section">
115 <div class="label">{$form.phone.$index.phone.label}</div>
116 <div class="content">{$form.phone.$index.phone.html}</div>
117 <div class="clear"></div>
119 <div class="crm-section {$form.email.$index.email.id}-section">
120 <div class="label">{$form.email.$index.email.label}</div>
121 <div class="content">{$form.email.$index.email.html}</div>
122 <div class="clear"></div>
125 {if $addressSequence.street_address}
126 <div class="crm-section {$form.address.$index.street_address.id}-section">
127 <div class="label">{$form.address.$index.street_address.label}</div>
128 <div class="content">{$form.address.$index.street_address.html}
130 <span class="description">{ts}Street number, street name, apartment/unit/suite - OR P.O. box{/ts}</span>
132 <div class="clear"></div>
135 {if $addressSequence.supplemental_address_1}
136 <div class="crm-section {$form.address.$index.supplemental_address_1.id}-section">
137 <div class="label">{$form.address.$index.supplemental_address_1.label}</div>
138 <div class="content">{$form.address.$index.supplemental_address_1.html}
140 <span class="description">{ts}Supplemental address info, e.g. c/o, department name, building name, etc.{/ts}</span>
142 <div class="clear"></div>
145 {if $addressSequence.supplemental_address_2}
146 <div class="crm-section {$form.address.$index.supplemental_address_2.id}-section">
147 <div class="label">{$form.address.$index.supplemental_address_2.label}</div>
148 <div class="content">{$form.address.$index.supplemental_address_2.html}</div>
149 <div class="clear"></div>
152 {if $addressSequence.city}
153 <div class="crm-section {$form.address.$index.city.id}<-section">
154 <div class="label">{$form.address.$index.city.label}</div>
155 <div class="content">{$form.address.$index.city.html}</div>
156 <div class="clear"></div>
159 {if $addressSequence.postal_code}
160 <div class="crm-section {$form.address.$index.postal_code.id}-section">
161 <div class="label">{$form.address.$index.postal_code.label}</div>
162 <div class="content">{$form.address.$index.postal_code.html}
163 {if $form.address.$index.postal_code_suffix.html}
164 - {$form.address.$index.postal_code_suffix.html}
166 <span class="description">{ts}Enter optional 'add-on' code after the dash ('plus 4' code for U.S. addresses).{/ts}</span>
169 <div class="clear"></div>
172 {if $addressSequence.country}
173 <div class="crm-section {$form.address.$index.country_id.id}-section">
174 <div class="label">{$form.address.$index.country_id.label}</div>
175 <div class="content">{$form.address.$index.country_id.html}</div>
176 <div class="clear"></div>
179 {if $addressSequence.state_province}
180 <div class="crm-section {$form.address.$index.state_province_id.id}-section">
181 <div class="label">{$form.address.$index.state_province_id.label}</div>
182 <div class="content">{$form.address.$index.state_province_id.html}</div>
183 <div class="clear"></div>
186 {if $contactEditMode and $form.location.$index.address.geo_code_1.label}
187 <div class="crm-section {$form.address.$index.geo_code_1.id}-{$form.address.$index.geo_code_2.id}-section">
188 <div class="label">{$form.address.$index.geo_code_1.label}, {$form.address.$index.geo_code_2.label}</div>
189 <div class="content">{$form.address.$index.geo_code_1.html}, {$form.address.$index.geo_code_2.html}
191 <span class="description">
192 {ts}Latitude and longitude may be automatically populated by enabling a Mapping Provider.{/ts} {docURL page="user/initial-set-up/installation-and-basic-setup" text="(Refer to the Mapping and Geocoding section in the Installation and Basic Setup Chapter)"}</span>
194 <div class="clear"></div>
199 {if $contactEditMode}</fieldset>{/if}
203 {if $form.is_for_organization}
204 {include file="CRM/common/showHideByFieldValue.tpl"
205 trigger_field_id ="is_for_organization"
206 trigger_value ="true"
207 target_element_id ="for_organization"
208 target_element_type ="block"
214 {if $relatedOrganizationFound}
215 {include file="CRM/common/showHideByFieldValue.tpl"
216 trigger_field_id ="org_option"
217 trigger_value ="true"
218 target_element_id ="select_org"
219 target_element_type ="table-row"
223 {include file="CRM/common/showHideByFieldValue.tpl"
224 trigger_field_id ="org_option"
225 trigger_value ="true"
226 target_element_id ="create_org"
227 target_element_type ="table-row"
234 <script type="text/javascript">
236 {* If mid present in the url, take the required action (poping up related existing contact ..etc) *}
237 {if $membershipContactID}
240 cj( '#organization_id' ).val("{/literal}{$membershipContactName}{literal}");
241 cj( '#organization_name' ).val("{/literal}{$membershipContactName}{literal}");
242 cj( '#onbehalfof_id' ).val("{/literal}{$membershipContactID}{literal}");
243 setLocationDetails( "{/literal}{$membershipContactID}{literal}" );
247 {* Javascript method to populate the location fields when a different existing related contact is selected *}
249 var dataUrl = "{/literal}{$employerDataURL}{literal}";
250 cj('#organization_id').autocomplete( dataUrl, { width : 180, selectFirst : false, matchContains: true, max: {/literal}{crmSetting name="search_autocomplete_count" group="Search Preferences"}{literal}
251 }).result( function(event, data, formatted) {
252 cj('#organization_name').val( data[0] );
253 cj('#onbehalfof_id').val( data[1] );
254 setLocationDetails( data[1] );
257 var orgId = {/literal}"{$orgId}"{literal};
259 setLocationDetails( orgId );
262 function setLocationDetails( contactID ) {
263 var locationUrl = {/literal}"{$locDataURL}"{literal}+ contactID + "&relContact=1";
268 timeout : 5000, //Time in milliseconds
269 success : function( data, status ) {
270 for (var ele in data) {
271 cj( "#"+ele ).val( data[ele] );
274 error : function( XMLHttpRequest, textStatus, errorThrown ) {
275 console.error("HTTP error status: ", textStatus);