Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-08-12-10-27-52
[civicrm-core.git] / templates / CRM / Custom / Form / CustomData.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 {* Custom Data form*}
27 {if $formEdit}
28 {if $cd_edit.help_pre}
29 <div class="messages help">{$cd_edit.help_pre}</div>
30 {/if}
31 <table class="form-layout-compressed">
32 {foreach from=$cd_edit.fields item=element key=field_id}
33 {include file="CRM/Custom/Form/CustomField.tpl"}
34 {/foreach}
35 </table>
36 <div class="spacer"></div>
37 {if $cd_edit.help_post}
38 <div class="messages help">{$cd_edit.help_post}</div>
39 {/if}
40 {if $cd_edit.is_multiple and ( ( $cd_edit.max_multiple eq '' ) or ( $cd_edit.max_multiple > 0 and $cd_edit.max_multiple > $cgCount ) ) }
41 <div id="add-more-link-{$cgCount}" class="add-more-link-{$group_id}-{$cgCount}"><a href="#" onclick="CRM.buildCustomData('{$cd_edit.extends}',{if $cd_edit.subtype}'{$cd_edit.subtype}'{else}'{$cd_edit.extends_entity_column_id}'{/if}, '', {$cgCount}, {$group_id}, true ); return false;">{ts 1=$cd_edit.title}Add another %1 record{/ts}</a></div>
42 {/if}
43 {else}
44 {foreach from=$groupTree item=cd_edit key=group_id name=custom_sets}
45 {if $cd_edit.is_multiple and $multiRecordDisplay eq 'single'}
46 <div class="custom-group custom-group-{$cd_edit.name}">
47 {if $cd_edit.help_pre}
48 <div class="messages help">{$cd_edit.help_pre}</div>
49 {/if}
50 <table>
51 {foreach from=$cd_edit.fields item=element key=field_id}
52 {include file="CRM/Custom/Form/CustomField.tpl"}
53 {/foreach}
54 </table>
55 <div class="spacer"></div>
56 {if $cd_edit.help_post}
57 <div class="messages help">{$cd_edit.help_post}</div>
58 {/if}
59 </div>
60 {else}
61 <div class="custom-group custom-group-{$cd_edit.name} crm-accordion-wrapper {if $cd_edit.collapse_display and !$skipTitle}collapsed{/if}">
62 {if !$skipTitle}
63 <div class="crm-accordion-header">
64 {$cd_edit.title}
65 </div><!-- /.crm-accordion-header -->
66 {/if}
67 <div class="crm-accordion-body">
68 {if $cd_edit.help_pre}
69 <div class="messages help">{$cd_edit.help_pre}</div>
70 {/if}
71 <table class="form-layout-compressed">
72 {foreach from=$cd_edit.fields item=element key=field_id}
73 {include file="CRM/Custom/Form/CustomField.tpl"}
74 {/foreach}
75 </table>
76 <div class="spacer"></div>
77 {if $cd_edit.help_post}
78 <div class="messages help">{$cd_edit.help_post}</div>
79 {/if}
80 </div>
81 </div>
82 {if $cd_edit.is_multiple and ( ( $cd_edit.max_multiple eq '' ) or ( $cd_edit.max_multiple > 0 and $cd_edit.max_multiple > $cgCount ) ) }
83 {if $skipTitle}
84 {* We don't yet support adding new records in inline-edit forms *}
85 <div class="messages help">
86 <em>{ts 1=$cd_edit.title}Click "Edit Contact" to add more %1 records{/ts}</em>
87 </div>
88 {else}
89 <div id="add-more-link-{$cgCount}"><a href="#" onclick="CRM.buildCustomData('{$cd_edit.extends}',{if $cd_edit.subtype}'{$cd_edit.subtype}'{else}'{$cd_edit.extends_entity_column_id}'{/if}, '', {$cgCount}, {$group_id}, true ); return false;">{ts 1=$cd_edit.title}Add another %1 record{/ts}</a></div>
90 {/if}
91 {/if}
92 {/if}
93 <div id="custom_group_{$group_id}_{$cgCount}"></div>
94 {/foreach}
95
96 {/if}
97
98 {include file="CRM/Form/attachmentjs.tpl"}