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