From 1e9cc515d852c4e59c42374878646c66b81fbf85 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 6 Apr 2022 11:27:46 -0400 Subject: [PATCH] Fix contact summary actions for CiviGrant --- CRM/Contact/BAO/Contact.php | 12 ------------ ext/civigrant/civigrant.php | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 940393715b..9f7d212729 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -3027,18 +3027,6 @@ LEFT JOIN civicrm_email ON ( civicrm_contact.id = civicrm_email.contact_id ) 'href' => CRM_Utils_System::url('civicrm/case/add', 'reset=1&action=add&context=case'), 'permissions' => ['add cases'], ], - 'grant' => [ - 'title' => ts('Add Grant'), - 'weight' => 26, - 'ref' => 'new-grant', - 'key' => 'grant', - 'tab' => 'grant', - 'component' => 'CiviGrant', - 'href' => CRM_Utils_System::url('civicrm/contact/view/grant', - 'reset=1&action=add&context=grant' - ), - 'permissions' => ['edit grants'], - ], 'rel' => [ 'title' => ts('Add Relationship'), 'weight' => 30, diff --git a/ext/civigrant/civigrant.php b/ext/civigrant/civigrant.php index 1cc1288838..8e49dbdbdb 100644 --- a/ext/civigrant/civigrant.php +++ b/ext/civigrant/civigrant.php @@ -48,6 +48,25 @@ function civigrant_civicrm_links($context, $name, $id, &$links) { } } +/** + * Implements hook_civicrm_summaryActions(). + * + * Add contact summary link to create new grant. + */ +function civigrant_civicrm_summaryActions(&$menu, $cid) { + $menu['grant'] = [ + 'title' => ts('Add Grant'), + 'weight' => 26, + 'ref' => 'new-grant', + 'key' => 'grant', + 'tab' => 'afsearchGrants', + 'href' => CRM_Utils_System::url('civicrm/contact/view/grant', + 'reset=1&action=add&context=grant' + ), + 'permissions' => ['edit grants'], + ]; +} + /** * Implements hook_civicrm_permission(). * -- 2.25.1