Skip to content
Snippets Groups Projects
Unverified Commit d5027105 authored by colemanw's avatar colemanw Committed by GitHub
Browse files

Merge pull request #22905 from colemanw/civiGrantTypes

CiviGrant - Don't auto-create any grant types
parents 7889b9d2 79461374
Branches
Tags
No related merge requests found
......@@ -223,34 +223,6 @@ class CRM_Upgrade_Incremental_php_FiveFortySeven extends CRM_Upgrade_Incremental
'name' => 'grant_type',
],
],
'OptionGroup_grant_type_OptionValue_Emergency' => [
'entity' => 'OptionValue',
'values' => [
'option_group_id:name' => 'grant_type',
'name' => 'Emergency',
],
],
'OptionGroup_grant_type_OptionValue_Family Support' => [
'entity' => 'OptionValue',
'values' => [
'option_group_id:name' => 'grant_type',
'name' => 'Family Support',
],
],
'OptionGroup_grant_type_OptionValue_General Protection' => [
'entity' => 'OptionValue',
'values' => [
'option_group_id:name' => 'grant_type',
'name' => 'General Protection',
],
],
'OptionGroup_grant_type_OptionValue_Impunity' => [
'entity' => 'OptionValue',
'values' => [
'option_group_id:name' => 'grant_type',
'name' => 'Impunity',
],
],
'OptionGroup_report_template_OptionValue_CRM_Report_Form_Grant_Detail' => [
'entity' => 'OptionValue',
'values' => [
......
......@@ -2,3 +2,6 @@
-- Remove entry for Grant Reports since grant is not a component anymore so this url just shows an empty list
DELETE FROM civicrm_navigation WHERE url='civicrm/report/list?compid=5&reset=1';
DELETE FROM civicrm_managed WHERE module = "civigrant" AND entity_type = "OptionValue"
AND name LIKE "OptionGroup_grant_type_%";
......@@ -18,116 +18,4 @@ return [
],
],
],
[
'name' => 'OptionGroup_grant_type_OptionValue_Emergency',
'entity' => 'OptionValue',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'option_group_id.name' => 'grant_type',
'label' => 'Emergency',
'value' => '1',
'name' => 'Emergency',
'grouping' => NULL,
'filter' => 0,
'is_default' => TRUE,
'weight' => 1,
'description' => NULL,
'is_optgroup' => FALSE,
'is_reserved' => FALSE,
'is_active' => TRUE,
'icon' => NULL,
'color' => NULL,
'component_id' => NULL,
'visibility_id' => NULL,
'domain_id' => 'current_domain',
],
],
],
[
'name' => 'OptionGroup_grant_type_OptionValue_Family Support',
'entity' => 'OptionValue',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'option_group_id.name' => 'grant_type',
'label' => 'Family Support',
'value' => '2',
'name' => 'Family Support',
'grouping' => NULL,
'filter' => 0,
'is_default' => FALSE,
'weight' => 2,
'description' => NULL,
'is_optgroup' => FALSE,
'is_reserved' => FALSE,
'is_active' => TRUE,
'icon' => NULL,
'color' => NULL,
'component_id' => NULL,
'visibility_id' => NULL,
'domain_id' => 'current_domain',
],
],
],
[
'name' => 'OptionGroup_grant_type_OptionValue_General Protection',
'entity' => 'OptionValue',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'option_group_id.name' => 'grant_type',
'label' => 'General Protection',
'value' => '3',
'name' => 'General Protection',
'grouping' => NULL,
'filter' => 0,
'is_default' => FALSE,
'weight' => 3,
'description' => NULL,
'is_optgroup' => FALSE,
'is_reserved' => FALSE,
'is_active' => TRUE,
'icon' => NULL,
'color' => NULL,
'component_id' => NULL,
'visibility_id' => NULL,
'domain_id' => 'current_domain',
],
],
],
[
'name' => 'OptionGroup_grant_type_OptionValue_Impunity',
'entity' => 'OptionValue',
'cleanup' => 'unused',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'option_group_id.name' => 'grant_type',
'label' => 'Impunity',
'value' => '4',
'name' => 'Impunity',
'grouping' => NULL,
'filter' => 0,
'is_default' => FALSE,
'weight' => 4,
'description' => NULL,
'is_optgroup' => FALSE,
'is_reserved' => FALSE,
'is_active' => TRUE,
'icon' => NULL,
'color' => NULL,
'component_id' => NULL,
'visibility_id' => NULL,
'domain_id' => 'current_domain',
],
],
],
];
......@@ -16,11 +16,10 @@
* @subpackage API_Grant
* @group headless
*/
class api_v3_GrantTest extends \PHPUnit\Framework\TestCase implements \Civi\Test\HeadlessInterface {
class api_v3_GrantTest extends \PHPUnit\Framework\TestCase implements \Civi\Test\HeadlessInterface, \Civi\Test\TransactionalInterface {
use \Civi\Test\Api3TestTrait;
use \Civi\Test\ContactTestTrait;
protected $_apiversion = 3;
protected $params;
protected $ids = [];
......@@ -48,6 +47,14 @@ class api_v3_GrantTest extends \PHPUnit\Framework\TestCase implements \Civi\Test
'currency' => 'USD',
'grant_type_id' => 1,
];
// Create a sample grant type
\CRM_Core_BAO_OptionValue::ensureOptionValueExists([
'option_group_id' => 'grant_type',
'label' => 'Emergency',
'name' => 'Emergency',
'value' => 1,
'is_active' => 1,
]);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment