From af76af44200711449c065a20317fdbdafbe40b8b Mon Sep 17 00:00:00 2001 From: Civiware Solutions Date: Tue, 3 Jul 2018 03:00:58 +0530 Subject: [PATCH] Updated error message and suppressed disable link --- deleterelationshipperm.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deleterelationshipperm.php b/deleterelationshipperm.php index c2436f1..41bae74 100644 --- a/deleterelationshipperm.php +++ b/deleterelationshipperm.php @@ -155,7 +155,7 @@ function deleterelationshipperm_civicrm_links($op, $objectName, $objectId, &$lin if ($op == 'relationship.selector.row' && $objectName == 'Relationship') { if (!CRM_Core_Permission::check('delete relationships')) { foreach ($links as $key => $link) { - if ($link['name'] == 'Delete') { + if (in_array($link['name'], ['Delete', 'Disable'])) { unset($links[$key]); } } @@ -194,7 +194,7 @@ function _deleterelationshipperm_civicrm_check_permission($errorType = NULL) { if (CRM_Core_Permission::check('delete relationships')) { return FALSE; } - $message = ts('You do not have the necessary permission to delete this relationship.'); + $message = ts('You do not have permission to delete relationships. Please speak to an administrator..'); if ($errorType == 'exception') { throw new API_Exception($message); }