Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
232624b1 | 3 | | CiviCRM version 4.4 | |
6a488035 TO |
4 | +--------------------------------------------------------------------+ |
5 | | Copyright CiviCRM LLC (c) 2004-2013 | | |
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 | {capture assign=infoTitle}{ts}Preview Mode{/ts}{/capture} | |
27 | {assign var="infoType" value="info"} | |
28 | {if $preview_type eq 'group'} | |
29 | {capture assign=infoMessage}{ts}Showing the custom data group (fieldset) as it will be displayed within an edit form.{/ts}{/capture} | |
30 | {capture name=legend} | |
31 | {foreach from=$groupTree item=fieldName} | |
32 | {$fieldName.title} | |
33 | {/foreach} | |
34 | {/capture} | |
35 | {else} | |
36 | {capture assign=infoMessage}{ts}Showing this field as it will be displayed in an edit form.{/ts}{/capture} | |
37 | {/if} | |
38 | {include file="CRM/common/info.tpl"} | |
39 | <div class="crm-block crm-form-block crm-custom-preview-form-block"> | |
40 | {strip} | |
41 | ||
42 | {foreach from=$groupTree item=cd_edit key=group_id} | |
43 | <p></p> | |
44 | <fieldset>{if $preview_type eq 'group'}<legend>{$smarty.capture.legend}</legend>{/if} | |
45 | {if $cd_edit.help_pre}<div class="messages help">{$cd_edit.help_pre}</div><br />{/if} | |
46 | <table class="form-layout-compressed"> | |
47 | {foreach from=$cd_edit.fields item=element key=field_id} | |
48 | {if $element.is_view eq 0}{* fix for CRM-2699 *} | |
49 | {if $element.help_pre} | |
50 | <tr><td class="label"></td><td class="description">{$element.help_pre}</td></tr> | |
51 | {/if} | |
52 | {if $element.options_per_line } | |
53 | {*assign var="element_name" value=$element.custom_group_id|cat:_|cat:$field_id|cat:_|cat:$element.name*} | |
54 | {assign var="element_name" value=$element.element_name} | |
55 | <tr> | |
d5a1ed7e | 56 | <td class="label">{$form.$element_name.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$form.$element_name.label}{/if}</td> |
6a488035 TO |
57 | <td> |
58 | {assign var="count" value="1"} | |
59 | <table class="form-layout-compressed"> | |
60 | <tr> | |
61 | {* sort by fails for option per line. Added a variable to iterate through the element array*} | |
62 | {assign var="index" value="1"} | |
63 | {foreach name=outer key=key item=item from=$form.$element_name} | |
64 | {if $index < 10} | |
65 | {assign var="index" value=`$index+1`} | |
66 | {else} | |
67 | <td class="labels font-light">{$form.$element_name.$key.html}</td> | |
68 | {if $count == $element.options_per_line} | |
69 | {assign var="count" value="1"} | |
70 | </tr> | |
71 | {else} | |
72 | {assign var="count" value=`$count+1`} | |
73 | {/if} | |
74 | {/if} | |
75 | {/foreach} | |
6a488035 TO |
76 | </tr> |
77 | </table> | |
78 | </td> | |
79 | </tr> | |
80 | {else} | |
81 | {assign var="name" value=`$element.name`} | |
82 | {*assign var="element_name" value=$group_id|cat:_|cat:$field_id|cat:_|cat:$element.name*} | |
83 | {assign var="element_name" value=$element.element_name} | |
84 | <tr> | |
d5a1ed7e | 85 | <td class="label">{$form.$element_name.label}{if $element.help_post}{help id=$element.id file="CRM/Custom/Form/CustomField.hlp" title=$form.$element_name.label}{/if}</td> |
6a488035 TO |
86 | <td> |
87 | {if $element.data_type neq 'Date'} | |
88 | {$form.$element_name.html} | |
89 | {elseif $element.skip_calendar NEQ true } | |
90 | {include file="CRM/common/jcalendar.tpl" elementName=$element_name} | |
91 | {/if} | |
4a143c04 | 92 | {if $element.html_type eq 'Autocomplete-Select'} |
6a488035 TO |
93 | {if $element.data_type eq 'ContactReference'} |
94 | {include file="CRM/Custom/Form/ContactReference.tpl"} | |
95 | {else} | |
96 | {include file="CRM/Custom/Form/AutoComplete.tpl"} | |
97 | {/if} | |
98 | {/if} | |
99 | </td> | |
100 | {/if} | |
101 | {/if} | |
102 | {/foreach} | |
103 | </table> | |
104 | {if $cd_edit.help_post}<br /><div class="messages help">{$cd_edit.help_post}</div>{/if} | |
105 | </fieldset> | |
106 | {/foreach} | |
107 | {/strip} | |
108 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> | |
109 | </div> | |
110 |