added hook to disable edit link
This commit is contained in:
		@@ -139,10 +139,27 @@ function batchexportperm_civicrm_entityTypes(&$entityTypes) {
 | 
			
		||||
 *
 | 
			
		||||
 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_permission
 | 
			
		||||
 */
 | 
			
		||||
function deleterelationships_civicrm_permission(&$permissions) {
 | 
			
		||||
function batchexportperm_civicrm_permission(&$permissions) {
 | 
			
		||||
  $prefix = ts('CiviCRM') . ': ';
 | 
			
		||||
  $permissions['edit exported contributions'] = [
 | 
			
		||||
    $prefix . ts('Edit exported contributions'),
 | 
			
		||||
    ts('Edit exported contributions'),
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Implements hook_civicrm_links().
 | 
			
		||||
 *
 | 
			
		||||
 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_links
 | 
			
		||||
 */
 | 
			
		||||
function batchexportperm_civicrm_links($op, $objectName, $objectId, &$links, &$mask, &$values) {
 | 
			
		||||
  if ($op == 'contribution.selector.row' && $objectName == 'Contribution') {
 | 
			
		||||
    if (!CRM_Core_Permission::check('edit exported contributions')) {
 | 
			
		||||
      foreach ($links as $key => $link) {
 | 
			
		||||
        if ($link['name'] == 'Edit') {
 | 
			
		||||
          unset($links[$key]);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user