From: Guanhuan Chen Date: Wed, 13 May 2015 13:05:46 +0000 (+0100) Subject: Fixed button display based on permission X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a664e7b35445262c5b4fc5ed8288f7defe68d2ae;p=civicrm-core.git Fixed button display based on permission --- diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index d8756cf2ba..2159844e12 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -823,7 +823,7 @@ class CRM_Core_Permission { $prefix . ts('edit message templates'), ), 'view my invoices' => array( - $prefix . ts('download my invoices'), + $prefix . ts('view my invoices'), ts('Allow users to view/ download their own invoices'), ), ); diff --git a/templates/CRM/Contribute/Page/UserDashboard.tpl b/templates/CRM/Contribute/Page/UserDashboard.tpl index ac43bd615a..33a1a32b51 100644 --- a/templates/CRM/Contribute/Page/UserDashboard.tpl +++ b/templates/CRM/Contribute/Page/UserDashboard.tpl @@ -53,16 +53,19 @@ {if $invoicing && $invoices} {if $row.contribution_status_name != 'Cancelled'} - {assign var='id' value=$row.contribution_id} - {assign var='contact_id' value=$row.contact_id} + {assign var='id' value=$row.contribution_id} + {assign var='contact_id' value=$row.contact_id} {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id"} - - {if $row.contribution_status != 'Refunded'} - {ts}Print Invoice{/ts} - {else} - {ts}Print Invoice and Credit Note{/ts} - {/if} - + {if call_user_func(array('CRM_Core_Permission','check'), 'view my invoices') OR call_user_func(array('CRM_Core_Permission','check'), 'access CiviContribute')} + + + {if $row.contribution_status != 'Refunded'} + {ts}Print Invoice{/ts} + {else} + {ts}Print Invoice and Credit Note{/ts} + {/if} + + {/if} {else}