];
}
-/**
- * Implements hook_civicrm_tabSet().
- *
- * Add grants tab to contact summary screen.
- */
-function civigrant_civicrm_tabSet($tabSetName, &$tabs, $context) {
- if ($tabSetName === 'civicrm/contact/view' && !empty($context['contact_id'])) {
- $cid = $context['contact_id'];
- $tabs[] = [
- 'id' => 'grant',
- 'url' => CRM_Utils_System::url("civicrm/contact/view/grant", ['reset' => 1, 'cid' => $cid]),
- 'title' => E::ts('Grants'),
- 'weight' => 60,
- 'count' => CRM_Grant_BAO_Grant::getContactGrantCount($cid),
- 'class' => 'livePage',
- 'icon' => 'crm-i fa-money',
- ];
- }
-}
-
/**
* Implements hook_civicrm_queryObjects().
*
--- /dev/null
+<?php
+return [
+ [
+ 'name' => 'SavedSearch_CiviGrant_Summary',
+ 'entity' => 'SavedSearch',
+ 'cleanup' => 'unused',
+ 'update' => 'unmodified',
+ 'params' => [
+ 'version' => 4,
+ 'values' => [
+ 'name' => 'CiviGrant_Summary',
+ 'label' => 'CiviGrant Summary',
+ 'form_values' => NULL,
+ 'search_custom_id' => NULL,
+ 'api_entity' => 'Grant',
+ 'api_params' => [
+ 'version' => 4,
+ 'select' => [
+ 'status_id:label',
+ 'grant_type_id:label',
+ 'amount_requested',
+ 'amount_granted',
+ 'application_received_date',
+ 'grant_report_received',
+ 'money_transfer_date',
+ ],
+ 'orderBy' => [],
+ 'where' => [],
+ 'groupBy' => [],
+ 'join' => [],
+ 'having' => [],
+ ],
+ 'expires_date' => NULL,
+ 'description' => NULL,
+ 'mapping_id' => NULL,
+ ],
+ ],
+ ],
+ [
+ 'name' => 'SavedSearch_CiviGrant_Summary_SearchDisplay_Grant_Tab',
+ 'entity' => 'SearchDisplay',
+ 'cleanup' => 'unused',
+ 'update' => 'unmodified',
+ 'params' => [
+ 'version' => 4,
+ 'values' => [
+ 'name' => 'Grant_Tab',
+ 'label' => 'Grant Tab',
+ 'saved_search_id.name' => 'CiviGrant_Summary',
+ 'type' => 'table',
+ 'settings' => [
+ 'actions' => FALSE,
+ 'limit' => 50,
+ 'classes' => [
+ 'table',
+ 'table-striped',
+ ],
+ 'pager' => [
+ 'show_count' => TRUE,
+ 'expose_limit' => TRUE,
+ ],
+ 'sort' => [],
+ 'columns' => [
+ [
+ 'type' => 'field',
+ 'key' => 'status_id:label',
+ 'dataType' => 'Integer',
+ 'label' => 'Status',
+ 'sortable' => TRUE,
+ ],
+ [
+ 'type' => 'field',
+ 'key' => 'grant_type_id:label',
+ 'dataType' => 'Integer',
+ 'label' => 'Type',
+ 'sortable' => TRUE,
+ ],
+ [
+ 'type' => 'field',
+ 'key' => 'amount_requested',
+ 'dataType' => 'Money',
+ 'label' => 'Requested',
+ 'sortable' => TRUE,
+ ],
+ [
+ 'type' => 'field',
+ 'key' => 'amount_granted',
+ 'dataType' => 'Money',
+ 'label' => 'Granted',
+ 'sortable' => TRUE,
+ ],
+ [
+ 'type' => 'field',
+ 'key' => 'application_received_date',
+ 'dataType' => 'Date',
+ 'label' => 'Application received',
+ 'sortable' => TRUE,
+ ],
+ [
+ 'type' => 'field',
+ 'key' => 'grant_report_received',
+ 'dataType' => 'Boolean',
+ 'label' => 'Report received',
+ 'sortable' => TRUE,
+ ],
+ [
+ 'type' => 'field',
+ 'key' => 'money_transfer_date',
+ 'dataType' => 'Date',
+ 'label' => 'Money transferred',
+ 'sortable' => TRUE,
+ ],
+ [
+ 'size' => 'btn-xs',
+ 'links' => [
+ [
+ 'entity' => 'Grant',
+ 'action' => 'view',
+ 'join' => '',
+ 'target' => 'crm-popup',
+ 'icon' => 'fa-external-link',
+ 'text' => 'View',
+ 'style' => 'default',
+ ],
+ [
+ 'entity' => 'Grant',
+ 'action' => 'update',
+ 'join' => '',
+ 'target' => 'crm-popup',
+ 'icon' => 'fa-pencil',
+ 'text' => 'Edit',
+ 'style' => 'default',
+ ],
+ [
+ 'entity' => 'Grant',
+ 'action' => 'delete',
+ 'join' => '',
+ 'target' => 'crm-popup',
+ 'icon' => 'fa-trash',
+ 'text' => 'Delete',
+ 'style' => 'danger',
+ ],
+ ],
+ 'type' => 'buttons',
+ 'alignment' => 'text-right',
+ ],
+ ],
+ ],
+ 'acl_bypass' => FALSE,
+ ],
+ ],
+ ],
+];