Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
46312a4d TO |
10 | <div class="crm-profile-name-{$ufGroupName}"> |
11 | {crmRegion name=profile-form-`$ufGroupName`} | |
12 | ||
6a488035 TO |
13 | {* Profile forms when embedded in CMS account create (mode=1) or |
14 | cms account edit (mode=8) or civicrm/profile (mode=4) pages *} | |
6a488035 TO |
15 | {if $deleteRecord} |
16 | <div class="messages status no-popup"> | |
34d6cec4 | 17 | {icon icon="fa-info-circle"}{/icon} |
6a488035 TO |
18 | {ts}Are you sure you want to delete this record?{/ts} |
19 | </div> | |
fc942baa CW |
20 | |
21 | <div class="crm-submit-buttons"> | |
57c59c34 | 22 | {$form._qf_Edit_upload_delete.html} |
b3f1028c JP |
23 | {if $includeCancelButton} |
24 | <a class="button cancel" href="{$cancelURL}">{$cancelButtonText}</a> | |
25 | {/if} | |
fc942baa | 26 | </div> |
6a488035 TO |
27 | {else} |
28 | {if ! empty( $fields )} | |
29 | {* Wrap in crm-container div so crm styles are used.*} | |
30 | {* 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" *} | |
31 | ||
32 | {if $action eq 1 or $action eq 2 or $action eq 4 } | |
d6379709 | 33 | <div id="crm-profile-block" class="crm-container crm-public"> |
6a488035 | 34 | {else} |
a17a96df | 35 | <div id="crm-container" class="crm-container crm-public" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}"> |
6a488035 TO |
36 | {/if} |
37 | ||
38 | {if $isDuplicate and ( ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192) ) } | |
39 | <div class="crm-submit-buttons"> | |
57c59c34 | 40 | {$form._qf_Edit_upload_duplicate.html} |
6a488035 TO |
41 | </div> |
42 | {/if} | |
43 | {if $mode eq 1 || $activeComponent neq "CiviCRM"} | |
44 | {include file="CRM/Form/body.tpl"} | |
45 | {/if} | |
46 | {strip} | |
47 | {if $help_pre && $action neq 4} | |
48 | <div class="messages help">{$help_pre}</div> | |
49 | {/if} | |
50 | ||
51 | {include file="CRM/common/CMSUser.tpl"} | |
52 | ||
53 | {if $action eq 2 and $multiRecordFieldListing} | |
54 | <h1>{ts}Edit Details{/ts}</h1> | |
55 | <div class="crm-submit-buttons" style='float:right'> | |
57c59c34 | 56 | {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if} |
6a488035 TO |
57 | </div> |
58 | {/if} | |
59 | ||
60 | {assign var=zeroField value="Initial Non Existent Fieldset"} | |
61 | {assign var=fieldset value=$zeroField} | |
62 | {foreach from=$fields item=field key=fieldName} | |
63 | {if $field.skipDisplay} | |
64 | {continue} | |
65 | {/if} | |
66 | {assign var="profileID" value=$field.group_id} | |
67 | {assign var=n value=$field.name} | |
b5c36756 KJ |
68 | {if $field.groupTitle != $fieldset} |
69 | {if $mode neq 8 && $mode neq 4} | |
70 | <div {if $context neq 'dialog'}id="profilewrap{$field.group_id}"{/if}> | |
71 | <fieldset><legend>{$field.groupTitle}</legend> | |
72 | {/if} | |
73 | {assign var=fieldset value=`$field.groupTitle`} | |
74 | {assign var=groupHelpPost value=`$field.groupHelpPost`} | |
75 | {if $field.groupHelpPre} | |
76 | <div class="messages help">{$field.groupHelpPre}</div> | |
77 | {/if} | |
78 | {/if} | |
6a488035 TO |
79 | {if $field.field_type eq "Formatting"} |
80 | {$field.help_pre} | |
81 | {elseif $n} | |
82 | {if $field.groupTitle != $fieldset} | |
83 | {if $fieldset != $zeroField} | |
84 | {if $groupHelpPost} | |
85 | <div class="messages help">{$groupHelpPost}</div> | |
86 | {/if} | |
87 | {if $mode neq 8 && $mode neq 4} | |
88 | </div><!-- end form-layout-compressed-div --> | |
89 | </fieldset> | |
90 | </div> | |
91 | {/if} | |
92 | {/if} | |
6a488035 TO |
93 | <div class="form-layout-compressed"> |
94 | {/if} | |
95 | {if $field.help_pre && $action neq 4 && $form.$n.html} | |
8669266d | 96 | <div class="crm-section helprow-{$n}-section helprow-pre" id="helprow-{$n}"> |
6a488035 TO |
97 | <div class="content description">{$field.help_pre}</div> |
98 | </div> | |
99 | {/if} | |
100 | {if $field.options_per_line} | |
101 | <div class="crm-section editrow_{$n}-section form-item" id="editrow-{$n}"> | |
102 | <div class="label">{$form.$n.label}</div> | |
103 | <div class="content edit-value"> | |
104 | {assign var="count" value="1"} | |
105 | {strip} | |
106 | <table class="form-layout-compressed"> | |
107 | <tr> | |
108 | {* sort by fails for option per line. Added a variable to iterate through the element array*} | |
109 | {assign var="index" value="1"} | |
110 | {foreach name=outer key=key item=item from=$form.$n} | |
111 | {if $index < 10} | |
112 | {assign var="index" value=`$index+1`} | |
113 | {else} | |
114 | <td class="labels font-light">{$form.$n.$key.html}</td> | |
115 | {if $count == $field.options_per_line} | |
116 | </tr> | |
117 | <tr> | |
118 | {assign var="count" value="1"} | |
119 | {else} | |
120 | {assign var="count" value=`$count+1`} | |
121 | {/if} | |
122 | {/if} | |
123 | {/foreach} | |
124 | </tr> | |
125 | </table> | |
6a488035 TO |
126 | {/strip} |
127 | </div> | |
128 | <div class="clear"></div> | |
129 | </div>{* end of main edit section div*} | |
130 | {else} | |
131 | <div id="editrow-{$n}" class="crm-section editrow_{$n}-section form-item"> | |
132 | <div class="label"> | |
133 | {$form.$n.label} | |
134 | </div> | |
135 | <div class="edit-value content"> | |
136 | {if $n|substr:0:3 eq 'im-'} | |
137 | {assign var="provider" value=$n|cat:"-provider_id"} | |
138 | {$form.$provider.html} | |
6a488035 TO |
139 | {/if} |
140 | {if $n eq 'email_greeting' or $n eq 'postal_greeting' or $n eq 'addressee'} | |
141 | {include file="CRM/Profile/Form/GreetingType.tpl"} | |
142 | {elseif ( $n eq 'group' && $form.group ) || ( $n eq 'tag' && $form.tag )} | |
d8d2f9e1 | 143 | {include file="CRM/Contact/Form/Edit/TagsAndGroups.tpl" type=$n context="profile" tableLayout=1} |
6a488035 TO |
144 | {elseif ( $form.$n.name eq 'image_URL' )} |
145 | {$form.$n.html} | |
146 | {if !empty($imageURL)} | |
147 | <div class="crm-section contact_image-section"> | |
148 | <div class="content"> | |
149 | {include file="CRM/Contact/Page/ContactImage.tpl"} | |
150 | </div> | |
151 | </div> | |
152 | {/if} | |
153 | {elseif $n|substr:0:5 eq 'phone'} | |
154 | {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'} | |
155 | {$form.$n.html} | |
156 | {if $form.$phone_ext_field.html} | |
157 | {$form.$phone_ext_field.html} | |
158 | {/if} | |
159 | {else} | |
458c6959 | 160 | {if $field.html_type neq 'File' || ($field.html_type eq 'File' && !$field.is_view)} |
161 | {$form.$n.html} | |
162 | {/if} | |
4a143c04 | 163 | {if $field.html_type eq 'Autocomplete-Select'} |
6a488035 TO |
164 | {if $field.data_type eq 'ContactReference'} |
165 | {include file="CRM/Custom/Form/ContactReference.tpl" element_name = $n} | |
6a488035 TO |
166 | {/if} |
167 | {/if} | |
168 | {/if} | |
169 | </div> | |
170 | <div class="clear"></div> | |
171 | </div> | |
172 | ||
173 | {if $form.$n.type eq 'file'} | |
174 | <div class="crm-section file_displayURL-section file_displayURL{$n}-section"><div class="content">{$customFiles.$n.displayURL}</div></div> | |
458c6959 | 175 | {if !$fields.$n.is_view} |
176 | <div class="crm-section file_deleteURL-section file_deleteURL{$n}-section"><div class="content">{$customFiles.$n.deleteURL}</div></div> | |
177 | {/if} | |
6a488035 TO |
178 | {/if} |
179 | {/if} | |
180 | ||
181 | {* Show explanatory text for field if not in 'view' mode *} | |
182 | {if $field.help_post && $action neq 4 && $form.$n.html} | |
8669266d | 183 | <div class="crm-section helprow-{$n}-section helprow-post" id="helprow-{$n}"> |
6a488035 TO |
184 | <div class="content description">{$field.help_post}</div> |
185 | </div> | |
186 | {/if} | |
187 | {/if}{* end of main if field name if *} | |
188 | {/foreach} | |
ebf2b57b | 189 | |
6a488035 TO |
190 | {if $isCaptcha && ( $mode eq 8 || $mode eq 4 || $mode eq 1 ) } |
191 | {include file='CRM/common/ReCAPTCHA.tpl'} | |
192 | <script type="text/javascript">cj('.recaptcha_label').attr('width', '140px');</script> | |
193 | {/if} | |
194 | ||
195 | {if $field.groupHelpPost} | |
196 | <div class="messages help">{$field.groupHelpPost}</div> | |
197 | {/if} | |
198 | ||
199 | {if $mode neq 8 && $mode neq 4} | |
200 | </fieldset> | |
201 | </div> | |
202 | {/if} | |
203 | ||
204 | {if ($action eq 1 and $mode eq 4 ) or ($action eq 2) or ($action eq 8192)} | |
205 | {if $action eq 2 and $multiRecordFieldListing} | |
16a89e07 PN |
206 | <div class="crm-multi-record-custom-field-listing"> |
207 | {include file="CRM/Profile/Page/MultipleRecordFieldsListing.tpl" showListing=true} | |
208 | {assign var=floatStyle value='float:right'} | |
209 | </div> | |
6a488035 TO |
210 | {/if} |
211 | <div class="crm-submit-buttons" style='{$floatStyle}'> | |
57c59c34 | 212 | {include file="CRM/common/formButtons.tpl"}{if $isDuplicate}{$form._qf_Edit_upload_duplicate.html}{/if} |
b3f1028c JP |
213 | {if $includeCancelButton} |
214 | <a class="button cancel" href="{$cancelURL}"> | |
215 | <span> | |
13a3d214 | 216 | <i class="crm-i fa-times" aria-hidden="true"></i> |
b3f1028c JP |
217 | {$cancelButtonText} |
218 | </span> | |
219 | </a> | |
220 | {/if} | |
6a488035 TO |
221 | </div> |
222 | {/if} | |
223 | {if $help_post && $action neq 4}<br /><div class="messages help">{$help_post}</div>{/if} | |
224 | {/strip} | |
225 | ||
226 | </div> {* end crm-container div *} | |
227 | ||
228 | <script type="text/javascript"> | |
229 | {if $drupalCms} | |
230 | {literal} | |
231 | if ( document.getElementsByName("cms_create_account")[0].checked ) { | |
232 | cj('#details').show(); | |
233 | } | |
234 | else { | |
235 | cj('#details').hide(); | |
236 | } | |
237 | {/literal} | |
238 | {/if} | |
239 | </script> | |
240 | {/if} {* fields array is not empty *} | |
241 | {if $multiRecordFieldListing and empty($fields)} | |
242 | {include file="CRM/Profile/Page/MultipleRecordFieldsListing.tpl" showListing=true} | |
243 | {/if} | |
244 | {if $drupalCms} | |
245 | {include file="CRM/common/showHideByFieldValue.tpl" | |
246 | trigger_field_id ="create_account" | |
247 | trigger_value ="" | |
248 | target_element_id ="details" | |
249 | target_element_type ="block" | |
250 | field_type ="radio" | |
251 | invert = 0 | |
252 | } | |
253 | {elseif $statusMessage} | |
254 | <div class="messages status no-popup"> | |
34d6cec4 | 255 | {icon icon="fa-info-circle"}{/icon} |
6a488035 TO |
256 | {$statusMessage} |
257 | </div> | |
258 | {/if} | |
259 | {/if} {*end of if for $deleteRecord*} | |
260 | {literal} | |
261 | <script type="text/javascript"> | |
262 | ||
ae8f569f | 263 | CRM.$(function($) { |
6a488035 TO |
264 | cj('#selector tr:even').addClass('odd-row '); |
265 | cj('#selector tr:odd ').addClass('even-row'); | |
266 | }); | |
267 | {/literal} | |
6a488035 | 268 | </script> |
6a488035 | 269 | |
46312a4d TO |
270 | {/crmRegion} |
271 | </div> {* end crm-profile-NAME *} |