Fix contact summary actions for CiviGrant
authorColeman Watts <coleman@civicrm.org>
Wed, 6 Apr 2022 15:27:46 +0000 (11:27 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 6 Apr 2022 15:41:35 +0000 (11:41 -0400)
CRM/Contact/BAO/Contact.php
ext/civigrant/civigrant.php

index 940393715b40edf83c42715307d3cbb93daa2c77..9f7d2127290f53e1fabe899bd71d5376a68b3e72 100644 (file)
@@ -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,
index 1cc12888382b1eb65a54c8071358653130449cb1..8e49dbdbdb27a18e9722b88e4dc69eebc4dd9f0f 100644 (file)
@@ -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().
  *