Merge remote-tracking branch 'upstream/4.4' into 4.4-4.5-2014-09-29-14-51-22
[civicrm-core.git] / templates / CRM / UF / Page / Group.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
819d0d41 3 | CiviCRM version 4.5 |
6a488035 4 +--------------------------------------------------------------------+
819d0d41 5 | Copyright CiviCRM LLC (c) 2004-2014 |
6a488035
TO
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*}
4d17a233
CW
67 {include file="CRM/common/enableDisableApi.tpl"}
68 {include file="CRM/common/crmeditable.tpl"}
6a488035
TO
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>
bcbde5ca
AW
76 <th>{ts}Created By{/ts}</th>
77 <th>{ts}Description{/ts}</th>
6a488035
TO
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 }
4d17a233 87 <tr id="UFGroup-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}">
6a488035 88 <td><span class="crmf-title crm-editable">{$row.title}</span></td>
bcbde5ca
AW
89 <td>
90 {if $row.created_id && $row.created_by}
d8bffe29 91 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.created_id`"}">{ts}{$row.created_by}{/ts}</a>
bcbde5ca
AW
92 {/if}
93 </td>
94 <td>{$row.description}</td>
6a488035
TO
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>
bcbde5ca
AW
119 <th>{ts}Created By{/ts}</th>
120 <th>{ts}Description{/ts}</th>
6a488035
TO
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}
4d17a233 130 <tr id="UFGroup-{$row.id}" class="crm-entity {$row.class}{if NOT $row.is_active} disabled{/if}">
6a488035 131 <td>{$row.title}</td>
bcbde5ca
AW
132 <td>
133 {if $row.created_id && $row.created_by}
d8bffe29 134 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.created_id`"}">{ts}{$row.created_by}{/ts}</a>
bcbde5ca
AW
135 {/if}
136 </td>
137 <td>{$row.description}</td>
6a488035
TO
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'>
3cc60a06 158 CRM.$(function($) {ldelim}
4165b7e5 159 var selectedTab = '{if $selectedChild}{$selectedChild}{else}user-profiles{/if}';
ae8f569f 160 var tabIndex = $('#tab_' + selectedTab).prevAll().length;
4165b7e5 161 {literal}
ae8f569f 162 $("#mainTabContainer").tabs( {active: tabIndex} );
6a488035
TO
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}