Merge pull request #3805 from colemanw/groups
[civicrm-core.git] / templates / CRM / UF / Page / Group.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 $action eq 1 or $action eq 2 or $action eq 4 or $action eq 8 or $action eq 64 or $action eq 16384}
27 {* Add or edit Profile Group form *}
28 {include file="CRM/UF/Form/Group.tpl"}
29 {elseif $action eq 1024}
30 {* Preview Profile Group form *}
31 {include file="CRM/UF/Form/Preview.tpl"}
32 {elseif $action eq 8192}
33 {* Display HTML Form Snippet Code *}
34 <div id="help">
35 {ts}The HTML code below will display a form consisting of the active fields in this Profile. You can copy this HTML code and paste it into any block or page on ANY website where you want to collect contact information.{/ts} {help id='standalone'}
36 </div>
37 <br />
38 <form name="html_code" action="{crmURL p='civicrm/admin/uf/group' q="action=profile&gid=$gid"}">
39 <div id="standalone-form">
40 <textarea rows="20" cols="80" name="profile" id="profile">{$profile}</textarea>
41 <div class="spacer"></div>
42 <a href="#" onclick="html_code.profile.select(); return false;" class="button"><span>Select HTML Code</span></a>
43 </div>
44 <div class="action-link">
45 &nbsp; <a href="{crmURL p='civicrm/admin/uf/group' q="reset=1"}">&raquo; {ts}Back to Profile Listings{/ts}</a>
46 </div>
47 </form>
48
49 {else}
50 <div id="help">
51 {ts}CiviCRM Profile(s) allow you to aggregate groups of fields and include them in your site as input forms, contact display pages, and search and listings features. They provide a powerful set of tools for you to collect information from constituents and selectively share contact information.{/ts} {help id='profile_overview'}
52 </div>
53
54 {if NOT ($action eq 1 or $action eq 2)}
55 <div class="crm-submit-buttons">
56 <a href="{crmURL p='civicrm/admin/uf/group/add' q="action=add&reset=1"}" id="newCiviCRMProfile-top" class="button"><span><div class="icon add-icon"></div>{ts}Add Profile{/ts}</span></a>
57 </div>
58 {/if}
59 {if $rows}
60 <div id='mainTabContainer'>
61 <ul>
62 <li id='tab_user'> <a href='#user-profiles' title='{ts}User-defined Profile{/ts}'>{ts}User-defined Profiles{/ts}</a></li>
63 <li id='tab_reserved'><a href='#reserved-profiles' title='{ts}Reserved Profiles{/ts}'>{ts}Reserved Profiles{/ts}</a></li>
64 </ul>
65
66 {* handle enable/disable actions*}
67 {include file="CRM/common/enableDisableApi.tpl"}
68 {include file="CRM/common/crmeditable.tpl"}
69 {include file="CRM/common/jsortable.tpl"}
70 <div id="user-profiles">
71 <div class="crm-content-block">
72 <table class="display">
73 <thead>
74 <tr>
75 <th id="sortable">{ts}Profile Title{/ts}</th>
76 <th>{ts}Created By{/ts}</th>
77 <th>{ts}Description{/ts}</th>
78 <th>{ts}Type{/ts}</th>
79 <th>{ts}ID{/ts}</th>
80 <th id="nosort">{ts}Used For{/ts}</th>
81 <th></th>
82 </tr>
83 </thead>
84 <tbody>
85 {foreach from=$rows item=row}
86 {if !$row.is_reserved }
87 <tr id="UFGroup-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}">
88 <td><span class="crmf-title crm-editable">{$row.title}</span></td>
89 <td>
90 {if $row.created_id && $row.created_by}
91 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.created_id`"}">{ts}{$row.created_by}{/ts}</a>
92 {/if}
93 </td>
94 <td>{$row.description}</td>
95 <td>{$row.group_type}</td>
96 <td>{$row.id}</td>
97 <td>{$row.module}</td>
98 <td>{$row.action|replace:'xx':$row.id}</td>
99 </tr>
100 {/if}
101 {/foreach}
102 </tbody>
103 </table>
104
105 {if NOT ($action eq 1 or $action eq 2)}
106 <div class="crm-submit-buttons">
107 <a href="{crmURL p='civicrm/admin/uf/group/add' q='action=add&reset=1'}" id="newCiviCRMProfile-bottom" class="button"><span><div class="icon add-icon"></div>{ts}Add Profile{/ts}</span></a>
108 </div>
109 {/if}
110 </div>
111 </div>{* user profile*}
112
113 <div id="reserved-profiles">
114 <div class="crm-content-block">
115 <table class="display">
116 <thead>
117 <tr>
118 <th id="sortable">{ts}Profile Title{/ts}</th>
119 <th>{ts}Created By{/ts}</th>
120 <th>{ts}Description{/ts}</th>
121 <th>{ts}Type{/ts}</th>
122 <th>{ts}ID{/ts}</th>
123 <th id="nosort">{ts}Used For{/ts}</th>
124 <th></th>
125 </tr>
126 </thead>
127 <tbody>
128 {foreach from=$rows item=row}
129 {if $row.is_reserved}
130 <tr id="UFGroup-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}">
131 <td>{$row.title}</td>
132 <td>
133 {if $row.created_id && $row.created_by}
134 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.created_id`"}">{ts}{$row.created_by}{/ts}</a>
135 {/if}
136 </td>
137 <td>{$row.description}</td>
138 <td>{$row.group_type}</td>
139 <td>{$row.id}</td>
140 <td>{$row.module}</td>
141 <td>{$row.action|replace:'xx':$row.id}</td>
142 </tr>
143 {/if}
144 {/foreach}
145 </tbody>
146 </table>
147
148 {if NOT ($action eq 1 or $action eq 2)}
149 <div class="crm-submit-buttons">
150 <a href="{crmURL p='civicrm/admin/uf/group/add' q='action=add&reset=1'}" id="newCiviCRMProfile-bottom" class="button"><span><div class="icon add-icon"></div>{ts}Add Profile{/ts}</span></a>
151 </div>
152 {/if}
153 </div>
154 </div>{* reserved profile*}
155
156 </div> {* maincontainer*}
157 <script type='text/javascript'>
158 CRM.$(function($) {ldelim}
159 var selectedTab = '{if $selectedChild}{$selectedChild}{else}user-profiles{/if}';
160 var tabIndex = $('#tab_' + selectedTab).prevAll().length;
161 {literal}
162 $("#mainTabContainer").tabs( {active: tabIndex} );
163 });
164 {/literal}
165 </script>
166
167 {else}
168 {if $action ne 1} {* When we are adding an item, we should not display this message *}
169 <div class="messages status no-popup">
170 <div class="icon inform-icon"></div> &nbsp;
171 {capture assign=crmURL}{crmURL p='civicrm/admin/uf/group/add' q='action=add&reset=1'}{/capture}{ts 1=$crmURL}No CiviCRM Profiles have been created yet. You can <a href='%1'>add one now</a>.{/ts}
172 </div>
173 {/if}
174 {/if}
175 {/if}