Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
39de6fd5 | 3 | | CiviCRM version 4.6 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
e7112fa7 | 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
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 | {* Contact Summary template for new tabbed interface. Replaces Basic.tpl *} | |
27 | {if $action eq 2} | |
3860cf72 | 28 | {include file="CRM/Contact/Form/Contact.tpl"} |
6a488035 TO |
29 | {else} |
30 | ||
6a488035 TO |
31 | <div class="crm-summary-contactname-block crm-inline-edit-container"> |
32 | <div class="crm-summary-block" id="contactname-block"> | |
3860cf72 | 33 | {include file="CRM/Contact/Page/Inline/ContactName.tpl"} |
6a488035 TO |
34 | </div> |
35 | </div> | |
36 | ||
46d2738c | 37 | {if !$summaryPrint} |
3860cf72 | 38 | <div class="crm-actions-ribbon"> |
6a488035 | 39 | <ul id="actions"> |
3e87238e DG |
40 | {assign var='urlParams' value="reset=1"} |
41 | {if $searchKey} | |
42 | {assign var='urlParams' value=$urlParams|cat:"&key=$searchKey"} | |
96cfe0d7 | 43 | {/if} |
3e87238e DG |
44 | {if $context} |
45 | {assign var='urlParams' value=$urlParams|cat:"&context=$context"} | |
96cfe0d7 | 46 | {/if} |
3e87238e DG |
47 | |
48 | {* CRM-12735 - Conditionally include the Actions and Edit buttons if contact is NOT in trash.*} | |
49 | {if !$isDeleted} | |
50 | {if call_user_func(array('CRM_Core_Permission','check'), 'access CiviCRM')} | |
51 | <li class="crm-contact-activity crm-summary-block"> | |
52 | {include file="CRM/Contact/Page/Inline/Actions.tpl"} | |
53 | </li> | |
6a488035 | 54 | {/if} |
256e40af DG |
55 | {* Include Edit button if contact has 'edit contacts' permission OR user is viewing their own contact AND has 'edit my contact' permission. CRM_Contact_Page_View::checkUserPermission handles this and assigns $permission true as needed. *} |
56 | {if $permission EQ 'edit'} | |
3e87238e DG |
57 | <li> |
58 | {assign var='editParams' value=$urlParams|cat:"&action=update&cid=$contactId"} | |
59 | <a href="{crmURL p='civicrm/contact/add' q=$editParams}" class="edit button" title="{ts}Edit{/ts}"> | |
52604b19 | 60 | <span><div class="icon ui-icon-pencil"></div>{ts}Edit{/ts}</span> |
3e87238e DG |
61 | </a> |
62 | </li> | |
63 | {/if} | |
64 | {/if} | |
6a488035 | 65 | |
3e87238e DG |
66 | {* Check for permissions to provide Restore and Delete Permanently buttons for contacts that are in the trash. *} |
67 | {if (call_user_func(array('CRM_Core_Permission','check'), 'access deleted contacts') and | |
6a488035 | 68 | $is_deleted)} |
3860cf72 E |
69 | <li class="crm-contact-restore"> |
70 | <a href="{crmURL p='civicrm/contact/view/delete' q="reset=1&cid=$contactId&restore=1"}" class="delete button" title="{ts}Restore{/ts}"> | |
71 | <span><div class="icon restore-icon"></div>{ts}Restore from Trash{/ts}</span> | |
72 | </a> | |
73 | </li> | |
6a488035 | 74 | |
3860cf72 E |
75 | {if call_user_func(array('CRM_Core_Permission','check'), 'delete contacts')} |
76 | <li class="crm-contact-permanently-delete"> | |
77 | <a href="{crmURL p='civicrm/contact/view/delete' q="reset=1&delete=1&cid=$contactId&skip_undelete=1"}" class="delete button" title="{ts}Delete Permanently{/ts}"> | |
78 | <span><div class="icon delete-icon"></div>{ts}Delete Permanently{/ts}</span> | |
79 | </a> | |
80 | </li> | |
6a488035 TO |
81 | {/if} |
82 | ||
3860cf72 E |
83 | {elseif call_user_func(array('CRM_Core_Permission','check'), 'delete contacts')} |
84 | {assign var='deleteParams' value="&reset=1&delete=1&cid=$contactId"} | |
85 | <li class="crm-delete-action crm-contact-delete"> | |
86 | <a href="{crmURL p='civicrm/contact/view/delete' q=$deleteParams}" class="delete button" title="{ts}Delete{/ts}"> | |
87 | <span><div class="icon delete-icon"></div>{ts}Delete Contact{/ts}</span> | |
88 | </a> | |
89 | </li> | |
90 | {/if} | |
6a488035 | 91 | |
3860cf72 E |
92 | {* Previous and Next contact navigation when accessing contact summary from search results. *} |
93 | {if $nextPrevError} | |
94 | <li class="crm-next-action"> | |
95 | {help id="id-next-prev-buttons"} | |
96 | </li> | |
97 | {else} | |
98 | {if $nextContactID} | |
99 | {assign var='viewParams' value=$urlParams|cat:"&cid=$nextContactID"} | |
100 | <li class="crm-next-action"> | |
101 | <a href="{crmURL p='civicrm/contact/view' q=$viewParams}" class="view button" title="{$nextContactName}"> | |
52604b19 | 102 | <span title="{$nextContactName}"><div class="icon ui-icon-carat-1-e"></div>{ts}Next{/ts}</span> |
3860cf72 E |
103 | </a> |
104 | </li> | |
105 | {/if} | |
106 | {if $prevContactID} | |
107 | {assign var='viewParams' value=$urlParams|cat:"&cid=$prevContactID"} | |
108 | <li class="crm-previous-action"> | |
109 | <a href="{crmURL p='civicrm/contact/view' q=$viewParams}" class="view button" title="{$prevContactName}"> | |
52604b19 | 110 | <span title="{$prevContactName}"><div class="icon ui-icon-carat-1-w"></div>{ts}Previous{/ts}</span> |
3860cf72 E |
111 | </a> |
112 | </li> | |
113 | {/if} | |
114 | {/if} | |
6a488035 | 115 | |
3860cf72 | 116 | {if !empty($groupOrganizationUrl)} |
6a488035 | 117 | <li class="crm-contact-associated-groups"> |
3860cf72 | 118 | <a href="{$groupOrganizationUrl}" class="associated-groups button" title="{ts}Associated Multi-Org Group{/ts}"> |
6a488035 | 119 | <span><div class="icon associated-groups-icon"></div>{ts}Associated Multi-Org Group{/ts}</span> |
3860cf72 | 120 | </a> |
6a488035 | 121 | </li> |
3860cf72 | 122 | {/if} |
6a488035 TO |
123 | </ul> |
124 | <div class="clear"></div> | |
3860cf72 | 125 | </div><!-- .crm-actions-ribbon --> |
46d2738c | 126 | {/if} |
6a488035 TO |
127 | |
128 | <div class="crm-block crm-content-block crm-contact-page crm-inline-edit-container"> | |
58b65bf6 | 129 | <div id="mainTabContainer"> |
3860cf72 | 130 | <ul class="crm-contact-tabs-list"> |
ecc20f0e | 131 | <li id="tab_summary" class="crm-tab-button ui-corner-all"> |
3860cf72 E |
132 | <a href="#contact-summary" title="{ts}Summary{/ts}"> |
133 | <span> </span> {ts}Summary{/ts} | |
ecc20f0e | 134 | <em></em> |
3860cf72 E |
135 | </a> |
136 | </li> | |
137 | {foreach from=$allTabs key=tabName item=tabValue} | |
4b628e67 | 138 | <li id="tab_{$tabValue.id}" class="crm-tab-button ui-corner-all crm-count-{$tabValue.count}{if isset($tabValue.class)} {$tabValue.class}{/if}"> |
3860cf72 | 139 | <a href="{$tabValue.url}" title="{$tabValue.title}"> |
a97040f5 CW |
140 | {$tabValue.title} |
141 | {if empty($tabValue.hideCount)}<em>{$tabValue.count}</em>{/if} | |
3860cf72 E |
142 | </a> |
143 | </li> | |
144 | {/foreach} | |
145 | </ul> | |
6a488035 | 146 | |
3860cf72 E |
147 | <div id="contact-summary" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> |
148 | {if (isset($hookContentPlacement) and ($hookContentPlacement neq 3)) or empty($hookContentPlacement)} | |
6a488035 | 149 | |
3860cf72 E |
150 | {if !empty($hookContent) and isset($hookContentPlacement) and $hookContentPlacement eq 2} |
151 | {include file="CRM/Contact/Page/View/SummaryHook.tpl"} | |
152 | {/if} | |
6a488035 | 153 | |
3860cf72 E |
154 | <div class="contactTopBar contact_panel"> |
155 | <div class="contactCardLeft"> | |
6365a087 E |
156 | {crmRegion name="contact-basic-info-left"} |
157 | <div class="crm-summary-contactinfo-block"> | |
158 | <div class="crm-summary-block" id="contactinfo-block"> | |
159 | {include file="CRM/Contact/Page/Inline/ContactInfo.tpl"} | |
160 | </div> | |
3860cf72 | 161 | </div> |
6365a087 | 162 | {/crmRegion} |
3860cf72 E |
163 | </div> <!-- end of left side --> |
164 | <div class="contactCardRight"> | |
6365a087 | 165 | {crmRegion name="contact-basic-info-right"} |
444cd89f | 166 | {if !empty($imageURL)} |
167 | <div id="crm-contact-thumbnail"> | |
168 | {include file="CRM/Contact/Page/ContactImage.tpl"} | |
169 | </div> | |
170 | {/if} | |
6365a087 E |
171 | <div class="{if !empty($imageURL)} float-left{/if}"> |
172 | <div class="crm-clear crm-summary-block"> | |
173 | <div class="crm-summary-row"> | |
174 | <div class="crm-label" id="tagLink"> | |
444cd89f | 175 | <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$contactId&selectedChild=tag"}" |
176 | title="{ts}Edit Tags{/ts}">{ts}Tags{/ts}</a> | |
6a488035 | 177 | </div> |
6365a087 E |
178 | <div class="crm-content" id="tags">{$contactTag}</div> |
179 | </div> | |
180 | <div class="crm-summary-row"> | |
181 | <div class="crm-label">{ts}Contact Type{/ts}</div> | |
182 | <div class="crm-content crm-contact_type_label"> | |
183 | {if isset($contact_type_label)}{$contact_type_label}{/if} | |
6a488035 | 184 | </div> |
6365a087 E |
185 | </div> |
186 | <div class="crm-summary-row"> | |
444cd89f | 187 | <div class="crm-label"> |
188 | {ts}CiviCRM ID{/ts}{if !empty($userRecordUrl)} / {ts}User ID{/ts}{/if} | |
6a488035 | 189 | </div> |
444cd89f | 190 | <div class="crm-content"> |
191 | <span class="crm-contact-contact_id">{$contactId}</span> | |
192 | {if !empty($userRecordUrl)} | |
193 | <span class="crm-contact-user_record_id"> | |
194 | / <a title="View user record" class="user-record-link" | |
195 | href="{$userRecordUrl}">{$userRecordId}</a> | |
196 | </span> | |
6a488035 | 197 | {/if} |
444cd89f | 198 | </div> |
6365a087 | 199 | </div> |
444cd89f | 200 | <div class="crm-summary-row"> |
201 | <div class="crm-label">{ts}External ID{/ts}</div> | |
202 | <div class="crm-content crm-contact_external_identifier_label"> | |
203 | {if isset($external_identifier)}{$external_identifier}{/if} | |
204 | </div> | |
6365a087 | 205 | </div> |
3860cf72 E |
206 | </div> |
207 | </div> | |
6365a087 | 208 | {/crmRegion} |
3860cf72 | 209 | </div> |
444cd89f | 210 | <!-- end of right side --> |
3860cf72 E |
211 | </div> |
212 | <div class="contact_details"> | |
213 | <div class="contact_panel"> | |
214 | <div class="contactCardLeft"> | |
6365a087 E |
215 | {crmRegion name="contact-details-left"} |
216 | <div > | |
217 | {if $showEmail} | |
218 | <div class="crm-summary-email-block crm-summary-block" id="email-block"> | |
219 | {include file="CRM/Contact/Page/Inline/Email.tpl"} | |
220 | </div> | |
221 | {/if} | |
222 | {if $showWebsite} | |
223 | <div class="crm-summary-website-block crm-summary-block" id="website-block"> | |
224 | {include file="CRM/Contact/Page/Inline/Website.tpl"} | |
225 | </div> | |
226 | {/if} | |
227 | </div> | |
228 | {/crmRegion} | |
3860cf72 | 229 | </div><!-- #contactCardLeft --> |
aafd773a | 230 | |
3860cf72 | 231 | <div class="contactCardRight"> |
6365a087 E |
232 | {crmRegion name="contact-details-right"} |
233 | <div> | |
234 | {if $showPhone} | |
235 | <div class="crm-summary-phone-block crm-summary-block" id="phone-block"> | |
236 | {include file="CRM/Contact/Page/Inline/Phone.tpl"} | |
237 | </div> | |
238 | {/if} | |
239 | {if $showIM} | |
240 | <div class="crm-summary-im-block crm-summary-block" id="im-block"> | |
241 | {include file="CRM/Contact/Page/Inline/IM.tpl"} | |
242 | </div> | |
243 | {/if} | |
244 | {if $showOpenID} | |
245 | <div class="crm-summary-openid-block crm-summary-block" id="openid-block"> | |
246 | {include file="CRM/Contact/Page/Inline/OpenID.tpl"} | |
247 | </div> | |
248 | {/if} | |
249 | </div> | |
250 | {/crmRegion} | |
3860cf72 | 251 | </div><!-- #contactCardRight --> |
6a488035 | 252 | |
3860cf72 E |
253 | <div class="clear"></div> |
254 | </div><!-- #contact_panel --> | |
255 | {if $showAddress} | |
256 | <div class="contact_panel"> | |
257 | {assign var='locationIndex' value=1} | |
258 | {if $address} | |
259 | {foreach from=$address item=add key=locationIndex} | |
260 | <div class="{if $locationIndex is odd}contactCardLeft{else}contactCardRight{/if} crm-address_{$locationIndex} crm-address-block crm-summary-block"> | |
261 | {include file="CRM/Contact/Page/Inline/Address.tpl"} | |
262 | </div> | |
263 | {/foreach} | |
264 | {assign var='locationIndex' value=$locationIndex+1} | |
265 | {/if} | |
266 | {* add new link *} | |
267 | {if $permission EQ 'edit'} | |
268 | {assign var='add' value=0} | |
269 | <div class="{if $locationIndex is odd}contactCardLeft{else}contactCardRight{/if} crm-address-block crm-summary-block"> | |
270 | {include file="CRM/Contact/Page/Inline/Address.tpl"} | |
271 | </div> | |
272 | {/if} | |
6a488035 | 273 | |
3860cf72 E |
274 | </div> <!-- end of contact panel --> |
275 | {/if} | |
276 | <div class="contact_panel"> | |
277 | {if $showCommunicationPreferences} | |
278 | <div class="contactCardLeft"> | |
279 | <div class="crm-summary-comm-pref-block"> | |
280 | <div class="crm-summary-block" id="communication-pref-block" > | |
281 | {include file="CRM/Contact/Page/Inline/CommunicationPreferences.tpl"} | |
6a488035 TO |
282 | </div> |
283 | </div> | |
3860cf72 E |
284 | </div> <!-- contactCardLeft --> |
285 | {/if} | |
286 | {if $contact_type eq 'Individual' AND $showDemographics} | |
287 | <div class="contactCardRight"> | |
288 | <div class="crm-summary-demographic-block"> | |
289 | <div class="crm-summary-block" id="demographic-block"> | |
290 | {include file="CRM/Contact/Page/Inline/Demographics.tpl"} | |
291 | </div> | |
292 | </div> | |
293 | </div> <!-- contactCardRight --> | |
294 | {/if} | |
295 | <div class="clear"></div> | |
296 | <div class="separator"></div> | |
297 | </div> <!-- contact panel --> | |
298 | </div><!--contact_details--> | |
aafd773a | 299 | |
3860cf72 E |
300 | {if $showCustomData} |
301 | <div id="customFields"> | |
302 | <div class="contact_panel"> | |
303 | <div class="contactCardLeft"> | |
304 | {include file="CRM/Contact/Page/View/CustomDataView.tpl" side='1'} | |
305 | </div><!--contactCardLeft--> | |
306 | <div class="contactCardRight"> | |
307 | {include file="CRM/Contact/Page/View/CustomDataView.tpl" side='0'} | |
308 | </div> | |
309 | ||
310 | <div class="clear"></div> | |
311 | </div> | |
312 | </div> | |
313 | {/if} | |
314 | ||
315 | {if !empty($hookContent) and isset($hookContentPlacement) and $hookContentPlacement eq 1} | |
316 | {include file="CRM/Contact/Page/View/SummaryHook.tpl"} | |
317 | {/if} | |
318 | {else} | |
319 | {include file="CRM/Contact/Page/View/SummaryHook.tpl"} | |
320 | {/if} | |
6a488035 | 321 | </div> |
3860cf72 | 322 | <div class="clear"></div> |
6a488035 TO |
323 | </div> |
324 | <div class="clear"></div> | |
325 | </div><!-- /.crm-content-block --> | |
6a488035 TO |
326 | {/if} |
327 | ||
328 | {* CRM-10560 *} | |
329 | {literal} | |
330 | <script type="text/javascript"> | |
3cc60a06 | 331 | CRM.$(function($) { |
6a488035 TO |
332 | $('.crm-inline-edit-container').crmFormContactLock({ |
333 | ignoreLabel: "{/literal}{ts escape='js'}Ignore{/ts}{literal}", | |
334 | saveAnywayLabel: "{/literal}{ts escape='js'}Save Anyway{/ts}{literal}", | |
335 | reloadLabel: "{/literal}{ts escape='js'}Reload Page{/ts}{literal}" | |
6027131b | 336 | }); |
6a488035 TO |
337 | }); |
338 | </script> | |
339 | {/literal} |