Merge remote-tracking branch 'upstream/4.3' into 4.3-master-2013-09-25-01-46-57
[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>
204
205 </div> <!-- end of right side -->
206 </div>
207 <div class="contact_details">
208 <div class="contact_panel">
209 <div class="contactCardLeft">
210 <div >
211 {if $showEmail}
212 <div class="crm-summary-email-block crm-summary-block" id="email-block">
213 {include file="CRM/Contact/Page/Inline/Email.tpl"}
214 </div>
215 {/if}
216 {if $showWebsite}
217 <div class="crm-summary-website-block crm-summary-block" id="website-block">
218 {include file="CRM/Contact/Page/Inline/Website.tpl"}
219 </div>
220 {/if}
221 </div>
222 </div><!-- #contactCardLeft -->
223
224 <div class="contactCardRight">
225 <div >
226 {if $showPhone}
227 <div class="crm-summary-phone-block crm-summary-block" id="phone-block">
228 {include file="CRM/Contact/Page/Inline/Phone.tpl"}
229 </div>
230 {/if}
231 {if $showIM}
232 <div class="crm-summary-im-block crm-summary-block" id="im-block">
233 {include file="CRM/Contact/Page/Inline/IM.tpl"}
234 </div>
235 {/if}
236 {if $showOpenID}
237 <div class="crm-summary-openid-block crm-summary-block" id="openid-block">
238 {include file="CRM/Contact/Page/Inline/OpenID.tpl"}
239 </div>
240 {/if}
241 </div>
242 </div><!-- #contactCardRight -->
243
244 <div class="clear"></div>
245 </div><!-- #contact_panel -->
246 {if $showAddress}
247 <div class="contact_panel">
248 {assign var='locationIndex' value=1}
249 {if $address}
250 {foreach from=$address item=add key=locationIndex}
251 <div class="{if $locationIndex is odd}contactCardLeft{else}contactCardRight{/if} crm-address_{$locationIndex} crm-address-block crm-summary-block">
252 {include file="CRM/Contact/Page/Inline/Address.tpl"}
253 </div>
254 {/foreach}
255 {assign var='locationIndex' value=$locationIndex+1}
256 {/if}
257 {* add new link *}
258 {if $permission EQ 'edit'}
259 {assign var='add' value=0}
260 <div class="{if $locationIndex is odd}contactCardLeft{else}contactCardRight{/if} crm-address-block crm-summary-block">
261 {include file="CRM/Contact/Page/Inline/Address.tpl"}
262 </div>
263 {/if}
264
265 </div> <!-- end of contact panel -->
266 {/if}
267 <div class="contact_panel">
268 {if $showCommunicationPreferences}
269 <div class="contactCardLeft">
270 <div class="crm-summary-comm-pref-block">
271 <div class="crm-summary-block" id="communication-pref-block" >
272 {include file="CRM/Contact/Page/Inline/CommunicationPreferences.tpl"}
273 </div>
274 </div>
275 </div> <!-- contactCardLeft -->
276 {/if}
277 {if $contact_type eq 'Individual' AND $showDemographics}
278 <div class="contactCardRight">
279 <div class="crm-summary-demographic-block">
280 <div class="crm-summary-block" id="demographic-block">
281 {include file="CRM/Contact/Page/Inline/Demographics.tpl"}
282 </div>
283 </div>
284 </div> <!-- contactCardRight -->
285 {/if}
286 <div class="clear"></div>
287 <div class="separator"></div>
288 </div> <!-- contact panel -->
289 </div><!--contact_details-->
290
291 {if $showCustomData}
292 <div id="customFields">
293 <div class="contact_panel">
294 <div class="contactCardLeft">
295 {include file="CRM/Contact/Page/View/CustomDataView.tpl" side='1'}
296 </div><!--contactCardLeft-->
297
298 <div class="contactCardRight">
299 {include file="CRM/Contact/Page/View/CustomDataView.tpl" side='0'}
300 </div>
301
302 <div class="clear"></div>
303 </div>
304 </div>
305 {/if}
306
307 {if !empty($hookContent) and isset($hookContentPlacement) and $hookContentPlacement eq 1}
308 {include file="CRM/Contact/Page/View/SummaryHook.tpl"}
309 {/if}
310 {else}
311 {include file="CRM/Contact/Page/View/SummaryHook.tpl"}
312 {/if}
313 </div>
314 <div class="clear"></div>
315 </div>
316 <div class="clear"></div>
317 </div><!-- /.crm-content-block -->
318
319 <script type="text/javascript">
320 {literal}
321 cj(function($) {
322 //explicitly stop spinner
323 function stopSpinner( ) {
324 $('li.crm-tab-button span').text(' ');
325 }
326 {/literal}
327 var selectedTab = '{if !empty($selectedChild)}{$selectedChild}{else}summary{/if}';
328 var tabIndex = $('#tab_' + selectedTab).prevAll().length;
329 var spinnerImage = '<img src="{$config->resourceBase}i/loading.gif" style="width:10px;height:10px"/>';
330 {literal}
331 $("#mainTabContainer").tabs({ selected: tabIndex, spinner: spinnerImage, cache: true, load: stopSpinner});
332 $(".crm-tab-button").addClass("ui-corner-bottom");
333 $().crmAccordions();
334
335 $('body').click(function() {
336 cj('#crm-contact-actions-list').hide();
337 });
338 });
339 {/literal}
340 </script>
341 {/if}
342
343 {* CRM-10560 *}
344 {literal}
345 <script type="text/javascript">
346 cj(document).ready(function($) {
347 $('.crm-inline-edit-container').crmFormContactLock({
348 ignoreLabel: "{/literal}{ts escape='js'}Ignore{/ts}{literal}",
349 saveAnywayLabel: "{/literal}{ts escape='js'}Save Anyway{/ts}{literal}",
350 reloadLabel: "{/literal}{ts escape='js'}Reload Page{/ts}{literal}"
351 });
352 //Enhance styling of "View Contact" tabs to indicate empty/non-empty tags
353 $('div#mainTabContainer ul').find('li').each(function(n){
354 if($(this).find('em').html()==0){
355 $(this).addClass("disabled");
356 }
357 });
358 });
359 </script>
360 {/literal}
361
362 {* jQuery validate *}
363 {include file="CRM/Form/validate.tpl" form=0}