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