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