2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 <div class="crm-profile-name-{$ufGroupName}">
27 {crmRegion name=profile-form-`$ufGroupName`}
29 {* Profile forms when embedded in CMS account create (mode=1) or
30 cms account edit (mode=8) or civicrm/profile (mode=4) pages *}
31 {if ($context eq 'multiProfileDialog')}
33 <script type="text/javascript">
35 $('#profile-dialog .crm-container-snippet #Edit').validate(CRM.validate.params);
37 success: checkResponse // post-submit callback
40 //binding the callback to snippet profile form
41 $('.crm-container-snippet #Edit').ajaxForm(formOptions);
44 // post-submit callback
45 function checkResponse(responseText, statusText, xhr, $form) {
46 //if there is any form error show the dialog
47 //else redirect to post url
48 if (!cj(responseText).find('.crm-error').html()) {
49 window.location.href = '{/literal}{$postUrl}{literal}';
54 {include file="CRM/Form/validate.tpl"}
57 <div class="messages status no-popup">
58 <div class="icon inform-icon"></div>
59 {ts}Are you sure you want to delete this record?{/ts}
61 <span class="crm-button">{$form._qf_Edit_upload_delete.html}</span>
62 <div class="crm-submit-buttons" style='display:inline'>{include file="CRM/common/formButtons.tpl"}</div>
64 {if ! empty( $fields )}
65 {* Wrap in crm-container div so crm styles are used.*}
66 {* Replace div id "crm-container" only when profile is not loaded in civicrm container, i.e for profile shown in my account and in profile standalone mode otherwise id should be "crm-profile-block" *}
68 {if $action eq 1 or $action eq 2 or $action eq 4 }
69 <div id="crm-profile-block" class="crm-container-snippet crm-public">
71 <div id="crm-container" class="crm-container crm-public" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">
74 {if $isDuplicate and ( ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192) ) }
75 <div class="crm-submit-buttons">
76 <span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>
79 {if $mode eq 1 || $activeComponent neq "CiviCRM"}
80 {include file="CRM/Form/body.tpl"}
83 {if $help_pre && $action neq 4}
84 <div class="messages help">{$help_pre}</div>
87 {include file="CRM/common/CMSUser.tpl"}
89 {if $action eq 2 and $multiRecordFieldListing}
90 <h1>{ts}Edit Details{/ts}</h1>
91 <div class="crm-submit-buttons" style='float:right'>
92 {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}<span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>{/if}
96 {assign var=zeroField value="Initial Non Existent Fieldset"}
97 {assign var=fieldset value=$zeroField}
98 {foreach from=$fields item=field key=fieldName}
99 {if $field.skipDisplay}
102 {assign var="profileID" value=$field.group_id}
103 {assign var=n value=$field.name}
104 {if $field.groupTitle != $fieldset}
105 {if $mode neq 8 && $mode neq 4}
106 <div {if $context neq 'dialog'}id="profilewrap{$field.group_id}"{/if}>
107 <fieldset><legend>{$field.groupTitle}</legend>
109 {assign var=fieldset value=`$field.groupTitle`}
110 {assign var=groupHelpPost value=`$field.groupHelpPost`}
111 {if $field.groupHelpPre}
112 <div class="messages help">{$field.groupHelpPre}</div>
115 {if $field.field_type eq "Formatting"}
118 {if $field.groupTitle != $fieldset}
119 {if $fieldset != $zeroField}
121 <div class="messages help">{$groupHelpPost}</div>
123 {if $mode neq 8 && $mode neq 4}
124 </div><!-- end form-layout-compressed-div -->
129 <div class="form-layout-compressed">
131 {if $field.help_pre && $action neq 4 && $form.$n.html}
132 <div class="crm-section helprow-{$n}-section" id="helprow-{$n}">
133 <div class="content description">{$field.help_pre}</div>
136 {if $field.options_per_line}
137 <div class="crm-section editrow_{$n}-section form-item" id="editrow-{$n}">
138 <div class="label">{$form.$n.label}</div>
139 <div class="content edit-value">
140 {assign var="count" value="1"}
142 <table class="form-layout-compressed">
144 {* sort by fails for option per line. Added a variable to iterate through the element array*}
145 {assign var="index" value="1"}
146 {foreach name=outer key=key item=item from=$form.$n}
148 {assign var="index" value=`$index+1`}
150 <td class="labels font-light">{$form.$n.$key.html}</td>
151 {if $count == $field.options_per_line}
154 {assign var="count" value="1"}
156 {assign var="count" value=`$count+1`}
164 <div class="clear"></div>
165 </div>{* end of main edit section div*}
167 <div id="editrow-{$n}" class="crm-section editrow_{$n}-section form-item">
171 <div class="edit-value content">
172 {if $n|substr:0:3 eq 'im-'}
173 {assign var="provider" value=$n|cat:"-provider_id"}
174 {$form.$provider.html}
175 {elseif $n|substr:0:4 eq 'url-'}
176 {assign var="websiteType" value=$n|cat:"-website_type_id"}
177 {$form.$websiteType.html}
179 {if $n eq 'email_greeting' or $n eq 'postal_greeting' or $n eq 'addressee'}
180 {include file="CRM/Profile/Form/GreetingType.tpl"}
181 {elseif ( $n eq 'group' && $form.group ) || ( $n eq 'tag' && $form.tag )}
182 {include file="CRM/Contact/Form/Edit/TagsAndGroups.tpl" type=$n context="profile"}
183 {elseif ( $form.$n.name eq 'image_URL' )}
185 {if !empty($imageURL)}
186 <div class="crm-section contact_image-section">
187 <div class="content">
188 {include file="CRM/Contact/Page/ContactImage.tpl"}
192 {elseif $n|substr:0:5 eq 'phone'}
193 {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'}
195 {if $form.$phone_ext_field.html}
196 {$form.$phone_ext_field.html}
199 {if ( $field.data_type eq 'Date' or
200 ( ( ( $n eq 'birth_date' ) or ( $n eq 'deceased_date' ) or ( $n eq 'activity_date_time' ) ) ) ) and $field.is_view neq 1 }
201 {include file="CRM/common/jcalendar.tpl" elementName=$n}
205 {if $field.html_type eq 'Autocomplete-Select'}
206 {if $field.data_type eq 'ContactReference'}
207 {include file="CRM/Custom/Form/ContactReference.tpl" element_name = $n}
212 <div class="clear"></div>
215 {if $form.$n.type eq 'file'}
216 <div class="crm-section file_displayURL-section file_displayURL{$n}-section"><div class="content">{$customFiles.$n.displayURL}</div></div>
217 <div class="crm-section file_deleteURL-section file_deleteURL{$n}-section"><div class="content">{$customFiles.$n.deleteURL}</div></div>
221 {* Show explanatory text for field if not in 'view' mode *}
222 {if $field.help_post && $action neq 4 && $form.$n.html}
223 <div class="crm-section helprow-{$n}-section" id="helprow-{$n}">
224 <div class="content description">{$field.help_post}</div>
227 {/if}{* end of main if field name if *}
230 {if $isCaptcha && ( $mode eq 8 || $mode eq 4 || $mode eq 1 ) }
231 {include file='CRM/common/ReCAPTCHA.tpl'}
232 <script type="text/javascript">cj('.recaptcha_label').attr('width', '140px');</script>
235 {if $field.groupHelpPost}
236 <div class="messages help">{$field.groupHelpPost}</div>
239 {if $mode neq 8 && $mode neq 4}
244 {if ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192)}
245 {if $action eq 2 and $multiRecordFieldListing}
246 {include file="CRM/Profile/Page/MultipleRecordFieldsListing.tpl" showListing=true}
247 {assign var=floatStyle value='float:right'}
249 <div class="crm-submit-buttons" style='{$floatStyle}'>
250 {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}<span class="crm-button">{$form._qf_Edit_upload_duplicate.html}</span>{/if}
253 {if $help_post && $action neq 4}<br /><div class="messages help">{$help_post}</div>{/if}
256 </div> {* end crm-container div *}
258 <script type="text/javascript">
261 if ( document.getElementsByName("cms_create_account")[0].checked ) {
262 cj('#details').show();
265 cj('#details').hide();
270 {/if} {* fields array is not empty *}
271 {if $multiRecordFieldListing and empty($fields)}
272 {include file="CRM/Profile/Page/MultipleRecordFieldsListing.tpl" showListing=true}
275 {include file="CRM/common/showHideByFieldValue.tpl"
276 trigger_field_id ="create_account"
278 target_element_id ="details"
279 target_element_type ="block"
283 {elseif $statusMessage}
284 <div class="messages status no-popup">
285 <div class="icon inform-icon"></div>
289 {/if} {*end of if for $deleteRecord*}
291 <script type="text/javascript">
293 cj(document).ready(function(){
294 cj('#selector tr:even').addClass('odd-row ');
295 cj('#selector tr:odd ').addClass('even-row');
301 </div> {* end crm-profile-NAME *}