added hook to disable edit link

This commit is contained in:
CiviWare Solutions 2018-06-29 01:19:19 +05:30
parent f1fa021847
commit c087cc7a27

View File

@ -139,10 +139,27 @@ function batchexportperm_civicrm_entityTypes(&$entityTypes) {
* *
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_permission * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_permission
*/ */
function deleterelationships_civicrm_permission(&$permissions) { function batchexportperm_civicrm_permission(&$permissions) {
$prefix = ts('CiviCRM') . ': '; $prefix = ts('CiviCRM') . ': ';
$permissions['edit exported contributions'] = [ $permissions['edit exported contributions'] = [
$prefix . ts('Edit exported contributions'), $prefix . ts('Edit exported contributions'),
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]);
}
}
}
}
}