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 {capture assign=infoTitle}{ts}Preview Mode{/ts}{/capture}
27 {assign var="infoType" value="info"}
29 {capture assign=infoMessage}<strong>{ts}Profile Field Preview{/ts}</strong>{/capture}
31 {capture assign=infoMessage}<strong>{ts}Profile Preview{/ts}</strong>{/capture}
33 {include file="CRM/common/info.tpl"}
34 <div class="crm-form-block">
36 {if ! empty( $fields )}
38 {* wrap in crm-container div so crm styles are used *}
39 <div id="crm-container-inner" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">
40 {include file="CRM/common/CMSUser.tpl"}
42 {if $help_pre && $action neq 4}<div class="messages help">{$help_pre}</div>{/if}
43 {assign var=zeroField value="Initial Non Existent Fieldset"}
44 {assign var=fieldset value=$zeroField}
45 {foreach from=$fields item=field key=fieldName}
46 {if $field.skipDisplay}
49 {if $field.groupTitle != $fieldset}
50 {if $fieldset != $zeroField}
53 <div class="messages help">{$groupHelpPost}</div>
60 <h3>{$field.groupTitle}</h3>
62 {assign var=fieldset value=`$field.groupTitle`}
63 {assign var=groupHelpPost value=`$field.groupHelpPost`}
64 {if $field.groupHelpPre}
65 <div class="messages help">{$field.groupHelpPre}</div>
67 <table class="form-layout-compressed" id="table-1">
69 {* Show explanatory text for field if not in 'view' mode *}
70 {if $field.help_pre && $action neq 4 && $field.field_type neq "Formatting"}
71 <tr><td> </td><td class="description">{$field.help_pre}</td></tr>
73 {assign var=n value=$field.name}
74 {if $field.field_type eq "Formatting"}
75 <tr><td colspan="2">{$field.help_pre}</td></tr>
76 {elseif $field.options_per_line }
78 <td class="option-label">{$form.$n.label}</td>
80 {assign var="count" value="1"}
82 <table class="form-layout-compressed">
84 {* sort by fails for option per line. Added a variable to iterate through the element array*}
85 {assign var="index" value="1"}
86 {foreach name=outer key=key item=item from=$form.$n}
88 {assign var="index" value=`$index+1`}
90 <td class="labels font-light">{$form.$n.$key.html}</td>
91 {if $count == $field.options_per_line}
93 {assign var="count" value="1"}
95 {assign var="count" value=`$count+1`}
109 {if $n eq 'group' && $form.group || ( $n eq 'tag' && $form.tag )}
110 {include file="CRM/Contact/Form/Edit/TagsAndGroups.tpl" type=$n}
111 {elseif $n eq 'email_greeting' or $n eq 'postal_greeting' or $n eq 'addressee'}
112 {include file="CRM/Profile/Form/GreetingType.tpl"}
113 {elseif ( $field.data_type eq 'Date' AND $element.skip_calendar NEQ true ) or
114 ( $n|substr:-5:5 eq '_date' ) or ( $field.name eq 'activity_date_time' ) }
115 {include file="CRM/common/jcalendar.tpl" elementName=$form.$n.name}
116 {elseif $n|substr:0:5 eq 'phone'}
117 {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'}
119 {if $form.$phone_ext_field.html}
120 {$form.$phone_ext_field.html}
123 {if $n|substr:0:4 eq 'url-'}
124 {assign var="websiteType" value=$n|cat:"-website_type_id"}
125 {$form.$websiteType.html}
126 {elseif $n|substr:0:3 eq 'im-'}
127 {assign var="provider" value=$n|cat:"-provider_id"}
128 {$form.$provider.html}
131 {if $field.is_view eq 0}
132 {if $field.html_type eq 'Autocomplete-Select'}
133 {if $field.data_type eq 'ContactReference'}
134 {include file="CRM/Custom/Form/ContactReference.tpl" element_name = $n}
142 {* Show explanatory text for field if not in 'view' mode *}
143 {if $field.help_post && $action neq 4}
144 <tr><td> </td><td class="description">{$field.help_post}</td></tr>
149 {include file='CRM/common/ReCAPTCHA.tpl'}
152 {if $field.groupHelpPost}
153 <div class="messages help">{$field.groupHelpPost}</div>
156 </div> {* end crm-container div *}
158 {capture assign=infoMessage}{ts}This CiviCRM profile field is view only.{/ts}{/capture}
159 {include file="CRM/common/info.tpl"}
161 {/if} {* fields array is not empty *}
163 <div class="crm-submit-buttons">
164 {include file="CRM/common/formButtons.tpl"}