From 0fd1ed20dda715f00ec3bf6638137193dcb63047 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 15 Nov 2021 21:55:32 -0500 Subject: [PATCH] CiviGrant - Migrate option values to managed entities --- CRM/Upgrade/Incremental/php/FiveFortyFive.php | 146 ++++++++++++ ...arch_options_OptionValue_CiviGrant.mgd.php | 31 +++ ...view_options_OptionValue_CiviGrant.mgd.php | 31 +++ .../managed/OptionGroup_grant_status.mgd.php | 217 ++++++++++++++++++ .../managed/OptionGroup_grant_type.mgd.php | 133 +++++++++++ ...up_mapping_type_OptionValue_Export.mgd.php | 31 +++ ...ate_OptionValue_CRM_Report_Form_Grants.php | 59 +++++ xml/templates/civicrm_data.tpl | 24 -- 8 files changed, 648 insertions(+), 24 deletions(-) create mode 100644 ext/civigrant/managed/OptionGroup_advanced_search_options_OptionValue_CiviGrant.mgd.php create mode 100644 ext/civigrant/managed/OptionGroup_contact_view_options_OptionValue_CiviGrant.mgd.php create mode 100644 ext/civigrant/managed/OptionGroup_grant_status.mgd.php create mode 100644 ext/civigrant/managed/OptionGroup_grant_type.mgd.php create mode 100644 ext/civigrant/managed/OptionGroup_mapping_type_OptionValue_Export.mgd.php create mode 100644 ext/civigrant/managed/OptionGroup_report_template_OptionValue_CRM_Report_Form_Grants.php diff --git a/CRM/Upgrade/Incremental/php/FiveFortyFive.php b/CRM/Upgrade/Incremental/php/FiveFortyFive.php index 306fc9b7b860..b6db91d19ac1 100644 --- a/CRM/Upgrade/Incremental/php/FiveFortyFive.php +++ b/CRM/Upgrade/Incremental/php/FiveFortyFive.php @@ -80,6 +80,152 @@ public static function migrateCiviGrant(CRM_Queue_TaskContext $ctx): bool { $ext->file = 'civigrant'; $ext->is_active = (int) $civiGrantEnabled; $ext->save(); + + $managedItems = [ + 'OptionGroup_advanced_search_options_OptionValue_CiviGrant' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'advanced_search_options', + 'name' => 'CiviGrant', + ], + ], + 'OptionGroup_contact_view_options_OptionValue_CiviGrant' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'contact_view_options', + 'name' => 'CiviGrant', + ], + ], + 'OptionGroup_mapping_type_OptionValue_Export Grant' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'mapping_type', + 'name' => 'Export Grant', + ], + ], + 'OptionGroup_grant_status' => [ + 'entity' => 'OptionGroup', + 'values' => [ + 'name' => 'grant_status', + ], + ], + 'OptionGroup_grant_status_OptionValue_Submitted' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'name' => 'Submitted', + ], + ], + 'OptionGroup_grant_status_OptionValue_Eligible' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'name' => 'Eligible', + ], + ], + 'OptionGroup_grant_status_OptionValue_Ineligible' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'name' => 'Ineligible', + ], + ], + 'OptionGroup_grant_status_OptionValue_Paid' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'name' => 'Paid', + ], + ], + 'OptionGroup_grant_status_OptionValue_Awaiting Information' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'name' => 'Awaiting Information', + ], + ], + 'OptionGroup_grant_status_OptionValue_Withdrawn' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'name' => 'Withdrawn', + ], + ], + 'OptionGroup_grant_status_OptionValue_Approved for Payment' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'name' => 'Approved for Payment', + ], + ], + 'OptionGroup_grant_type' => [ + 'entity' => 'OptionGroup', + 'values' => [ + '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' => [ + 'option_group_id:name' => 'report_template', + 'name' => 'CRM_Report_Form_Grant_Detail', + ], + ], + 'OptionGroup_report_template_OptionValue_CRM_Report_Form_Grant_Statistics' => [ + 'entity' => 'OptionValue', + 'values' => [ + 'option_group_id:name' => 'report_template', + 'name' => 'CRM_Report_Form_Grant_Statistics', + ], + ], + ]; + // Create an entry in civicrm_managed for each existing record that will be managed by the extension + foreach ($managedItems as $name => $item) { + $where = []; + foreach ($item['values'] as $k => $v) { + $where[] = [$k, '=', $v]; + } + $record = civicrm_api4($item['entity'], 'get', ['where' => $where])->first(); + if ($record) { + $mgd = new CRM_Core_DAO_Managed(); + $mgd->name = $name; + $mgd->module = 'civigrant'; + $mgd->entity_type = $item['entity']; + if (!$mgd->find(TRUE)) { + $mgd->entity_id = $record['id']; + $mgd->cleanup = 'unused'; + $mgd->save(); + } + } + } } return TRUE; diff --git a/ext/civigrant/managed/OptionGroup_advanced_search_options_OptionValue_CiviGrant.mgd.php b/ext/civigrant/managed/OptionGroup_advanced_search_options_OptionValue_CiviGrant.mgd.php new file mode 100644 index 000000000000..9d5395fd4176 --- /dev/null +++ b/ext/civigrant/managed/OptionGroup_advanced_search_options_OptionValue_CiviGrant.mgd.php @@ -0,0 +1,31 @@ + 'OptionGroup_advanced_search_options_OptionValue_CiviGrant', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'advanced_search_options', + 'label' => 'Grants', + 'value' => '12', + 'name' => 'CiviGrant', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => NULL, + 'weight' => 14, + 'description' => NULL, + 'is_optgroup' => FALSE, + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'icon' => NULL, + 'color' => NULL, + 'component_id' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], +]; diff --git a/ext/civigrant/managed/OptionGroup_contact_view_options_OptionValue_CiviGrant.mgd.php b/ext/civigrant/managed/OptionGroup_contact_view_options_OptionValue_CiviGrant.mgd.php new file mode 100644 index 000000000000..195ceeb49b89 --- /dev/null +++ b/ext/civigrant/managed/OptionGroup_contact_view_options_OptionValue_CiviGrant.mgd.php @@ -0,0 +1,31 @@ + 'OptionGroup_contact_view_options_OptionValue_CiviGrant', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'contact_view_options', + 'label' => 'Grants', + 'value' => '11', + 'name' => 'CiviGrant', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => NULL, + 'weight' => 11, + 'description' => NULL, + 'is_optgroup' => FALSE, + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'icon' => NULL, + 'color' => NULL, + 'component_id' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], +]; diff --git a/ext/civigrant/managed/OptionGroup_grant_status.mgd.php b/ext/civigrant/managed/OptionGroup_grant_status.mgd.php new file mode 100644 index 000000000000..2e35f4a4cd77 --- /dev/null +++ b/ext/civigrant/managed/OptionGroup_grant_status.mgd.php @@ -0,0 +1,217 @@ + 'OptionGroup_grant_status', + 'entity' => 'OptionGroup', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'grant_status', + 'title' => 'Grant status', + 'description' => NULL, + 'data_type' => NULL, + 'is_reserved' => TRUE, + 'is_active' => TRUE, + 'is_locked' => FALSE, + ], + ], + ], + [ + 'name' => 'OptionGroup_grant_status_OptionValue_Submitted', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'label' => 'Submitted', + 'value' => '1', + 'name' => 'Submitted', + '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, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], + [ + 'name' => 'OptionGroup_grant_status_OptionValue_Eligible', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'label' => 'Eligible', + 'value' => '2', + 'name' => 'Eligible', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => NULL, + 'weight' => 2, + 'description' => NULL, + 'is_optgroup' => FALSE, + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'icon' => NULL, + 'color' => NULL, + 'component_id' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], + [ + 'name' => 'OptionGroup_grant_status_OptionValue_Ineligible', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'label' => 'Ineligible', + 'value' => '3', + 'name' => 'Ineligible', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => NULL, + 'weight' => 3, + 'description' => NULL, + 'is_optgroup' => FALSE, + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'icon' => NULL, + 'color' => NULL, + 'component_id' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], + [ + 'name' => 'OptionGroup_grant_status_OptionValue_Paid', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'label' => 'Paid', + 'value' => '4', + 'name' => 'Paid', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => NULL, + 'weight' => 4, + 'description' => NULL, + 'is_optgroup' => FALSE, + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'icon' => NULL, + 'color' => NULL, + 'component_id' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], + [ + 'name' => 'OptionGroup_grant_status_OptionValue_Awaiting Information', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'label' => 'Awaiting Information', + 'value' => '5', + 'name' => 'Awaiting Information', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => NULL, + 'weight' => 5, + 'description' => NULL, + 'is_optgroup' => FALSE, + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'icon' => NULL, + 'color' => NULL, + 'component_id' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], + [ + 'name' => 'OptionGroup_grant_status_OptionValue_Withdrawn', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'label' => 'Withdrawn', + 'value' => '6', + 'name' => 'Withdrawn', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => NULL, + 'weight' => 6, + 'description' => NULL, + 'is_optgroup' => FALSE, + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'icon' => NULL, + 'color' => NULL, + 'component_id' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], + [ + 'name' => 'OptionGroup_grant_status_OptionValue_Approved for Payment', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'grant_status', + 'label' => 'Approved for Payment', + 'value' => '7', + 'name' => 'Approved for Payment', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => NULL, + 'weight' => 7, + 'description' => NULL, + 'is_optgroup' => FALSE, + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'icon' => NULL, + 'color' => NULL, + 'component_id' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], +]; diff --git a/ext/civigrant/managed/OptionGroup_grant_type.mgd.php b/ext/civigrant/managed/OptionGroup_grant_type.mgd.php new file mode 100644 index 000000000000..f114f8b0da0b --- /dev/null +++ b/ext/civigrant/managed/OptionGroup_grant_type.mgd.php @@ -0,0 +1,133 @@ + 'OptionGroup_grant_type', + 'entity' => 'OptionGroup', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'grant_type', + 'title' => 'Grant Type', + 'description' => NULL, + 'data_type' => NULL, + 'is_reserved' => TRUE, + 'is_active' => TRUE, + 'is_locked' => FALSE, + ], + ], + ], + [ + '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' => NULL, + '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' => NULL, + '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' => NULL, + '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', + ], + ], + ], +]; diff --git a/ext/civigrant/managed/OptionGroup_mapping_type_OptionValue_Export.mgd.php b/ext/civigrant/managed/OptionGroup_mapping_type_OptionValue_Export.mgd.php new file mode 100644 index 000000000000..c3da000a735b --- /dev/null +++ b/ext/civigrant/managed/OptionGroup_mapping_type_OptionValue_Export.mgd.php @@ -0,0 +1,31 @@ + 'OptionGroup_mapping_type_OptionValue_Export Grant', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'mapping_type', + 'label' => 'Export Grant', + 'value' => '13', + 'name' => 'Export Grant', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => FALSE, + 'weight' => 13, + 'description' => NULL, + 'is_optgroup' => FALSE, + 'is_reserved' => TRUE, + 'is_active' => TRUE, + 'icon' => NULL, + 'color' => NULL, + 'component_id' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], +]; diff --git a/ext/civigrant/managed/OptionGroup_report_template_OptionValue_CRM_Report_Form_Grants.php b/ext/civigrant/managed/OptionGroup_report_template_OptionValue_CRM_Report_Form_Grants.php new file mode 100644 index 000000000000..1fc78ae6c4e1 --- /dev/null +++ b/ext/civigrant/managed/OptionGroup_report_template_OptionValue_CRM_Report_Form_Grants.php @@ -0,0 +1,59 @@ + 'OptionGroup_report_template_OptionValue_CRM_Report_Form_Grant_Detail', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'report_template', + 'label' => 'Grant Report (Detail)', + 'value' => 'grant/detail', + 'name' => 'CRM_Report_Form_Grant_Detail', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => FALSE, + 'weight' => 30, + 'description' => 'Grant Report Detail', + 'is_optgroup' => FALSE, + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'component_id:name' => 'CiviGrant', + 'icon' => NULL, + 'color' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], + [ + 'name' => 'OptionGroup_report_template_OptionValue_CRM_Report_Form_Grant_Statistics', + 'entity' => 'OptionValue', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'option_group_id:name' => 'report_template', + 'label' => 'Grant Report (Statistics)', + 'value' => 'grant/statistics', + 'name' => 'CRM_Report_Form_Grant_Statistics', + 'grouping' => NULL, + 'filter' => 0, + 'is_default' => NULL, + 'weight' => 42, + 'description' => 'Shows statistics for Grants.', + 'is_optgroup' => FALSE, + 'is_reserved' => FALSE, + 'is_active' => TRUE, + 'component_id:name' => 'CiviGrant', + 'icon' => NULL, + 'color' => NULL, + 'domain_id' => NULL, + 'visibility_id' => NULL, + ], + ], + ], +]; diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index add0f7469317..1f1bc38af734 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -137,8 +137,6 @@ VALUES ('user_dashboard_options' , '{ts escape="sql"}User Dashboard Options{/ts}' , NULL, 1, 1, 1), ('address_options' , '{ts escape="sql"}Addressing Options{/ts}' , NULL, 1, 1, 0), ('group_type' , '{ts escape="sql"}Group Type{/ts}' , NULL, 1, 1, 0), - ('grant_status' , '{ts escape="sql"}Grant status{/ts}' , NULL, 1, 1, 0), - ('grant_type' , '{ts escape="sql"}Grant Type{/ts}' , NULL, 1, 1, 0), ('custom_search' , '{ts escape="sql"}Custom Search{/ts}' , NULL, 1, 1, 0), ('activity_status' , '{ts escape="sql"}Activity Status{/ts}' , 'Integer', 1, 1, 0), ('case_type' , '{ts escape="sql"}Case Type{/ts}' , NULL, 1, 1, 0), @@ -223,8 +221,6 @@ SELECT @option_group_id_asOpt := max(id) from civicrm_option_group wher SELECT @option_group_id_udOpt := max(id) from civicrm_option_group where name = 'user_dashboard_options'; SELECT @option_group_id_adOpt := max(id) from civicrm_option_group where name = 'address_options'; SELECT @option_group_id_gType := max(id) from civicrm_option_group where name = 'group_type'; -SELECT @option_group_id_grantSt := max(id) from civicrm_option_group where name = 'grant_status'; -SELECT @option_group_id_grantTyp := max(id) from civicrm_option_group where name = 'grant_type'; SELECT @option_group_id_csearch := max(id) from civicrm_option_group where name = 'custom_search'; SELECT @option_group_id_acs := max(id) from civicrm_option_group where name = 'activity_status'; SELECT @option_group_id_ct := max(id) from civicrm_option_group where name = 'case_type'; @@ -291,7 +287,6 @@ SELECT @eventCompId := max(id) FROM civicrm_component where name = 'CiviEve SELECT @memberCompId := max(id) FROM civicrm_component where name = 'CiviMember'; SELECT @pledgeCompId := max(id) FROM civicrm_component where name = 'CiviPledge'; SELECT @caseCompId := max(id) FROM civicrm_component where name = 'CiviCase'; -SELECT @grantCompId := max(id) FROM civicrm_component where name = 'CiviGrant'; SELECT @campaignCompId := max(id) FROM civicrm_component where name = 'CiviCampaign'; SELECT @mailCompId := max(id) FROM civicrm_component where name = 'CiviMail'; @@ -469,7 +464,6 @@ VALUES (@option_group_id_cvOpt, '{ts escape="sql"}Memberships{/ts}' , 8, 'CiviMember', NULL, 0, NULL, 8, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_cvOpt, '{ts escape="sql"}Events{/ts}' , 9, 'CiviEvent', NULL, 0, NULL, 9, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_cvOpt, '{ts escape="sql"}Cases{/ts}' , 10, 'CiviCase', NULL, 0, NULL, 10, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_cvOpt, '{ts escape="sql"}Grants{/ts}' , 11, 'CiviGrant', NULL, 0, NULL, 11, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_cvOpt, '{ts escape="sql"}Pledges{/ts}' , 13, 'CiviPledge', NULL, 0, NULL, 13, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_cvOpt, '{ts escape="sql"}Mailings{/ts}' , 14, 'CiviMail', NULL, 0, NULL, 14, NULL, 0, 0, 1, NULL, NULL, NULL), @@ -506,7 +500,6 @@ VALUES (@option_group_id_asOpt, '{ts escape="sql"}Memberships{/ts}' , 8, 'CiviMember', NULL, 0, NULL, 9, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_asOpt, '{ts escape="sql"}Events{/ts}' , 9, 'CiviEvent', NULL, 0, NULL, 10, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_asOpt, '{ts escape="sql"}Cases{/ts}' , 10, 'CiviCase', NULL, 0, NULL, 11, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_asOpt, 'Grants' , 12, 'CiviGrant', NULL, 0, NULL, 14, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_asOpt, '{ts escape="sql"}Demographics{/ts}' , 13, 'demographics', NULL, 0, NULL, 15, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_asOpt, '{ts escape="sql"}Pledges{/ts}' , 15, 'CiviPledge', NULL, 0, NULL, 17, NULL, 0, 0, 1, NULL, NULL, NULL), (@option_group_id_asOpt, '{ts escape="sql"}Contact Type{/ts}' , 16, 'contactType', NULL, 0, NULL, 18, NULL, 0, 0, 1, NULL, NULL, NULL), @@ -558,14 +551,6 @@ VALUES (@option_group_id_gType, '{ts escape="sql"}Access Control{/ts}', 1, 'Access Control', NULL, 0, NULL, 1, NULL, 0, 1, 1, NULL, NULL, NULL), (@option_group_id_gType, '{ts escape="sql"}Mailing List{/ts}', 2, 'Mailing List', NULL, 0, NULL, 2, NULL, 0, 1, 1, NULL, NULL, NULL), - (@option_group_id_grantSt, '{ts escape="sql"}Submitted{/ts}', 1, 'Submitted', NULL, 0, 1, 1, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_grantSt, '{ts escape="sql"}Eligible{/ts}', 2, 'Eligible', NULL, 0, NULL, 2, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_grantSt, '{ts escape="sql"}Ineligible{/ts}', 3, 'Ineligible', NULL, 0, NULL, 3, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_grantSt, '{ts escape="sql"}Paid{/ts}', 4, 'Paid', NULL, 0, NULL, 4, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_grantSt, '{ts escape="sql"}Awaiting Information{/ts}', 5, 'Awaiting Information', NULL, 0, NULL, 5, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_grantSt, '{ts escape="sql"}Withdrawn{/ts}', 6, 'Withdrawn', NULL, 0, NULL, 6, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_grantSt, '{ts escape="sql"}Approved for Payment{/ts}', 7, 'Approved for Payment', NULL, 0, NULL, 7, NULL, 0, 0, 1, NULL, NULL, NULL), - (@option_group_id_csearch , 'CRM_Contact_Form_Search_Custom_Sample' , 1, 'CRM_Contact_Form_Search_Custom_Sample' , NULL, 0, NULL, 1, '{ts escape="sql"}Household Name and State{/ts}', 0, 0, 1, NULL, NULL, NULL), (@option_group_id_csearch , 'CRM_Contact_Form_Search_Custom_ContributionAggregate', 2, 'CRM_Contact_Form_Search_Custom_ContributionAggregate', NULL, 0, NULL, 2, '{ts escape="sql"}Contribution Aggregate{/ts}', 0, 0, 1, NULL, NULL, NULL), (@option_group_id_csearch , 'CRM_Contact_Form_Search_Custom_Group' , 4, 'CRM_Contact_Form_Search_Custom_Group' , NULL, 0, NULL, 4, '{ts escape="sql"}Include / Exclude Search{/ts}', 0, 0, 1, NULL, NULL, NULL), @@ -611,7 +596,6 @@ VALUES (@option_group_id_report , '{ts escape="sql"}Database Log Report{/ts}', 'contact/log', 'CRM_Report_Form_Contact_Log', NULL, 0, NULL, 27, '{ts escape="sql"}Log of contact and activity records created or updated in a given date range.{/ts}', 0, 0, 1, NULL, NULL, NULL), (@option_group_id_report , '{ts escape="sql"}Activity Summary Report{/ts}', 'activitySummary', 'CRM_Report_Form_ActivitySummary', NULL, 0, NULL, 28, '{ts escape="sql"}Shows activity statistics by type / date{/ts}', 0, 0, 1, NULL, NULL, NULL), (@option_group_id_report, '{ts escape="sql"}Bookkeeping Transactions Report{/ts}', 'contribute/bookkeeping', 'CRM_Report_Form_Contribute_Bookkeeping', NULL, 0, 0, 29, '{ts escape="sql"}Shows Bookkeeping Transactions Report{/ts}', 0, 0, 1, 2, NULL, NULL), - (@option_group_id_report , {localize}'{ts escape="sql"}Grant Report (Detail){/ts}'{/localize}, 'grant/detail', 'CRM_Report_Form_Grant_Detail', NULL, 0, 0, 30, {localize}'{ts escape="sql"}Grant Report Detail{/ts}'{/localize}, 0, 0, 1, @grantCompId, NULL, NULL), (@option_group_id_report, {localize}'{ts escape="sql"}Participant list Count Report{/ts}'{/localize}, 'event/participantlist', 'CRM_Report_Form_Event_ParticipantListCount', NULL, 0, 0, 31, {localize}'{ts escape="sql"}Shows the Participant list with Participant Count.{/ts}'{/localize}, 0, 0, 1, @eventCompId, NULL, NULL), (@option_group_id_report, {localize}'{ts escape="sql"}Income Count Summary Report{/ts}'{/localize}, 'event/incomesummary', 'CRM_Report_Form_Event_IncomeCountSummary', NULL, 0, 0, 32, {localize}'{ts escape="sql"}Shows the Income Summary of events with Count.{/ts}'{/localize}, 0, 0, 1, @eventCompId, NULL, NULL), (@option_group_id_report, {localize}'{ts escape="sql"}Case Detail Report{/ts}'{/localize}, 'case/detail', 'CRM_Report_Form_Case_Detail', NULL, 0, 0, 33, {localize}'{ts escape="sql"}Case Details{/ts}'{/localize}, 0, 0, 1, @caseCompId, NULL, NULL), @@ -621,7 +605,6 @@ VALUES (@option_group_id_report, {localize}'{ts escape="sql"}Mail Click-Through Report{/ts}'{/localize}, 'Mailing/clicks', 'CRM_Report_Form_Mailing_Clicks', NULL, 0, NULL, 37, {localize}'{ts escape="sql"}Display clicks from each mailing{/ts}'{/localize}, 0, 0, 1, @mailCompId, NULL, NULL), (@option_group_id_report, {localize}'{ts escape="sql"}Contact Logging Report (Summary){/ts}'{/localize}, 'logging/contact/summary', 'CRM_Report_Form_Contact_LoggingSummary', NULL, 0, NULL, 38, {localize}'{ts escape="sql"}Contact modification report for the logging infrastructure (summary).{/ts}'{/localize}, 0, 0, 0, NULL, NULL, NULL), (@option_group_id_report, {localize}'{ts escape="sql"}Contact Logging Report (Detail){/ts}'{/localize}, 'logging/contact/detail', 'CRM_Report_Form_Contact_LoggingDetail', NULL, 0, NULL, 39, {localize}'{ts escape="sql"}Contact modification report for the logging infrastructure (detail).{/ts}'{/localize}, 0, 0, 0, NULL, NULL, NULL), - (@option_group_id_report, {localize}'{ts escape="sql"}Grant Report (Statistics){/ts}'{/localize}, 'grant/statistics', 'CRM_Report_Form_Grant_Statistics', NULL, 0, NULL, 42, {localize}'{ts escape="sql"}Shows statistics for Grants.{/ts}'{/localize}, 0, 0, 1, @grantCompId, NULL, NULL), (@option_group_id_report, {localize}'{ts escape="sql"}Survey Report (Detail){/ts}'{/localize}, 'survey/detail', 'CRM_Report_Form_Campaign_SurveyDetails', NULL, 0, NULL, 43, {localize}'{ts escape="sql"}Detailed report for canvassing, phone-banking, walk lists or other surveys.{/ts}'{/localize}, 0, 0, 1, @campaignCompId, NULL, NULL), (@option_group_id_report, {localize}'{ts escape="sql"}Personal Campaign Page Report{/ts}'{/localize}, 'contribute/pcp', 'CRM_Report_Form_Contribute_PCP', NULL, 0, NULL, 44, {localize}'{ts escape="sql"}Summarizes amount raised and number of contributors for each Personal Campaign Page.{/ts}'{/localize}, 0, 0, 1, @contributeCompId, NULL, NULL), (@option_group_id_report , {localize}'{ts escape="sql"}Pledge Summary Report{/ts}'{/localize}, 'pledge/summary', 'CRM_Report_Form_Pledge_Summary', NULL, 0, NULL, 45, {localize}'{ts escape="sql"}Groups and totals pledges by criteria including contact, time period, pledge status, location, etc.{/ts}'{/localize}, 0, 0, 1, @pledgeCompId, NULL, NULL), @@ -681,7 +664,6 @@ VALUES (@option_group_id_mt, '{ts escape="sql"}Export Participant{/ts}', 10, 'Export Participant', NULL, 0, 0, 10, NULL, 0, 1, 1, NULL, NULL, NULL), (@option_group_id_mt, '{ts escape="sql"}Export Pledge{/ts}', 11, 'Export Pledge', NULL, 0, 0, 11, NULL, 0, 1, 1, NULL, NULL, NULL), (@option_group_id_mt, '{ts escape="sql"}Export Case{/ts}', 12, 'Export Case', NULL, 0, 0, 12, NULL, 0, 1, 1, NULL, NULL, NULL), - (@option_group_id_mt, '{ts escape="sql"}Export Grant{/ts}', 13, 'Export Grant', NULL, 0, 0, 13, NULL, 0, 1, 1, NULL, NULL, NULL), (@option_group_id_mt, '{ts escape="sql"}Export Activity{/ts}', 14, 'Export Activity', NULL, 0, 0, 14, NULL, 0, 1, 1, NULL, NULL, NULL), (@option_group_id_fu, '{ts escape="sql"}day{/ts}' , 'day' , 'day', NULL, 0, NULL, 1, NULL, 0, 1, 1, NULL, NULL, NULL), @@ -1097,12 +1079,6 @@ VALUES -- from email address. (@option_group_id_fma, '"FIXME" ', '1', '"FIXME" ', NULL, 0, 1, 1, '{ts escape="sql"}Default domain email address and from name.{/ts}', 0, 0, 1, NULL, @domainID, NULL ), --- grant types - (@option_group_id_grantTyp, '{ts escape="sql"}Emergency{/ts}' , 1, 'Emergency' , NULL, 0, 1, 1, NULL, 0, 0, 1, NULL, @domainID, NULL), - (@option_group_id_grantTyp, '{ts escape="sql"}Family Support{/ts}' , 2, 'Family Support' , NULL, 0, NULL, 2, NULL, 0, 0, 1, NULL, @domainID, NULL), - (@option_group_id_grantTyp, '{ts escape="sql"}General Protection{/ts}' , 3, 'General Protection', NULL, 0, NULL, 3, NULL, 0, 0, 1, NULL, @domainID, NULL), - (@option_group_id_grantTyp, '{ts escape="sql"}Impunity{/ts}' , 4, 'Impunity' , NULL, 0, NULL, 4, NULL, 0, 0, 1, NULL, @domainID, NULL), - -- Mail Approval Status Preferences (@option_group_id_mail_approval_status, '{ts escape="sql"}Approved{/ts}' , 1, 'Approved', NULL, 0, 1, 1, NULL, 0, 1, 1, @mailCompId, @domainID, NULL), (@option_group_id_mail_approval_status, '{ts escape="sql"}Rejected{/ts}' , 2, 'Rejected', NULL, 0, 0, 2, NULL, 0, 1, 1, @mailCompId, @domainID, NULL),