CRM-13257 whitespace -tabs to double space
[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 {if !empty($groupOrganizationUrl)}
122 <li class="crm-contact-associated-groups">
123 <a href="{$groupOrganizationUrl}" class="associated-groups button" title="{ts}Associated Multi-Org Group{/ts}">
124 <span><div class="icon associated-groups-icon"></div>{ts}Associated Multi-Org Group{/ts}</span>
125 </a>
126 </li>
127 {/if}
128 </ul>
129 <div class="clear"></div>
130 </div><!-- .crm-actions-ribbon -->
131 {/if}
132
133 <div class="crm-block crm-content-block crm-contact-page crm-inline-edit-container">
134 <div id="mainTabContainer" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
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>&nbsp;</em>
140 </a>
141 </li>
142 {foreach from=$allTabs key=tabName item=tabValue}
143 <li id="tab_{$tabValue.id}" class="crm-tab-button crm-count-{$tabValue.count}">
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>
151
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)}
154
155 {if !empty($hookContent) and isset($hookContentPlacement) and $hookContentPlacement eq 2}
156 {include file="CRM/Contact/Page/View/SummaryHook.tpl"}
157 {/if}
158
159 <div class="contactTopBar contact_panel">
160 <div class="contactCardLeft">
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>
166 </div>
167 {/crmRegion}
168 </div> <!-- end of left side -->
169 <div class="contactCardRight">
170 {crmRegion name="contact-basic-info-right"}
171 {if !empty($imageURL)}
172 <div id="crm-contact-thumbnail">
173 {include file="CRM/Contact/Page/ContactImage.tpl"}
174 </div>
175 {/if}
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">
180 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$contactId&selectedChild=tag"}" title="{ts}Edit Tags{/ts}">{ts}Tags{/ts}</a>
181 </div>
182 <div class="crm-content" id="tags">{$contactTag}</div>
183 </div>
184 <div class="crm-summary-row">
185 <div class="crm-label">{ts}Contact Type{/ts}</div>
186 <div class="crm-content crm-contact_type_label">
187 {if isset($contact_type_label)}{$contact_type_label}{/if}
188 </div>
189 </div>
190 <div class="crm-summary-row">
191 <div class="crm-label">
192 {ts}CiviCRM ID{/ts}{if !empty($userRecordUrl)} / {ts}User ID{/ts}{/if}
193 </div>
194 <div class="crm-content">
195 <span class="crm-contact-contact_id">{$contactId}</span>
196 {if !empty($userRecordUrl)}
197 <span class="crm-contact-user_record_id">
198 &nbsp;/&nbsp;<a title="View user record" class="user-record-link" href="{$userRecordUrl}">{$userRecordId}</a>
199 </span>
200 {/if}
201 </div>
202 </div>
203 </div>
204 {/crmRegion}
205 </div>
206 </div> <!-- end of right side -->
207 </div>
208 <div class="contact_details">
209 <div class="contact_panel">
210 <div class="contactCardLeft">
211 {crmRegion name="contact-details-left"}
212 <div >
213 {if $showEmail}
214 <div class="crm-summary-email-block crm-summary-block" id="email-block">
215 {include file="CRM/Contact/Page/Inline/Email.tpl"}
216 </div>
217 {/if}
218 {if $showWebsite}
219 <div class="crm-summary-website-block crm-summary-block" id="website-block">
220 {include file="CRM/Contact/Page/Inline/Website.tpl"}
221 </div>
222 {/if}
223 </div>
224 {/crmRegion}
225 </div><!-- #contactCardLeft -->
226
227 <div class="contactCardRight">
228 {crmRegion name="contact-details-right"}
229 <div>
230 {if $showPhone}
231 <div class="crm-summary-phone-block crm-summary-block" id="phone-block">
232 {include file="CRM/Contact/Page/Inline/Phone.tpl"}
233 </div>
234 {/if}
235 {if $showIM}
236 <div class="crm-summary-im-block crm-summary-block" id="im-block">
237 {include file="CRM/Contact/Page/Inline/IM.tpl"}
238 </div>
239 {/if}
240 {if $showOpenID}
241 <div class="crm-summary-openid-block crm-summary-block" id="openid-block">
242 {include file="CRM/Contact/Page/Inline/OpenID.tpl"}
243 </div>
244 {/if}
245 </div>
246 {/crmRegion}
247 </div><!-- #contactCardRight -->
248
249 <div class="clear"></div>
250 </div><!-- #contact_panel -->
251 {if $showAddress}
252 <div class="contact_panel">
253 {assign var='locationIndex' value=1}
254 {if $address}
255 {foreach from=$address item=add key=locationIndex}
256 <div class="{if $locationIndex is odd}contactCardLeft{else}contactCardRight{/if} crm-address_{$locationIndex} crm-address-block crm-summary-block">
257 {include file="CRM/Contact/Page/Inline/Address.tpl"}
258 </div>
259 {/foreach}
260 {assign var='locationIndex' value=$locationIndex+1}
261 {/if}
262 {* add new link *}
263 {if $permission EQ 'edit'}
264 {assign var='add' value=0}
265 <div class="{if $locationIndex is odd}contactCardLeft{else}contactCardRight{/if} crm-address-block crm-summary-block">
266 {include file="CRM/Contact/Page/Inline/Address.tpl"}
267 </div>
268 {/if}
269
270 </div> <!-- end of contact panel -->
271 {/if}
272 <div class="contact_panel">
273 {if $showCommunicationPreferences}
274 <div class="contactCardLeft">
275 <div class="crm-summary-comm-pref-block">
276 <div class="crm-summary-block" id="communication-pref-block" >
277 {include file="CRM/Contact/Page/Inline/CommunicationPreferences.tpl"}
278 </div>
279 </div>
280 </div> <!-- contactCardLeft -->
281 {/if}
282 {if $contact_type eq 'Individual' AND $showDemographics}
283 <div class="contactCardRight">
284 <div class="crm-summary-demographic-block">
285 <div class="crm-summary-block" id="demographic-block">
286 {include file="CRM/Contact/Page/Inline/Demographics.tpl"}
287 </div>
288 </div>
289 </div> <!-- contactCardRight -->
290 {/if}
291 <div class="clear"></div>
292 <div class="separator"></div>
293 </div> <!-- contact panel -->
294 </div><!--contact_details-->
295
296 {if $showCustomData}
297 <div id="customFields">
298 <div class="contact_panel">
299 <div class="contactCardLeft">
300 {include file="CRM/Contact/Page/View/CustomDataView.tpl" side='1'}
301 </div><!--contactCardLeft-->
302 <div class="contactCardRight">
303 {include file="CRM/Contact/Page/View/CustomDataView.tpl" side='0'}
304 </div>
305
306 <div class="clear"></div>
307 </div>
308 </div>
309 {/if}
310
311 {if !empty($hookContent) and isset($hookContentPlacement) and $hookContentPlacement eq 1}
312 {include file="CRM/Contact/Page/View/SummaryHook.tpl"}
313 {/if}
314 {else}
315 {include file="CRM/Contact/Page/View/SummaryHook.tpl"}
316 {/if}
317 </div>
318 <div class="clear"></div>
319 </div>
320 <div class="clear"></div>
321 </div><!-- /.crm-content-block -->
322
323 <script type="text/javascript">
324 {literal}
325 cj(function($) {
326 //explicitly stop spinner
327 function stopSpinner( ) {
328 $('li.crm-tab-button span').text(' ');
329 }
330 {/literal}
331 var selectedTab = '{if !empty($selectedChild)}{$selectedChild}{else}summary{/if}';
332 var tabIndex = $('#tab_' + selectedTab).prevAll().length;
333 var spinnerImage = '<img src="{$config->resourceBase}i/loading.gif" style="width:10px;height:10px"/>';
334 {literal}
335 $("#mainTabContainer").tabs({ selected: tabIndex, spinner: spinnerImage, cache: true, load: stopSpinner});
336 $(".crm-tab-button").addClass("ui-corner-bottom");
337 $().crmAccordions();
338
339 $('body').click(function() {
340 cj('#crm-contact-actions-list').hide();
341 });
342 });
343 {/literal}
344 </script>
345 {/if}
346
347 {* CRM-10560 *}
348 {literal}
349 <script type="text/javascript">
350 cj(document).ready(function($) {
351 $('.crm-inline-edit-container').crmFormContactLock({
352 ignoreLabel: "{/literal}{ts escape='js'}Ignore{/ts}{literal}",
353 saveAnywayLabel: "{/literal}{ts escape='js'}Save Anyway{/ts}{literal}",
354 reloadLabel: "{/literal}{ts escape='js'}Reload Page{/ts}{literal}"
355 });
356 //Enhance styling of "View Contact" tabs to indicate empty/non-empty tags
357 $('div#mainTabContainer ul').find('li').each(function(n){
358 if($(this).find('em').html()==0){
359 $(this).addClass("disabled");
360 }
361 });
362 });
363 </script>
364 {/literal}
365
366 {* jQuery validate *}
367 {include file="CRM/Form/validate.tpl" form=0}