CRM-15109 - Fix deleting custom records and update UX to 4.5 conventions
[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} add-more-link-{$group_id}-{$cgCount}">
42 <a href="#" class="crm-hover-button" 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;">
43 <span class="icon ui-icon-circle-plus"></span>
44 {ts 1=$cd_edit.title}Another %1 record{/ts}
45 </a>
46 </div>
47 {/if}
48 {else}
49 {foreach from=$groupTree item=cd_edit key=group_id name=custom_sets}
50 {if $cd_edit.is_multiple and $multiRecordDisplay eq 'single'}
51 <div class="custom-group custom-group-{$cd_edit.name}">
52 {if $cd_edit.help_pre}
53 <div class="messages help">{$cd_edit.help_pre}</div>
54 {/if}
55 <table>
56 {foreach from=$cd_edit.fields item=element key=field_id}
57 {include file="CRM/Custom/Form/CustomField.tpl"}
58 {/foreach}
59 </table>
60 <div class="spacer"></div>
61 {if $cd_edit.help_post}
62 <div class="messages help">{$cd_edit.help_post}</div>
63 {/if}
64 </div>
65 {else}
66 <div class="custom-group custom-group-{$cd_edit.name} crm-accordion-wrapper {if $cd_edit.collapse_display and !$skipTitle}collapsed{/if}">
67 {if !$skipTitle}
68 <div class="crm-accordion-header">
69 {$cd_edit.title} {$cgCount}
70 </div><!-- /.crm-accordion-header -->
71 {/if}
72 <div class="crm-accordion-body">
73 {if $cd_edit.help_pre}
74 <div class="messages help">{$cd_edit.help_pre}</div>
75 {/if}
76 <table class="form-layout-compressed">
77 {foreach from=$cd_edit.fields item=element key=field_id}
78 {include file="CRM/Custom/Form/CustomField.tpl"}
79 {/foreach}
80 </table>
81 <div class="spacer"></div>
82 {if $cd_edit.help_post}
83 <div class="messages help">{$cd_edit.help_post}</div>
84 {/if}
85 </div>
86 </div>
87 {if $cd_edit.is_multiple and ( ( $cd_edit.max_multiple eq '' ) or ( $cd_edit.max_multiple > 0 and $cd_edit.max_multiple > $cgCount ) ) }
88 {if $skipTitle}
89 {* We don't yet support adding new records in inline-edit forms *}
90 <div class="messages help">
91 <em>{ts 1=$cd_edit.title}Click "Edit Contact" to add more %1 records{/ts}</em>
92 </div>
93 {else}
94 <div id="add-more-link-{$cgCount}">
95 <a href="#" class="crm-hover-button" 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;">
96 <span class="icon ui-icon-circle-plus"></span>
97 {ts 1=$cd_edit.title}Another %1 record{/ts}
98 </a>
99 </div>
100 {/if}
101 {/if}
102 {/if}
103 <div id="custom_group_{$group_id}_{$cgCount}"></div>
104 {/foreach}
105
106 {/if}
107
108 {include file="CRM/Form/attachmentjs.tpl"}