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