Updated error message and suppressed disable link
This commit is contained in:
		@@ -155,7 +155,7 @@ function deleterelationshipperm_civicrm_links($op, $objectName, $objectId, &$lin
 | 
				
			|||||||
  if ($op == 'relationship.selector.row' && $objectName == 'Relationship') {
 | 
					  if ($op == 'relationship.selector.row' && $objectName == 'Relationship') {
 | 
				
			||||||
    if (!CRM_Core_Permission::check('delete relationships')) {
 | 
					    if (!CRM_Core_Permission::check('delete relationships')) {
 | 
				
			||||||
      foreach ($links as $key => $link) {
 | 
					      foreach ($links as $key => $link) {
 | 
				
			||||||
        if ($link['name'] == 'Delete') {
 | 
					        if (in_array($link['name'], ['Delete', 'Disable'])) {
 | 
				
			||||||
          unset($links[$key]);
 | 
					          unset($links[$key]);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@@ -194,7 +194,7 @@ function _deleterelationshipperm_civicrm_check_permission($errorType = NULL) {
 | 
				
			|||||||
  if (CRM_Core_Permission::check('delete relationships')) {
 | 
					  if (CRM_Core_Permission::check('delete relationships')) {
 | 
				
			||||||
    return FALSE;
 | 
					    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') {
 | 
					  if ($errorType == 'exception') {
 | 
				
			||||||
    throw new API_Exception($message);
 | 
					    throw new API_Exception($message);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user