From 24877581f379fd576abca4d5eda56bbd52d67534 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 18 Jun 2016 12:09:34 +1000 Subject: [PATCH] Add in updates to install to set data types for some option groups Fix up upgrade script and add a system check rerun regen after rebasing WIP on adding data type for option group Further work on soft fail when option value value field doesn't match given data type --- CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl | 5 +- CRM/Utils/Check/Component/OptionGroups.php | 87 +++++++++++ sql/civicrm_generated.mysql | 4 +- xml/templates/civicrm_data.tpl | 158 ++++++++++---------- 4 files changed, 172 insertions(+), 82 deletions(-) create mode 100644 CRM/Utils/Check/Component/OptionGroups.php diff --git a/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl index d625ae874b..661d2b5766 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.9.mysql.tpl @@ -63,6 +63,9 @@ INSERT INTO VALUES (@option_group_id_act, {localize}'{ts escape="sql"}Close Accounting Period{/ts}'{/localize}, @option_group_id_act_val+1, 'Close Accounting Period', NULL, 0, 0, @option_group_id_act_wt+1, {localize}'Close Accounting Period'{/localize}, 0, 1, 1, 2, NULL); ---CRM- +--CRM-18651 Add in Data Type colum to option group table and set for some option groups ALTER TABLE civicrm_option_group ADD `data_type` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Data Type of Option Group.'; +UPDATE civicrm_option_group SET `data_type` = 'Integer' +WHERE name in ('activity_type', 'gender', 'payment_instrument', 'participant_role', 'event_type', + 'activity_status',); diff --git a/CRM/Utils/Check/Component/OptionGroups.php b/CRM/Utils/Check/Component/OptionGroups.php new file mode 100644 index 0000000000..e4e2b997e8 --- /dev/null +++ b/CRM/Utils/Check/Component/OptionGroups.php @@ -0,0 +1,87 @@ + 1, + 'data_type' => array('IS NOT NULL' => 1), + )); + if ($optionGroups['count'] > 0) { + foreach ($optionGroups['values'] as $optionGroup) { + $values = civicrm_api3('OptionValue', 'get', array( + 'sequential' => 1, + 'option_group_id' => $optionGroup['name'], + )); + if ($values['count'] > 0) { + foreach ($values['values'] as $value) { + $validate = CRM_Utils_Type::validate($value['value'], $optionGroup['data_type'], FALSE); + if (!$validate) { + $problemValues[] = array( + 'group_name' => $optionGroup['label'], + 'value_name' => $value['label'], + ); + } + } + } + } + } + if (!empty($problemValues)) { + $strings = array(); + foreach ($problemValues as $problemValue) { + $strings[] = ts(' "%1" "%2" ', array( + 1 => $problemValue['group_name'], + 2 => $problemValue['value_name'], + )); + } + + $messages[] = new CRM_Utils_Check_Message( + __FUNCTION__, + ts('The Following Option Values contain value fields that do not match the Data Type of the Option Group

+

') . + explode('\n', $strings) . ts('
Option GroupOption Value

'), + ts('Option Values with problematic Values'), + \Psr\Log\LogLevel::NOTICE, + 'fa-server' + ); + } + + return $messages; + } + +} diff --git a/sql/civicrm_generated.mysql b/sql/civicrm_generated.mysql index d19a1d572b..423f128706 100644 --- a/sql/civicrm_generated.mysql +++ b/sql/civicrm_generated.mysql @@ -986,7 +986,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_note` WRITE; /*!40000 ALTER TABLE `civicrm_note` DISABLE KEYS */; -INSERT INTO `civicrm_note` (`id`, `entity_table`, `entity_id`, `note`, `contact_id`, `modified_date`, `subject`, `privacy`) VALUES (1,'civicrm_contact',72,'Invite members for the Steve Prefontaine 10k dream run',1,'2016-08-02',NULL,'0'),(2,'civicrm_contact',194,'Arrange collection of funds from members',1,'2015-12-07',NULL,'0'),(3,'civicrm_contact',67,'Arrange for cricket match with Sunil Gavaskar',1,'2015-09-18',NULL,'0'),(4,'civicrm_contact',85,'Organize the Terry Fox run',1,'2016-01-31',NULL,'0'),(5,'civicrm_contact',89,'Get the registration done for NGO status',1,'2016-05-24',NULL,'0'),(6,'civicrm_contact',75,'Send newsletter for April 2005',1,'2015-12-26',NULL,'0'),(7,'civicrm_contact',173,'Connect for presentation',1,'2016-04-14',NULL,'0'),(8,'civicrm_contact',67,'Invite members for the Steve Prefontaine 10k dream run',1,'2016-05-27',NULL,'0'),(9,'civicrm_contact',151,'Get the registration done for NGO status',1,'2016-01-26',NULL,'0'),(10,'civicrm_contact',103,'Reminder screening of \"Black\" on next Friday',1,'2015-11-24',NULL,'0'),(11,'civicrm_contact',57,'Connect for presentation',1,'2016-03-30',NULL,'0'),(12,'civicrm_contact',99,'Connect for presentation',1,'2015-11-14',NULL,'0'),(13,'civicrm_contact',40,'Contact the Commissioner of Charities',1,'2016-04-23',NULL,'0'),(14,'civicrm_contact',30,'Connect for presentation',1,'2015-09-24',NULL,'0'),(15,'civicrm_contact',176,'Contact the Commissioner of Charities',1,'2016-06-05',NULL,'0'),(16,'civicrm_contact',78,'Connect for presentation',1,'2016-07-07',NULL,'0'),(17,'civicrm_contact',23,'Chart out route map for next 10k run',1,'2015-11-27',NULL,'0'),(18,'civicrm_contact',84,'Arrange collection of funds from members',1,'2015-10-11',NULL,'0'),(19,'civicrm_contact',147,'Send reminder for annual dinner',1,'2015-11-13',NULL,'0'),(20,'civicrm_contact',76,'Invite members for the Steve Prefontaine 10k dream run',1,'2015-10-30',NULL,'0'); +INSERT INTO `civicrm_note` (`id`, `entity_table`, `entity_id`, `note`, `contact_id`, `modified_date`, `subject`, `privacy`) VALUES (1,'civicrm_contact',180,'Chart out route map for next 10k run',1,'2016-05-16',NULL,'0'),(2,'civicrm_contact',126,'Arrange collection of funds from members',1,'2016-02-18',NULL,'0'),(3,'civicrm_contact',172,'Contact the Commissioner of Charities',1,'2016-05-09',NULL,'0'),(4,'civicrm_contact',6,'Arrange collection of funds from members',1,'2015-06-23',NULL,'0'),(5,'civicrm_contact',187,'Chart out route map for next 10k run',1,'2016-04-27',NULL,'0'),(6,'civicrm_contact',118,'Get the registration done for NGO status',1,'2016-05-21',NULL,'0'),(7,'civicrm_contact',170,'Invite members for the Steve Prefontaine 10k dream run',1,'2015-12-24',NULL,'0'),(8,'civicrm_contact',106,'Invite members for the Steve Prefontaine 10k dream run',1,'2015-09-12',NULL,'0'),(9,'civicrm_contact',120,'Invite members for the Steve Prefontaine 10k dream run',1,'2016-01-25',NULL,'0'),(10,'civicrm_contact',41,'Chart out route map for next 10k run',1,'2016-04-07',NULL,'0'),(11,'civicrm_contact',191,'Get the registration done for NGO status',1,'2015-06-21',NULL,'0'),(12,'civicrm_contact',49,'Send reminder for annual dinner',1,'2016-06-02',NULL,'0'),(13,'civicrm_contact',95,'Reminder screening of \"Black\" on next Friday',1,'2016-04-09',NULL,'0'),(14,'civicrm_contact',97,'Send reminder for annual dinner',1,'2016-01-05',NULL,'0'),(15,'civicrm_contact',99,'Arrange for cricket match with Sunil Gavaskar',1,'2016-04-16',NULL,'0'),(16,'civicrm_contact',37,'Organize the Terry Fox run',1,'2015-09-14',NULL,'0'),(17,'civicrm_contact',191,'Send newsletter for April 2005',1,'2015-12-13',NULL,'0'),(18,'civicrm_contact',170,'Arrange collection of funds from members',1,'2016-05-06',NULL,'0'),(19,'civicrm_contact',118,'Arrange for cricket match with Sunil Gavaskar',1,'2015-07-14',NULL,'0'),(20,'civicrm_contact',9,'Invite members for the Steve Prefontaine 10k dream run',1,'2015-10-03',NULL,'0'); /*!40000 ALTER TABLE `civicrm_note` ENABLE KEYS */; UNLOCK TABLES; @@ -1005,7 +1005,7 @@ UNLOCK TABLES; LOCK TABLES `civicrm_option_group` WRITE; /*!40000 ALTER TABLE `civicrm_option_group` DISABLE KEYS */; -INSERT INTO `civicrm_option_group` (`id`, `name`, `title`, `description`, `is_reserved`, `is_active`, `is_locked`) VALUES (1,'preferred_communication_method','Preferred Communication Method',NULL,1,1,0),(2,'activity_type','Activity Type',NULL,1,1,0),(3,'gender','Gender',NULL,1,1,0),(4,'instant_messenger_service','Instant Messenger (IM) screen-names',NULL,1,1,0),(5,'mobile_provider','Mobile Phone Providers',NULL,1,1,0),(6,'individual_prefix','Individual contact prefixes',NULL,1,1,0),(7,'individual_suffix','Individual contact suffixes',NULL,1,1,0),(8,'acl_role','ACL Role',NULL,1,1,0),(9,'accept_creditcard','Accepted Credit Cards',NULL,1,1,0),(10,'payment_instrument','Payment Methods',NULL,1,1,0),(11,'contribution_status','Contribution Status',NULL,1,1,1),(12,'pcp_status','PCP Status',NULL,1,1,1),(13,'pcp_owner_notify','PCP owner notifications',NULL,1,1,1),(14,'participant_role','Participant Role',NULL,1,1,0),(15,'event_type','Event Type',NULL,1,1,0),(16,'contact_view_options','Contact View Options',NULL,1,1,1),(17,'contact_smart_group_display','Contact Smart Group View Options',NULL,1,1,1),(18,'contact_edit_options','Contact Edit Options',NULL,1,1,1),(19,'advanced_search_options','Advanced Search Options',NULL,1,1,1),(20,'user_dashboard_options','User Dashboard Options',NULL,1,1,1),(21,'address_options','Addressing Options',NULL,1,1,0),(22,'group_type','Group Type',NULL,1,1,0),(23,'grant_status','Grant status',NULL,1,1,0),(24,'grant_type','Grant Type',NULL,1,1,0),(25,'custom_search','Custom Search',NULL,1,1,0),(26,'activity_status','Activity Status',NULL,1,1,0),(27,'case_type','Case Type',NULL,1,1,0),(28,'case_status','Case Status',NULL,1,1,0),(29,'participant_listing','Participant Listing',NULL,1,1,0),(30,'safe_file_extension','Safe File Extension',NULL,1,1,0),(31,'from_email_address','From Email Address',NULL,1,1,0),(32,'mapping_type','Mapping Type',NULL,1,1,1),(33,'wysiwyg_editor','WYSIWYG Editor',NULL,1,1,0),(34,'recur_frequency_units','Recurring Frequency Units',NULL,1,1,0),(35,'phone_type','Phone Type',NULL,1,1,0),(36,'custom_data_type','Custom Data Type',NULL,1,1,0),(37,'visibility','Visibility',NULL,1,1,0),(38,'mail_protocol','Mail Protocol',NULL,1,1,0),(39,'priority','Priority',NULL,1,1,0),(40,'redaction_rule','Redaction Rule',NULL,1,1,0),(41,'report_template','Report Template',NULL,1,1,0),(42,'email_greeting','Email Greeting Type',NULL,1,1,0),(43,'postal_greeting','Postal Greeting Type',NULL,1,1,0),(44,'addressee','Addressee Type',NULL,1,1,0),(45,'contact_autocomplete_options','Autocomplete Contact Search',NULL,1,1,1),(46,'contact_reference_options','Contact Reference Autocomplete Options',NULL,1,1,1),(47,'website_type','Website Type',NULL,1,1,0),(48,'tag_used_for','Tag Used For',NULL,1,1,1),(49,'currencies_enabled','Currencies Enabled',NULL,1,1,0),(50,'event_badge','Event Name Badge',NULL,1,1,0),(51,'note_privacy','Privacy levels for notes',NULL,1,1,0),(52,'campaign_type','Campaign Type',NULL,1,1,0),(53,'campaign_status','Campaign Status',NULL,1,1,0),(54,'system_extensions','CiviCRM Extensions',NULL,1,1,0),(55,'mail_approval_status','CiviMail Approval Status',NULL,1,1,0),(56,'engagement_index','Engagement Index',NULL,1,1,0),(57,'cg_extend_objects','Objects a custom group extends to',NULL,1,1,0),(58,'paper_size','Paper Size',NULL,1,1,0),(59,'pdf_format','PDF Page Format',NULL,1,1,0),(60,'label_format','Mailing Label Format',NULL,1,1,0),(61,'activity_contacts','Activity Contacts',NULL,1,1,1),(62,'account_relationship','Account Relationship',NULL,1,1,0),(63,'event_contacts','Event Recipients',NULL,1,1,0),(64,'conference_slot','Conference Slot',NULL,1,1,0),(65,'batch_type','Batch Type',NULL,1,1,1),(66,'batch_mode','Batch Mode',NULL,1,1,1),(67,'batch_status','Batch Status',NULL,1,1,1),(68,'sms_api_type','Api Type',NULL,1,1,0),(69,'sms_provider_name','Sms Provider Internal Name',NULL,1,1,0),(70,'auto_renew_options','Auto Renew Options',NULL,1,1,1),(71,'financial_account_type','Financial Account Type',NULL,1,1,0),(72,'financial_item_status','Financial Item Status',NULL,1,1,1),(73,'label_type','Label Type',NULL,1,1,0),(74,'name_badge','Name Badge Format',NULL,1,1,0),(75,'communication_style','Communication Style',NULL,1,1,0),(76,'msg_mode','Message Mode',NULL,1,1,0),(77,'contact_date_reminder_options','Contact Date Reminder Options',NULL,1,1,1),(78,'relative_date_filters','Relative Date Filters',NULL,1,1,0),(79,'languages','Languages','List of Languages',1,1,NULL),(80,'encounter_medium','Encounter Medium','Encounter medium for case activities (e.g. In Person, By Phone, etc.)',1,1,NULL),(81,'msg_tpl_workflow_case','Message Template Workflow for Cases','Message Template Workflow for Cases',1,1,NULL),(82,'msg_tpl_workflow_contribution','Message Template Workflow for Contributions','Message Template Workflow for Contributions',1,1,NULL),(83,'msg_tpl_workflow_event','Message Template Workflow for Events','Message Template Workflow for Events',1,1,NULL),(84,'msg_tpl_workflow_friend','Message Template Workflow for Tell-a-Friend','Message Template Workflow for Tell-a-Friend',1,1,NULL),(85,'msg_tpl_workflow_membership','Message Template Workflow for Memberships','Message Template Workflow for Memberships',1,1,NULL),(86,'msg_tpl_workflow_meta','Message Template Workflow for Meta Templates','Message Template Workflow for Meta Templates',1,1,NULL),(87,'msg_tpl_workflow_pledge','Message Template Workflow for Pledges','Message Template Workflow for Pledges',1,1,NULL),(88,'msg_tpl_workflow_uf','Message Template Workflow for Profiles','Message Template Workflow for Profiles',1,1,NULL),(89,'msg_tpl_workflow_petition','Message Template Workflow for Petition','Message Template Workflow for Petition',1,1,NULL),(90,'soft_credit_type','Soft Credit Types',NULL,1,1,NULL); +INSERT INTO `civicrm_option_group` (`id`, `name`, `title`, `description`, `data_type`, `is_reserved`, `is_active`, `is_locked`) VALUES (1,'preferred_communication_method','Preferred Communication Method',NULL,NULL,1,1,0),(2,'activity_type','Activity Type',NULL,'Integer',1,1,0),(3,'gender','Gender',NULL,'Integer',1,1,0),(4,'instant_messenger_service','Instant Messenger (IM) screen-names',NULL,NULL,1,1,0),(5,'mobile_provider','Mobile Phone Providers',NULL,NULL,1,1,0),(6,'individual_prefix','Individual contact prefixes',NULL,NULL,1,1,0),(7,'individual_suffix','Individual contact suffixes',NULL,NULL,1,1,0),(8,'acl_role','ACL Role',NULL,NULL,1,1,0),(9,'accept_creditcard','Accepted Credit Cards',NULL,NULL,1,1,0),(10,'payment_instrument','Payment Methods',NULL,'Integer',1,1,0),(11,'contribution_status','Contribution Status',NULL,NULL,1,1,1),(12,'pcp_status','PCP Status',NULL,NULL,1,1,1),(13,'pcp_owner_notify','PCP owner notifications',NULL,NULL,1,1,1),(14,'participant_role','Participant Role',NULL,'Integer',1,1,0),(15,'event_type','Event Type',NULL,'Integer',1,1,0),(16,'contact_view_options','Contact View Options',NULL,NULL,1,1,1),(17,'contact_smart_group_display','Contact Smart Group View Options',NULL,NULL,1,1,1),(18,'contact_edit_options','Contact Edit Options',NULL,NULL,1,1,1),(19,'advanced_search_options','Advanced Search Options',NULL,NULL,1,1,1),(20,'user_dashboard_options','User Dashboard Options',NULL,NULL,1,1,1),(21,'address_options','Addressing Options',NULL,NULL,1,1,0),(22,'group_type','Group Type',NULL,NULL,1,1,0),(23,'grant_status','Grant status',NULL,NULL,1,1,0),(24,'grant_type','Grant Type',NULL,NULL,1,1,0),(25,'custom_search','Custom Search',NULL,NULL,1,1,0),(26,'activity_status','Activity Status',NULL,'Integer',1,1,0),(27,'case_type','Case Type',NULL,NULL,1,1,0),(28,'case_status','Case Status',NULL,NULL,1,1,0),(29,'participant_listing','Participant Listing',NULL,NULL,1,1,0),(30,'safe_file_extension','Safe File Extension',NULL,NULL,1,1,0),(31,'from_email_address','From Email Address',NULL,NULL,1,1,0),(32,'mapping_type','Mapping Type',NULL,NULL,1,1,1),(33,'wysiwyg_editor','WYSIWYG Editor',NULL,NULL,1,1,0),(34,'recur_frequency_units','Recurring Frequency Units',NULL,NULL,1,1,0),(35,'phone_type','Phone Type',NULL,NULL,1,1,0),(36,'custom_data_type','Custom Data Type',NULL,NULL,1,1,0),(37,'visibility','Visibility',NULL,NULL,1,1,0),(38,'mail_protocol','Mail Protocol',NULL,NULL,1,1,0),(39,'priority','Priority',NULL,NULL,1,1,0),(40,'redaction_rule','Redaction Rule',NULL,NULL,1,1,0),(41,'report_template','Report Template',NULL,NULL,1,1,0),(42,'email_greeting','Email Greeting Type',NULL,NULL,1,1,0),(43,'postal_greeting','Postal Greeting Type',NULL,NULL,1,1,0),(44,'addressee','Addressee Type',NULL,NULL,1,1,0),(45,'contact_autocomplete_options','Autocomplete Contact Search',NULL,NULL,1,1,1),(46,'contact_reference_options','Contact Reference Autocomplete Options',NULL,NULL,1,1,1),(47,'website_type','Website Type',NULL,NULL,1,1,0),(48,'tag_used_for','Tag Used For',NULL,NULL,1,1,1),(49,'currencies_enabled','Currencies Enabled',NULL,NULL,1,1,0),(50,'event_badge','Event Name Badge',NULL,NULL,1,1,0),(51,'note_privacy','Privacy levels for notes',NULL,NULL,1,1,0),(52,'campaign_type','Campaign Type',NULL,NULL,1,1,0),(53,'campaign_status','Campaign Status',NULL,NULL,1,1,0),(54,'system_extensions','CiviCRM Extensions',NULL,NULL,1,1,0),(55,'mail_approval_status','CiviMail Approval Status',NULL,NULL,1,1,0),(56,'engagement_index','Engagement Index',NULL,NULL,1,1,0),(57,'cg_extend_objects','Objects a custom group extends to',NULL,NULL,1,1,0),(58,'paper_size','Paper Size',NULL,NULL,1,1,0),(59,'pdf_format','PDF Page Format',NULL,NULL,1,1,0),(60,'label_format','Mailing Label Format',NULL,NULL,1,1,0),(61,'activity_contacts','Activity Contacts',NULL,NULL,1,1,1),(62,'account_relationship','Account Relationship',NULL,NULL,1,1,0),(63,'event_contacts','Event Recipients',NULL,NULL,1,1,0),(64,'conference_slot','Conference Slot',NULL,NULL,1,1,0),(65,'batch_type','Batch Type',NULL,NULL,1,1,1),(66,'batch_mode','Batch Mode',NULL,NULL,1,1,1),(67,'batch_status','Batch Status',NULL,NULL,1,1,1),(68,'sms_api_type','Api Type',NULL,NULL,1,1,0),(69,'sms_provider_name','Sms Provider Internal Name',NULL,NULL,1,1,0),(70,'auto_renew_options','Auto Renew Options',NULL,NULL,1,1,1),(71,'financial_account_type','Financial Account Type',NULL,NULL,1,1,0),(72,'financial_item_status','Financial Item Status',NULL,NULL,1,1,1),(73,'label_type','Label Type',NULL,NULL,1,1,0),(74,'name_badge','Name Badge Format',NULL,NULL,1,1,0),(75,'communication_style','Communication Style',NULL,NULL,1,1,0),(76,'msg_mode','Message Mode',NULL,NULL,1,1,0),(77,'contact_date_reminder_options','Contact Date Reminder Options',NULL,NULL,1,1,1),(78,'relative_date_filters','Relative Date Filters',NULL,NULL,1,1,0),(79,'languages','Languages','List of Languages',NULL,1,1,NULL),(80,'encounter_medium','Encounter Medium','Encounter medium for case activities (e.g. In Person, By Phone, etc.)',NULL,1,1,NULL),(81,'msg_tpl_workflow_case','Message Template Workflow for Cases','Message Template Workflow for Cases',NULL,1,1,NULL),(82,'msg_tpl_workflow_contribution','Message Template Workflow for Contributions','Message Template Workflow for Contributions',NULL,1,1,NULL),(83,'msg_tpl_workflow_event','Message Template Workflow for Events','Message Template Workflow for Events',NULL,1,1,NULL),(84,'msg_tpl_workflow_friend','Message Template Workflow for Tell-a-Friend','Message Template Workflow for Tell-a-Friend',NULL,1,1,NULL),(85,'msg_tpl_workflow_membership','Message Template Workflow for Memberships','Message Template Workflow for Memberships',NULL,1,1,NULL),(86,'msg_tpl_workflow_meta','Message Template Workflow for Meta Templates','Message Template Workflow for Meta Templates',NULL,1,1,NULL),(87,'msg_tpl_workflow_pledge','Message Template Workflow for Pledges','Message Template Workflow for Pledges',NULL,1,1,NULL),(88,'msg_tpl_workflow_uf','Message Template Workflow for Profiles','Message Template Workflow for Profiles',NULL,1,1,NULL),(89,'msg_tpl_workflow_petition','Message Template Workflow for Petition','Message Template Workflow for Petition',NULL,1,1,NULL),(90,'soft_credit_type','Soft Credit Types',NULL,NULL,1,1,NULL); /*!40000 ALTER TABLE `civicrm_option_group` ENABLE KEYS */; UNLOCK TABLES; diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index 920b5180c7..d21e49452d 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -130,86 +130,86 @@ VALUES -- option groups and values for 'preferred communication methods' , 'activity types', 'gender', etc. INSERT INTO - `civicrm_option_group` (`name`, `title`, `is_reserved`, `is_active`, `is_locked`) + `civicrm_option_group` (`name`, `title`, `data_type`, `is_reserved`, `is_active`, `is_locked`) VALUES - ('preferred_communication_method', '{ts escape="sql"}Preferred Communication Method{/ts}' , 1, 1, 0), - ('activity_type' , '{ts escape="sql"}Activity Type{/ts}' , 1, 1, 0), - ('gender' , '{ts escape="sql"}Gender{/ts}' , 1, 1, 0), - ('instant_messenger_service' , '{ts escape="sql"}Instant Messenger (IM) screen-names{/ts}', 1, 1, 0), - ('mobile_provider' , '{ts escape="sql"}Mobile Phone Providers{/ts}' , 1, 1, 0), - ('individual_prefix' , '{ts escape="sql"}Individual contact prefixes{/ts}' , 1, 1, 0), - ('individual_suffix' , '{ts escape="sql"}Individual contact suffixes{/ts}' , 1, 1, 0), - ('acl_role' , '{ts escape="sql"}ACL Role{/ts}' , 1, 1, 0), - ('accept_creditcard' , '{ts escape="sql"}Accepted Credit Cards{/ts}' , 1, 1, 0), - ('payment_instrument' , '{ts escape="sql"}Payment Methods{/ts}' , 1, 1, 0), - ('contribution_status' , '{ts escape="sql"}Contribution Status{/ts}' , 1, 1, 1), - ('pcp_status' , '{ts escape="sql"}PCP Status{/ts}' , 1, 1, 1), - ('pcp_owner_notify' , '{ts escape="sql"}PCP owner notifications{/ts}' , 1, 1, 1), - ('participant_role' , '{ts escape="sql"}Participant Role{/ts}' , 1, 1, 0), - ('event_type' , '{ts escape="sql"}Event Type{/ts}' , 1, 1, 0), - ('contact_view_options' , '{ts escape="sql"}Contact View Options{/ts}' , 1, 1, 1), - ('contact_smart_group_display' , '{ts escape="sql"}Contact Smart Group View Options{/ts}' , 1, 1, 1), - ('contact_edit_options' , '{ts escape="sql"}Contact Edit Options{/ts}' , 1, 1, 1), - ('advanced_search_options' , '{ts escape="sql"}Advanced Search Options{/ts}' , 1, 1, 1), - ('user_dashboard_options' , '{ts escape="sql"}User Dashboard Options{/ts}' , 1, 1, 1), - ('address_options' , '{ts escape="sql"}Addressing Options{/ts}' , 1, 1, 0), - ('group_type' , '{ts escape="sql"}Group Type{/ts}' , 1, 1, 0), - ('grant_status' , '{ts escape="sql"}Grant status{/ts}' , 1, 1, 0), - ('grant_type' , '{ts escape="sql"}Grant Type{/ts}' , 1, 1, 0), - ('custom_search' , '{ts escape="sql"}Custom Search{/ts}' , 1, 1, 0), - ('activity_status' , '{ts escape="sql"}Activity Status{/ts}' , 1, 1, 0), - ('case_type' , '{ts escape="sql"}Case Type{/ts}' , 1, 1, 0), - ('case_status' , '{ts escape="sql"}Case Status{/ts}' , 1, 1, 0), - ('participant_listing' , '{ts escape="sql"}Participant Listing{/ts}' , 1, 1, 0), - ('safe_file_extension' , '{ts escape="sql"}Safe File Extension{/ts}' , 1, 1, 0), - ('from_email_address' , '{ts escape="sql"}From Email Address{/ts}' , 1, 1, 0), - ('mapping_type' , '{ts escape="sql"}Mapping Type{/ts}' , 1, 1, 1), - ('wysiwyg_editor' , '{ts escape="sql"}WYSIWYG Editor{/ts}' , 1, 1, 0), - ('recur_frequency_units' , '{ts escape="sql"}Recurring Frequency Units{/ts}' , 1, 1, 0), - ('phone_type' , '{ts escape="sql"}Phone Type{/ts}' , 1, 1, 0), - ('custom_data_type' , '{ts escape="sql"}Custom Data Type{/ts}' , 1, 1, 0), - ('visibility' , '{ts escape="sql"}Visibility{/ts}' , 1, 1, 0), - ('mail_protocol' , '{ts escape="sql"}Mail Protocol{/ts}' , 1, 1, 0), - ('priority' , '{ts escape="sql"}Priority{/ts}' , 1, 1, 0), - ('redaction_rule' , '{ts escape="sql"}Redaction Rule{/ts}' , 1, 1, 0), - ('report_template' , '{ts escape="sql"}Report Template{/ts}' , 1, 1, 0), - ('email_greeting' , '{ts escape="sql"}Email Greeting Type{/ts}' , 1, 1, 0), - ('postal_greeting' , '{ts escape="sql"}Postal Greeting Type{/ts}' , 1, 1, 0), - ('addressee' , '{ts escape="sql"}Addressee Type{/ts}' , 1, 1, 0), - ('contact_autocomplete_options' , '{ts escape="sql"}Autocomplete Contact Search{/ts}' , 1, 1, 1), - ('contact_reference_options' , '{ts escape="sql"}Contact Reference Autocomplete Options{/ts}', 1, 1, 1), - ('website_type' , '{ts escape="sql"}Website Type{/ts}' , 1, 1, 0), - ('tag_used_for' , '{ts escape="sql"}Tag Used For{/ts}' , 1, 1, 1), - ('currencies_enabled' , '{ts escape="sql"}Currencies Enabled{/ts}' , 1, 1, 0), - ('event_badge' , '{ts escape="sql"}Event Name Badge{/ts}' , 1, 1, 0), - ('note_privacy' , '{ts escape="sql"}Privacy levels for notes{/ts}' , 1, 1, 0), - ('campaign_type' , '{ts escape="sql"}Campaign Type{/ts}' , 1, 1, 0), - ('campaign_status' , '{ts escape="sql"}Campaign Status{/ts}' , 1, 1, 0), - ('system_extensions' , '{ts escape="sql"}CiviCRM Extensions{/ts}' , 1, 1, 0), - ('mail_approval_status' , '{ts escape="sql"}CiviMail Approval Status{/ts}' , 1, 1, 0), - ('engagement_index' , '{ts escape="sql"}Engagement Index{/ts}' , 1, 1, 0), - ('cg_extend_objects' , '{ts escape="sql"}Objects a custom group extends to{/ts}' , 1, 1, 0), - ('paper_size' , '{ts escape="sql"}Paper Size{/ts}' , 1, 1, 0), - ('pdf_format' , '{ts escape="sql"}PDF Page Format{/ts}' , 1, 1, 0), - ('label_format' , '{ts escape="sql"}Mailing Label Format{/ts}' , 1, 1, 0), - ('activity_contacts' , '{ts escape="sql"}Activity Contacts{/ts}' , 1, 1, 1), - ('account_relationship' , '{ts escape="sql"}Account Relationship{/ts}' , 1, 1, 0), - ('event_contacts' , '{ts escape="sql"}Event Recipients{/ts}' , 1, 1, 0), - ('conference_slot' , '{ts escape="sql"}Conference Slot{/ts}' , 1, 1, 0), - ('batch_type' , '{ts escape="sql"}Batch Type{/ts}' , 1, 1, 1), - ('batch_mode' , '{ts escape="sql"}Batch Mode{/ts}' , 1, 1, 1), - ('batch_status' , '{ts escape="sql"}Batch Status{/ts}' , 1, 1, 1), - ('sms_api_type' , '{ts escape="sql"}Api Type{/ts}' , 1, 1, 0), - ('sms_provider_name' , '{ts escape="sql"}Sms Provider Internal Name{/ts}' , 1, 1, 0), - ('auto_renew_options' , '{ts escape="sql"}Auto Renew Options{/ts}' , 1, 1, 1), - ('financial_account_type' , '{ts escape="sql"}Financial Account Type{/ts}' , 1, 1, 0), - ('financial_item_status' , '{ts escape="sql"}Financial Item Status{/ts}' , 1, 1, 1), - ('label_type' , '{ts escape="sql"}Label Type{/ts}' , 1, 1, 0), - ('name_badge' , '{ts escape="sql"}Name Badge Format{/ts}' , 1, 1, 0), - ('communication_style' , '{ts escape="sql"}Communication Style{/ts}' , 1, 1, 0), - ('msg_mode' , '{ts escape="sql"}Message Mode{/ts}' , 1, 1, 0), - ('contact_date_reminder_options' , '{ts escape="sql"}Contact Date Reminder Options{/ts}' , 1, 1, 1), - ('relative_date_filters' , '{ts escape="sql"}Relative Date Filters{/ts}' , 1, 1, 0); + ('preferred_communication_method', '{ts escape="sql"}Preferred Communication Method{/ts}' , NULL, 1, 1, 0), + ('activity_type' , '{ts escape="sql"}Activity Type{/ts}' , 'Integer', 1, 1, 0), + ('gender' , '{ts escape="sql"}Gender{/ts}' , 'Integer', 1, 1, 0), + ('instant_messenger_service' , '{ts escape="sql"}Instant Messenger (IM) screen-names{/ts}', NULL, 1, 1, 0), + ('mobile_provider' , '{ts escape="sql"}Mobile Phone Providers{/ts}' , NULL, 1, 1, 0), + ('individual_prefix' , '{ts escape="sql"}Individual contact prefixes{/ts}' , NULL, 1, 1, 0), + ('individual_suffix' , '{ts escape="sql"}Individual contact suffixes{/ts}' , NULL, 1, 1, 0), + ('acl_role' , '{ts escape="sql"}ACL Role{/ts}' , NULL, 1, 1, 0), + ('accept_creditcard' , '{ts escape="sql"}Accepted Credit Cards{/ts}' , NULL, 1, 1, 0), + ('payment_instrument' , '{ts escape="sql"}Payment Methods{/ts}' , 'Integer', 1, 1, 0), + ('contribution_status' , '{ts escape="sql"}Contribution Status{/ts}' , NULL, 1, 1, 1), + ('pcp_status' , '{ts escape="sql"}PCP Status{/ts}' , NULL, 1, 1, 1), + ('pcp_owner_notify' , '{ts escape="sql"}PCP owner notifications{/ts}' , NULL, 1, 1, 1), + ('participant_role' , '{ts escape="sql"}Participant Role{/ts}' , 'Integer', 1, 1, 0), + ('event_type' , '{ts escape="sql"}Event Type{/ts}' , 'Integer', 1, 1, 0), + ('contact_view_options' , '{ts escape="sql"}Contact View Options{/ts}' , NULL, 1, 1, 1), + ('contact_smart_group_display' , '{ts escape="sql"}Contact Smart Group View Options{/ts}' , NULL, 1, 1, 1), + ('contact_edit_options' , '{ts escape="sql"}Contact Edit Options{/ts}' , NULL, 1, 1, 1), + ('advanced_search_options' , '{ts escape="sql"}Advanced Search Options{/ts}' , NULL, 1, 1, 1), + ('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), + ('case_status' , '{ts escape="sql"}Case Status{/ts}' , NULL, 1, 1, 0), + ('participant_listing' , '{ts escape="sql"}Participant Listing{/ts}' , NULL, 1, 1, 0), + ('safe_file_extension' , '{ts escape="sql"}Safe File Extension{/ts}' , NULL, 1, 1, 0), + ('from_email_address' , '{ts escape="sql"}From Email Address{/ts}' , NULL, 1, 1, 0), + ('mapping_type' , '{ts escape="sql"}Mapping Type{/ts}' , NULL, 1, 1, 1), + ('wysiwyg_editor' , '{ts escape="sql"}WYSIWYG Editor{/ts}' , NULL, 1, 1, 0), + ('recur_frequency_units' , '{ts escape="sql"}Recurring Frequency Units{/ts}' , NULL, 1, 1, 0), + ('phone_type' , '{ts escape="sql"}Phone Type{/ts}' , NULL, 1, 1, 0), + ('custom_data_type' , '{ts escape="sql"}Custom Data Type{/ts}' , NULL, 1, 1, 0), + ('visibility' , '{ts escape="sql"}Visibility{/ts}' , NULL, 1, 1, 0), + ('mail_protocol' , '{ts escape="sql"}Mail Protocol{/ts}' , NULL, 1, 1, 0), + ('priority' , '{ts escape="sql"}Priority{/ts}' , NULL, 1, 1, 0), + ('redaction_rule' , '{ts escape="sql"}Redaction Rule{/ts}' , NULL, 1, 1, 0), + ('report_template' , '{ts escape="sql"}Report Template{/ts}' , NULL, 1, 1, 0), + ('email_greeting' , '{ts escape="sql"}Email Greeting Type{/ts}' , NULL, 1, 1, 0), + ('postal_greeting' , '{ts escape="sql"}Postal Greeting Type{/ts}' , NULL, 1, 1, 0), + ('addressee' , '{ts escape="sql"}Addressee Type{/ts}' , NULL, 1, 1, 0), + ('contact_autocomplete_options' , '{ts escape="sql"}Autocomplete Contact Search{/ts}' , NULL, 1, 1, 1), + ('contact_reference_options' , '{ts escape="sql"}Contact Reference Autocomplete Options{/ts}', NULL, 1, 1, 1), + ('website_type' , '{ts escape="sql"}Website Type{/ts}' , NULL, 1, 1, 0), + ('tag_used_for' , '{ts escape="sql"}Tag Used For{/ts}' , NULL, 1, 1, 1), + ('currencies_enabled' , '{ts escape="sql"}Currencies Enabled{/ts}' , NULL, 1, 1, 0), + ('event_badge' , '{ts escape="sql"}Event Name Badge{/ts}' , NULL, 1, 1, 0), + ('note_privacy' , '{ts escape="sql"}Privacy levels for notes{/ts}' , NULL, 1, 1, 0), + ('campaign_type' , '{ts escape="sql"}Campaign Type{/ts}' , NULL, 1, 1, 0), + ('campaign_status' , '{ts escape="sql"}Campaign Status{/ts}' , NULL, 1, 1, 0), + ('system_extensions' , '{ts escape="sql"}CiviCRM Extensions{/ts}' , NULL, 1, 1, 0), + ('mail_approval_status' , '{ts escape="sql"}CiviMail Approval Status{/ts}' , NULL, 1, 1, 0), + ('engagement_index' , '{ts escape="sql"}Engagement Index{/ts}' , NULL, 1, 1, 0), + ('cg_extend_objects' , '{ts escape="sql"}Objects a custom group extends to{/ts}' , NULL, 1, 1, 0), + ('paper_size' , '{ts escape="sql"}Paper Size{/ts}' , NULL, 1, 1, 0), + ('pdf_format' , '{ts escape="sql"}PDF Page Format{/ts}' , NULL, 1, 1, 0), + ('label_format' , '{ts escape="sql"}Mailing Label Format{/ts}' , NULL, 1, 1, 0), + ('activity_contacts' , '{ts escape="sql"}Activity Contacts{/ts}' , NULL, 1, 1, 1), + ('account_relationship' , '{ts escape="sql"}Account Relationship{/ts}' , NULL, 1, 1, 0), + ('event_contacts' , '{ts escape="sql"}Event Recipients{/ts}' , NULL, 1, 1, 0), + ('conference_slot' , '{ts escape="sql"}Conference Slot{/ts}' , NULL, 1, 1, 0), + ('batch_type' , '{ts escape="sql"}Batch Type{/ts}' , NULL, 1, 1, 1), + ('batch_mode' , '{ts escape="sql"}Batch Mode{/ts}' , NULL, 1, 1, 1), + ('batch_status' , '{ts escape="sql"}Batch Status{/ts}' , NULL, 1, 1, 1), + ('sms_api_type' , '{ts escape="sql"}Api Type{/ts}' , NULL, 1, 1, 0), + ('sms_provider_name' , '{ts escape="sql"}Sms Provider Internal Name{/ts}' , NULL, 1, 1, 0), + ('auto_renew_options' , '{ts escape="sql"}Auto Renew Options{/ts}' , NULL, 1, 1, 1), + ('financial_account_type' , '{ts escape="sql"}Financial Account Type{/ts}' , NULL, 1, 1, 0), + ('financial_item_status' , '{ts escape="sql"}Financial Item Status{/ts}' , NULL, 1, 1, 1), + ('label_type' , '{ts escape="sql"}Label Type{/ts}' , NULL, 1, 1, 0), + ('name_badge' , '{ts escape="sql"}Name Badge Format{/ts}' , NULL, 1, 1, 0), + ('communication_style' , '{ts escape="sql"}Communication Style{/ts}' , NULL, 1, 1, 0), + ('msg_mode' , '{ts escape="sql"}Message Mode{/ts}' , NULL, 1, 1, 0), + ('contact_date_reminder_options' , '{ts escape="sql"}Contact Date Reminder Options{/ts}' , NULL, 1, 1, 1), + ('relative_date_filters' , '{ts escape="sql"}Relative Date Filters{/ts}' , NULL, 1, 1, 0); SELECT @option_group_id_pcm := max(id) from civicrm_option_group where name = 'preferred_communication_method'; SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type'; -- 2.25.1