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