Skip to content
Snippets Groups Projects
Commit db9e73fe authored by Kurund Jalmi's avatar Kurund Jalmi
Browse files

Merge pull request #1183 from davecivicrm/CRM-12735

Crm 12735
parents df692b28 8ccfdb30
Branches
Tags
No related merge requests found
......@@ -41,33 +41,34 @@
<div class="crm-actions-ribbon">
<ul id="actions">
{assign var='urlParams' value="reset=1"}
{if $searchKey}
{assign var='urlParams' value=$urlParams|cat:"&key=$searchKey"}
{/if}
{if $context}
{assign var='urlParams' value=$urlParams|cat:"&context=$context"}
{/if}
{* Include the Actions and Edit buttons if user has 'edit' permission and contact is NOT in trash. *}
{if $permission EQ 'edit' and !$isDeleted}
{if call_user_func(array('CRM_Core_Permission','check'), 'access CiviCRM')}
<li class="crm-contact-activity crm-summary-block">
{include file="CRM/Contact/Page/Inline/Actions.tpl"}
</li>
{assign var='urlParams' value="reset=1"}
{if $searchKey}
{assign var='urlParams' value=$urlParams|cat:"&key=$searchKey"}
{/if}
{if call_user_func(array('CRM_Core_Permission','check'), 'edit my contact')}
<li>
{assign var='editParams' value=$urlParams|cat:"&action=update&cid=$contactId"}
<a href="{crmURL p='civicrm/contact/add' q=$editParams}" class="edit button" title="{ts}Edit{/ts}">
<span><div class="icon edit-icon"></div>{ts}Edit{/ts}</span>
</a>
</li>
{if $context}
{assign var='urlParams' value=$urlParams|cat:"&context=$context"}
{/if}
{* CRM-12735 - Conditionally include the Actions and Edit buttons if contact is NOT in trash.*}
{if !$isDeleted}
{if call_user_func(array('CRM_Core_Permission','check'), 'access CiviCRM')}
<li class="crm-contact-activity crm-summary-block">
{include file="CRM/Contact/Page/Inline/Actions.tpl"}
</li>
{/if}
{* Include Edit button if contact has 'edit contacts' permission OR user is viewing their own contact AND has 'edit my contact' permission. *}
{if $permission EQ 'edit' && call_user_func(array('CRM_Core_Permission','check'), 'edit my contact')}
<li>
{assign var='editParams' value=$urlParams|cat:"&action=update&cid=$contactId"}
<a href="{crmURL p='civicrm/contact/add' q=$editParams}" class="edit button" title="{ts}Edit{/ts}">
<span><div class="icon edit-icon"></div>{ts}Edit{/ts}</span>
</a>
</li>
{/if}
{/if}
{* Check for permissions to provide Restore and Delete Permanently buttons for contacts that are in the trash. *}
{if (call_user_func(array('CRM_Core_Permission','check'), 'access deleted contacts') and
{* Check for permissions to provide Restore and Delete Permanently buttons for contacts that are in the trash. *}
{if (call_user_func(array('CRM_Core_Permission','check'), 'access deleted contacts') and
$is_deleted)}
<li class="crm-contact-restore">
<a href="{crmURL p='civicrm/contact/view/delete' q="reset=1&cid=$contactId&restore=1"}" class="delete button" title="{ts}Restore{/ts}">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment