cee0b16ce9ea6158fac3d5297583d9f61b8598fe
[civicrm-core.git] / templates / CRM / Contact / Page / View / GroupContact.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.3 |
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 <div class="view-content">
27 {if $groupCount eq 0 AND ! $groupSmart AND ! $groupParent}
28 <div class="messages status no-popup">
29 <div class="icon inform-icon"></div>&nbsp;{ts}This contact does not currently belong to any groups.{/ts}
30 </div>
31 {/if}
32
33 {include file="CRM/common/jsortable.tpl"}
34
35 {* Include 'add to new group' form if session has edit contact permissions *}
36 {if $permission EQ 'edit'}
37 {include file="CRM/Contact/Form/GroupContact.tpl"}
38 {/if}
39
40 {if $groupIn }
41 <div class="ht-one"></div>
42 <h3>{ts}Regular Groups{/ts}</h3>
43 <div class="description">{ts 1=$displayName}%1 has joined or been added to these group(s).{/ts}</div>
44 {strip}
45 <table id="current_group" class="display">
46 <thead>
47 <tr>
48 <th>{ts}Group{/ts}</th>
49 <th>{ts}Status{/ts}</th>
50 <th>{ts}Date Added{/ts}</th>
51 <th></th>
52 </tr>
53 </thead>
54 {foreach from=$groupIn item=row}
55 <tr id="grp_{$row.id}" class="{cycle values="odd-row,even-row"}">
56 <td class="bold"><a href="{crmURL p='civicrm/group/search' q="reset=1&force=1&context=smog&gid=`$row.group_id`"}">{$row.title}</a></td>
57 <td>{ts 1=$row.in_method}Added (by %1){/ts}</td>
58 <td>{$row.in_date|crmDate}</td>
59 <td>{if $permission EQ 'edit'}<a href="{crmURL p='civicrm/contact/view/group' q="gcid=`$row.id`&action=delete&st=o"}" onclick ="return confirm('{ts 1=$displayName 2=$row.title}Are you sure you want to remove %1 from %2?{/ts}');" title="{ts}Remove contact from this group (status in this group will be changed to 'Removed').{/ts}">[ {ts}Remove{/ts} ]</a>{/if}
60 {if $permission EQ 'edit'}<a href="{crmURL p='civicrm/contact/view/group' q="gcid=`$row.id`&action=delete&st=d"}" onclick ="return confirm('{ts 1=$displayName 2=$row.title}Are you sure you want to delete %1 from %2?{/ts}');" title="{ts}Remove contact from this group AND delete their group status record.{/ts}">[ {ts}Delete{/ts} ]</a>{/if}
61 </td>
62 </tr>
63 {/foreach}
64 </table>
65 {/strip}
66 {/if}
67
68 {if $groupSmart}
69 <div class="ht-one"></div>
70 <h3>{ts}Smart Groups{/ts}</h3>
71 <div class="description">{ts 1=$displayName}%1 is currently included in these Smart group(s) (e.g. saved searches).{/ts}</div>
72 {strip}
73 <table id="smart_group" class="display">
74 <thead>
75 <tr>
76 <th>{ts}Group{/ts}</th>
77 <th>{ts}Description{/ts}</th>
78 </tr>
79 </thead>
80 {foreach from=$groupSmart item=row}
81 <tr id="grp_{$row.id}" class="{cycle values="odd-row,even-row"}">
82 <td class="bold"><a href="{crmURL p='civicrm/group/search' q="reset=1&force=1&context=smog&gid=`$row.id`"}">{$row.title}</a></td>
83 <td>{$row.description}</td>
84 </tr>
85 {/foreach}
86 </table>
87 {/strip}
88 {/if}
89
90 {if $groupParent}
91 <div class="ht-one"></div>
92 <h3>{ts}Parent Groups{/ts}</h3>
93 <div class="description">{ts 1=$displayName}%1 is included in these Parent group(s) based on belonging to group(s) which are their children.{/ts}</div>
94 {strip}
95 <table id="parent_group" class="display">
96 <thead>
97 <tr>
98 <th>{ts}Group{/ts}</th>
99 </tr>
100 </thead>
101 {foreach from=$groupParent item=row}
102 <tr id="grp_{$row.id}" class="{cycle values="odd-row,even-row"}">
103 <td class="bold"><a href="{crmURL p='civicrm/group/search' q="reset=1&force=1&context=smog&gid=`$row.id`"}">{$row.title}</a></td>
104 </tr>
105 {/foreach}
106 </table>
107 {/strip}
108 {/if}
109
110 {if $groupPending }
111 <div class="ht-one"></div>
112 <h3 class="status-pending">{ts}Pending{/ts}</h3>
113 <div class="description">{ts}Joining these group(s) is pending confirmation by this contact.{/ts}</div>
114 {strip}
115 <table id="pending_group" class="display">
116 <thead>
117 <tr>
118 <th>{ts}Group{/ts}</th>
119 <th>{ts}Status{/ts}</th>
120 <th>{ts}Date Pending{/ts}</th>
121 <th></th>
122 </tr>
123 </thead>
124 {foreach from=$groupPending item=row}
125 <tr class="{cycle values="odd-row,even-row"}">
126 <td class="bold"><a href="{crmURL p='civicrm/group/search' q="reset=1&force=1&context=smog&gid=`$row.group_id`"}">{$row.title}</a></td>
127 <td>{ts 1=$row.pending_method}Pending (by %1){/ts}</td>
128 <td>{$row.pending_date|crmDate}</td>
129 <td>{if $permission EQ 'edit'}<a href="{crmURL p='civicrm/contact/view/group' q="gcid=`$row.id`&action=delete&st=o"}" onclick ="return confirm('{ts 1=$displayName 2=$row.title}Are you sure you want to remove %1 from %2?{/ts}');" title="{ts}Remove contact from this group (status in this group will be changed to 'Removed').{/ts}">[ {ts}Remove{/ts} ]</a>{/if}
130 {if $permission EQ 'edit'}<a href="{crmURL p='civicrm/contact/view/group' q="gcid=`$row.id`&action=delete&st=d"}" onclick ="return confirm('{ts 1=$displayName 2=$row.title}Are you sure you want to delete %1 from %2?{/ts}');" title="{ts}Delete the group status record (this group will no longer be listed under Pending Groups).{/ts}">[ {ts}Delete{/ts} ]</a>{/if}
131 </td>
132 </tr>
133 {/foreach}
134 </table>
135 {/strip}
136 {/if}
137
138 {if $groupOut }
139 <div class="ht-one"></div>
140 <h3 class="status-removed">{ts}Past Groups{/ts}</h3>
141 <div class="description">{ts 1=$displayName}%1 is no longer part of these group(s).{/ts}</div>
142 {strip}
143 <table id="past_group" class="display">
144 <thead>
145 <tr>
146 <th>{ts}Group{/ts}</th>
147 <th>{ts}Status{/ts}</th>
148 <th>{ts}Date Added{/ts}</th>
149 <th>{ts}Date Removed{/ts}</th>
150 <th></th>
151 </tr>
152 </thead>
153 {foreach from=$groupOut item=row}
154 <tr class="{cycle values="odd-row,even-row"}">
155 <td class="bold"><a href="{crmURL p='civicrm/group/search' q="reset=1&force=1&context=smog&gid=`$row.group_id`"}">{$row.title}</a></td>
156 <td class="status-removed">{ts 1=$row.out_method}Removed (by %1){/ts}</td>
157 <td>{$row.date_added|crmDate}</td>
158 <td>{$row.out_date|crmDate}</td>
159 <td>{if $permission EQ 'edit'}<a href="{crmURL p='civicrm/contact/view/group' q="gcid=`$row.id`&action=delete&st=i"}" onclick ="return confirm('{ts 1=$displayName 2=$row.title}Are you sure you want to add %1 back into %2?{/ts}');">[ {ts}Rejoin Group{/ts} ]</a>{/if}
160 {if $permission EQ 'edit'}<a href="{crmURL p='civicrm/contact/view/group' q="gcid=`$row.id`&action=delete&st=d"}" onclick ="return confirm('{ts 1=$displayName 2=$row.title}Are you sure you want to delete %1 from %2?{/ts}');" title="{ts}Delete the group status record (this group will no longer be listed under Past Groups).{/ts}">[ {ts}Delete{/ts} ]</a>{/if}
161 </td>
162 </tr>
163 {/foreach}
164 </table>
165 {/strip}
166 {/if}
167 </div>
168 </div>