Merge branch 'master' into recurring-activity-46
[civicrm-core.git] / templates / CRM / UF / Form / Preview.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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 *}
26 {if $previewField}
27 {capture assign=infoTitle}{ts}Profile Field Preview{/ts}{/capture}
28 {else}
29 {capture assign=infoTitle}{ts}Profile Preview{/ts}{/capture}
30 {/if}
31 {include file="CRM/common/info.tpl" infoType="no-popup profile-preview-msg" infoMessage=" "}
32 <div class="crm-form-block">
33
34 {if ! empty( $fields )}
35 {if $viewOnly}
36 {* wrap in crm-container div so crm styles are used *}
37 <div id="crm-container-inner" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">
38 {include file="CRM/common/CMSUser.tpl"}
39 {strip}
40 {if $help_pre && $action neq 4}<div class="messages help">{$help_pre}</div>{/if}
41 {assign var=zeroField value="Initial Non Existent Fieldset"}
42 {assign var=fieldset value=$zeroField}
43 {foreach from=$fields item=field key=fieldName}
44 {if $field.skipDisplay}
45 {continue}
46 {/if}
47 {if $field.groupTitle != $fieldset}
48 {if $fieldset != $zeroField}
49 </table>
50 {if $groupHelpPost}
51 <div class="messages help">{$groupHelpPost}</div>
52 {/if}
53 {if $mode ne 8}
54 </fieldset>
55 {/if}
56 {/if}
57 {if $mode ne 8}
58 <h3>{$field.groupTitle}</h3>
59 {/if}
60 {assign var=fieldset value=`$field.groupTitle`}
61 {assign var=groupHelpPost value=`$field.groupHelpPost`}
62 {if $field.groupHelpPre}
63 <div class="messages help">{$field.groupHelpPre}</div>
64 {/if}
65 <table class="form-layout-compressed" id="table-1">
66 {/if}
67 {* Show explanatory text for field if not in 'view' mode *}
68 {if $field.help_pre && $action neq 4 && $field.field_type neq "Formatting"}
69 <tr><td>&nbsp;</td><td class="description">{$field.help_pre}</td></tr>
70 {/if}
71 {assign var=n value=$field.name}
72 {if $field.field_type eq "Formatting"}
73 <tr><td colspan="2">{$field.help_pre}</td></tr>
74 {elseif $field.options_per_line }
75 <tr>
76 <td class="option-label">{$form.$n.label}</td>
77 <td>
78 {assign var="count" value="1"}
79 {strip}
80 <table class="form-layout-compressed">
81 <tr>
82 {* sort by fails for option per line. Added a variable to iterate through the element array*}
83 {assign var="index" value="1"}
84 {foreach name=outer key=key item=item from=$form.$n}
85 {if $index < 10}
86 {assign var="index" value=`$index+1`}
87 {else}
88 <td class="labels font-light">{$form.$n.$key.html}</td>
89 {if $count == $field.options_per_line}
90 </tr>
91 {assign var="count" value="1"}
92 {else}
93 {assign var="count" value=`$count+1`}
94 {/if}
95 {/if}
96 {/foreach}
97 </table>
98 {/strip}
99 </td>
100 </tr>
101 {else}
102 <tr>
103 <td class="label">
104 {$form.$n.label}
105 </td>
106 <td>
107 {if $n eq 'group' && $form.group || ( $n eq 'tag' && $form.tag )}
108 {include file="CRM/Contact/Form/Edit/TagsAndGroups.tpl" type=$n}
109 {elseif $n eq 'email_greeting' or $n eq 'postal_greeting' or $n eq 'addressee'}
110 {include file="CRM/Profile/Form/GreetingType.tpl"}
111 {elseif ( $field.data_type eq 'Date' AND $element.skip_calendar NEQ true ) or
112 ( $n|substr:-5:5 eq '_date' ) or ( $field.name eq 'activity_date_time' ) }
113 {include file="CRM/common/jcalendar.tpl" elementName=$form.$n.name}
114 {elseif $n|substr:0:5 eq 'phone'}
115 {assign var="phone_ext_field" value=$n|replace:'phone':'phone_ext'}
116 {$form.$n.html}
117 {if $form.$phone_ext_field.html}
118 &nbsp;{$form.$phone_ext_field.html}
119 {/if}
120 {else}
121 {if $n|substr:0:4 eq 'url-'}
122 {assign var="websiteType" value=$n|cat:"-website_type_id"}
123 {$form.$websiteType.html}&nbsp;
124 {elseif $n|substr:0:3 eq 'im-'}
125 {assign var="provider" value=$n|cat:"-provider_id"}
126 {$form.$provider.html}&nbsp;
127 {/if}
128 {$form.$n.html}
129 {if $field.is_view eq 0}
130 {if $field.html_type eq 'Autocomplete-Select'}
131 {if $field.data_type eq 'ContactReference'}
132 {include file="CRM/Custom/Form/ContactReference.tpl" element_name = $n}
133 {/if}
134 {/if}
135 {/if}
136 {/if}
137 </td>
138 </tr>
139 {/if}
140 {* Show explanatory text for field if not in 'view' mode *}
141 {if $field.help_post && $action neq 4}
142 <tr><td>&nbsp;</td><td class="description">{$field.help_post}</td></tr>
143 {/if}
144 {/foreach}
145
146 {if $addCAPTCHA }
147 {include file='CRM/common/ReCAPTCHA.tpl'}
148 {/if}
149 </table>
150 {if $field.groupHelpPost}
151 <div class="messages help">{$field.groupHelpPost}</div>
152 {/if}
153 {/strip}
154 </div> {* end crm-container div *}
155 {else}
156 {capture assign=infoMessage}{ts}This CiviCRM profile field is view only.{/ts}{/capture}
157 {include file="CRM/common/info.tpl"}
158 {/if}
159 {/if} {* fields array is not empty *}
160
161 <div class="crm-submit-buttons">
162 {include file="CRM/common/formButtons.tpl"}
163 </div>
164 </div>