3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This class introduces component to the system and provides all the
14 * information about it. It needs to extend CRM_Core_Component_Info
18 * @copyright CiviCRM LLC https://civicrm.org/licensing
22 class CRM_Grant_Info
extends CRM_Core_Component_Info
{
28 protected $keyword = 'grant';
34 public function getInfo() {
36 'name' => 'CiviGrant',
37 'translatedName' => ts('CiviGrant'),
38 'title' => 'CiviCRM Grant Management Engine',
39 'path' => 'CRM_Grant_',
41 'showActivitiesInCore' => 1,
47 * @param bool $getAllUnconditionally
48 * @param bool $descriptions
49 * Whether to return permission descriptions
53 public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
55 'access CiviGrant' => [
56 ts('access CiviGrant'),
57 ts('View all grants'),
61 ts('Create and update grants'),
63 'delete in CiviGrant' => [
64 ts('delete in CiviGrant'),
70 foreach ($permissions as $name => $attr) {
71 $permissions[$name] = array_shift($attr);
82 public function getUserDashboardElement() {
83 // no dashboard element for this component
91 public function getUserDashboardObject() {
92 // no dashboard element for this component
100 public function registerTab() {
102 'title' => ts('Grants'),
112 public function getIcon() {
113 return 'crm-i fa-money';
120 public function registerAdvancedSearchPane() {
122 'title' => ts('Grants'),
131 public function getActivityTypes() {
136 * add shortcut to Create New.
139 public function creatNewShortcut(&$shortCuts) {
140 if (CRM_Core_Permission
::check('access CiviGrant') &&
141 CRM_Core_Permission
::check('edit grants')
143 $shortCuts = array_merge($shortCuts, [
145 'path' => 'civicrm/grant/add',
146 'query' => "reset=1&action=add&context=standalone",
147 'ref' => 'new-grant',
148 'title' => ts('Grant'),