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
20 class CRM_Grant_Info
extends CRM_Core_Component_Info
{
26 protected $keyword = 'grant';
32 public function getInfo() {
34 'name' => 'CiviGrant',
35 'translatedName' => ts('CiviGrant'),
36 'title' => 'CiviCRM Grant Management Engine',
37 'path' => 'CRM_Grant_',
39 'showActivitiesInCore' => 1,
45 * @param bool $getAllUnconditionally
46 * @param bool $descriptions
47 * Whether to return permission descriptions
51 public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
53 'access CiviGrant' => [
54 ts('access CiviGrant'),
55 ts('View all grants'),
59 ts('Create and update grants'),
61 'delete in CiviGrant' => [
62 ts('delete in CiviGrant'),
68 foreach ($permissions as $name => $attr) {
69 $permissions[$name] = array_shift($attr);
80 public function getUserDashboardElement() {
81 // no dashboard element for this component
89 public function getUserDashboardObject() {
90 // no dashboard element for this component
98 public function registerTab() {
100 'title' => ts('Grants'),
110 public function getIcon() {
111 return 'crm-i fa-money';
118 public function registerAdvancedSearchPane() {
120 'title' => ts('Grants'),
129 public function getActivityTypes() {
134 * add shortcut to Create New.
137 public function creatNewShortcut(&$shortCuts) {
138 if (CRM_Core_Permission
::check('access CiviGrant') &&
139 CRM_Core_Permission
::check('edit grants')
141 $shortCuts = array_merge($shortCuts, [
143 'path' => 'civicrm/grant/add',
144 'query' => "reset=1&action=add&context=standalone",
145 'ref' => 'new-grant',
146 'title' => ts('Grant'),