Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2013-11-03-17-31-47
[civicrm-core.git] / templates / CRM / Contact / Page / View / Summary.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
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}
28 {include file="CRM/Contact/Form/Contact.tpl"}
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">
38 {include file="CRM/Contact/Page/Inline/ContactName.tpl"}
39 </div>
40 </div>
41
42 {if !$summaryPrint}
43 <div class="crm-actions-ribbon">
44 <ul id="actions">
45 {assign var='urlParams' value="reset=1"}
46 {if $searchKey}
47 {assign var='urlParams' value=$urlParams|cat:"&key=$searchKey"}
48 {/if}
49 {if $context}
50 {assign var='urlParams' value=$urlParams|cat:"&context=$context"}
51 {/if}
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>
59 {/if}
60 {* Include Edit button if contact has 'edit contacts' permission OR user is viewing their own contact AND has 'edit my contact' permission. *}
61 {if $permission EQ 'edit' && call_user_func(array('CRM_Core_Permission','check'), 'edit my contact')}
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}
70
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
73 $is_deleted)}
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>
79
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>
86 {/if}
87
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}
96
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"}&nbsp;
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}
120
121
122 {if !empty($groupOrganizationUrl)}
123 <li class="crm-contact-associated-groups">
124 <a href="{$groupOrganizationUrl}" class="associated-groups button" title="{ts}Associated Multi-Org Group{/ts}">
125 <span><div class="icon associated-groups-icon"></div>{ts}Associated Multi-Org Group{/ts}</span>
126 </a>
127 </li>
128 {/if}
129 </ul>
130 <div class="clear"></div>
131 </div><!-- .crm-actions-ribbon -->
132 {/if}
133
134 <div class="crm-block crm-content-block crm-contact-page crm-inline-edit-container">
135 <div id="mainTabContainer" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
136 <ul class="crm-contact-tabs-list">
137 <li id="tab_summary" class="crm-tab-button">
138 <a href="#contact-summary" title="{ts}Summary{/ts}">
139 <span> </span> {ts}Summary{/ts}
140 <em>&nbsp;</em>
141 </a>
142 </li>
143 {foreach from=$allTabs key=tabName item=tabValue}
144 <li id="tab_{$tabValue.id}" class="crm-tab-button crm-count-{$tabValue.count}">
145 <a href="{$tabValue.url}" title="{$tabValue.title}">
146 <span> </span> {$tabValue.title}
147 <em>{$tabValue.count}</em>
148 </a>
149 </li>
150 {/foreach}
151 </ul>
152
153 <div id="contact-summary" class="ui-tabs-panel ui-widget-content ui-corner-bottom">
154 {if (isset($hookContentPlacement) and ($hookContentPlacement neq 3)) or empty($hookContentPlacement)}
155
156 {if !empty($hookContent) and isset($hookContentPlacement) and $hookContentPlacement eq 2}
157 {include file="CRM/Contact/Page/View/SummaryHook.tpl"}
158 {/if}
159
160 <div class="contactTopBar contact_panel">
161 <div class="contactCardLeft">
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>
166 </div>
167 </div> <!-- end of left side -->
168 <div class="contactCardRight">
169 {if !empty($imageURL)}
170 <div id="crm-contact-thumbnail">
171 {include file="CRM/Contact/Page/ContactImage.tpl"}
172 </div>
173 {/if}
174 <div class="{if !empty($imageURL)} float-left{/if}">
175 <div class="crm-clear crm-summary-block">
176 <div class="crm-summary-row">
177 <div class="crm-label" id="tagLink">
178 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$contactId&selectedChild=tag"}" title="{ts}Edit Tags{/ts}">{ts}Tags{/ts}</a>
179 </div>
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}
186 </div>
187 </div>
188
189 <div class="crm-summary-row">
190 <div class="crm-label">
191 {ts}CiviCRM ID{/ts}{if !empty($userRecordUrl)} / {ts}User ID{/ts}{/if}
192 </div>
193 <div class="crm-content">
194 <span class="crm-contact-contact_id">{$contactId}</span>
195 {if !empty($userRecordUrl)}
196 <span class="crm-contact-user_record_id">
197 &nbsp;/&nbsp;<a title="View user record" class="user-record-link" href="{$userRecordUrl}">{$userRecordId}</a>
198 </span>
199 {/if}
200 </div>
201 </div>
202 </div>
203 <div class="crm-summary-row">
204 <div class="crm-label">{ts}External ID{/ts}</div>
205 <div class="crm-content crm-contact_external_identifier_label">
206 {if isset($external_identifier)}{$external_identifier}{/if}
207 </div>
208 </div>
209 </div>
210
211 </div> <!-- end of right side -->
212 </div>
213 <div class="contact_details">
214 <div class="contact_panel">
215 <div class="contactCardLeft">
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 </div><!-- #contactCardLeft -->
229
230 <div class="contactCardRight">
231 <div >
232 {if $showPhone}
233 <div class="crm-summary-phone-block crm-summary-block" id="phone-block">
234 {include file="CRM/Contact/Page/Inline/Phone.tpl"}
235 </div>
236 {/if}
237 {if $showIM}
238 <div class="crm-summary-im-block crm-summary-block" id="im-block">
239 {include file="CRM/Contact/Page/Inline/IM.tpl"}
240 </div>
241 {/if}
242 {if $showOpenID}
243 <div class="crm-summary-openid-block crm-summary-block" id="openid-block">
244 {include file="CRM/Contact/Page/Inline/OpenID.tpl"}
245 </div>
246 {/if}
247 </div>
248 </div><!-- #contactCardRight -->
249
250 <div class="clear"></div>
251 </div><!-- #contact_panel -->
252 {if $showAddress}
253 <div class="contact_panel">
254 {assign var='locationIndex' value=1}
255 {if $address}
256 {foreach from=$address item=add key=locationIndex}
257 <div class="{if $locationIndex is odd}contactCardLeft{else}contactCardRight{/if} crm-address_{$locationIndex} crm-address-block crm-summary-block">
258 {include file="CRM/Contact/Page/Inline/Address.tpl"}
259 </div>
260 {/foreach}
261 {assign var='locationIndex' value=$locationIndex+1}
262 {/if}
263 {* add new link *}
264 {if $permission EQ 'edit'}
265 {assign var='add' value=0}
266 <div class="{if $locationIndex is odd}contactCardLeft{else}contactCardRight{/if} crm-address-block crm-summary-block">
267 {include file="CRM/Contact/Page/Inline/Address.tpl"}
268 </div>
269 {/if}
270
271 </div> <!-- end of contact panel -->
272 {/if}
273 <div class="contact_panel">
274 {if $showCommunicationPreferences}
275 <div class="contactCardLeft">
276 <div class="crm-summary-comm-pref-block">
277 <div class="crm-summary-block" id="communication-pref-block" >
278 {include file="CRM/Contact/Page/Inline/CommunicationPreferences.tpl"}
279 </div>
280 </div>
281 </div> <!-- contactCardLeft -->
282 {/if}
283 {if $contact_type eq 'Individual' AND $showDemographics}
284 <div class="contactCardRight">
285 <div class="crm-summary-demographic-block">
286 <div class="crm-summary-block" id="demographic-block">
287 {include file="CRM/Contact/Page/Inline/Demographics.tpl"}
288 </div>
289 </div>
290 </div> <!-- contactCardRight -->
291 {/if}
292 <div class="clear"></div>
293 <div class="separator"></div>
294 </div> <!-- contact panel -->
295 </div><!--contact_details-->
296
297 {if $showCustomData}
298 <div id="customFields">
299 <div class="contact_panel">
300 <div class="contactCardLeft">
301 {include file="CRM/Contact/Page/View/CustomDataView.tpl" side='1'}
302 </div><!--contactCardLeft-->
303
304 <div class="contactCardRight">
305 {include file="CRM/Contact/Page/View/CustomDataView.tpl" side='0'}
306 </div>
307
308 <div class="clear"></div>
309 </div>
310 </div>
311 {/if}
312
313 {if !empty($hookContent) and isset($hookContentPlacement) and $hookContentPlacement eq 1}
314 {include file="CRM/Contact/Page/View/SummaryHook.tpl"}
315 {/if}
316 {else}
317 {include file="CRM/Contact/Page/View/SummaryHook.tpl"}
318 {/if}
319 </div>
320 <div class="clear"></div>
321 </div>
322 <div class="clear"></div>
323 </div><!-- /.crm-content-block -->
324
325 <script type="text/javascript">
326 {literal}
327 cj(function($) {
328 //explicitly stop spinner
329 function stopSpinner( ) {
330 $('li.crm-tab-button span').text(' ');
331 }
332 {/literal}
333 var selectedTab = '{if !empty($selectedChild)}{$selectedChild}{else}summary{/if}';
334 var tabIndex = $('#tab_' + selectedTab).prevAll().length;
335 var spinnerImage = '<img src="{$config->resourceBase}i/loading.gif" style="width:10px;height:10px"/>';
336 {literal}
337 $("#mainTabContainer").tabs({ selected: tabIndex, spinner: spinnerImage, cache: true, load: stopSpinner});
338 $(".crm-tab-button").addClass("ui-corner-bottom");
339 $().crmAccordions();
340
341 $('body').click(function() {
342 cj('#crm-contact-actions-list').hide();
343 });
344 });
345 {/literal}
346 </script>
347 {/if}
348
349 {* CRM-10560 *}
350 {literal}
351 <script type="text/javascript">
352 cj(document).ready(function($) {
353 $('.crm-inline-edit-container').crmFormContactLock({
354 ignoreLabel: "{/literal}{ts escape='js'}Ignore{/ts}{literal}",
355 saveAnywayLabel: "{/literal}{ts escape='js'}Save Anyway{/ts}{literal}",
356 reloadLabel: "{/literal}{ts escape='js'}Reload Page{/ts}{literal}"
357 });
358 //Enhance styling of "View Contact" tabs to indicate empty/non-empty tags
359 $('div#mainTabContainer ul').find('li').each(function(n){
360 if($(this).find('em').html()==0){
361 $(this).addClass("disabled");
362 }
363 });
364 });
365 </script>
366 {/literal}
367
368 {* jQuery validate *}
369 {include file="CRM/Form/validate.tpl" form=0}