Metadata - Add "civicrm_note" to "note_used_for" option group
authorcolemanw <coleman@civicrm.org>
Tue, 12 Sep 2023 01:45:41 +0000 (21:45 -0400)
committercolemanw <coleman@civicrm.org>
Tue, 12 Sep 2023 16:09:51 +0000 (12:09 -0400)
CRM/Upgrade/Incremental/php/FiveSixtySeven.php
sql/civicrm_data/civicrm_option_group/note_used_for.sqldata.php

index 71a2ae32c77d5dee596b9dd249702fd49420e60d..0745dab82bacf290d4877e903e35505e36642db3 100644 (file)
@@ -32,6 +32,17 @@ class CRM_Upgrade_Incremental_php_FiveSixtySeven extends CRM_Upgrade_Incremental
     $this->addTask('Make EntityFile.entity_table required', 'alterColumn', 'civicrm_entity_file', 'entity_table', "varchar(64) NOT NULL COMMENT 'physical tablename for entity being joined to file, e.g. civicrm_contact'");
     $this->addExtensionTask('Enable Authx extension', ['authx'], 1101);
     $this->addExtensionTask('Enable Afform extension', ['org.civicrm.afform'], 1102);
+    $this->addTask('Add "civicrm_note" to "note_used_for" option group', 'addNoteNote');
+  }
+
+  public static function addNoteNote(CRM_Queue_TaskContext $ctx): bool {
+    CRM_Core_BAO_OptionValue::ensureOptionValueExists([
+      'option_group_id' => 'note_used_for',
+      'label' => ts('Notes'),
+      'name' => 'Note',
+      'value' => 'civicrm_note',
+    ]);
+    return TRUE;
   }
 
 }
index a3ed714dccad68547279857c50427e504c9861af..f36eb93f2097789ca37f5b57b6734794e53b459f 100644 (file)
@@ -9,4 +9,6 @@ return CRM_Core_CodeGen_OptionGroup::create('note_used_for', 'a/0047')
     [ts('Relationships'), 'Relationship', 'civicrm_relationship'],
     [ts('Participants'), 'Participant', 'civicrm_participant'],
     [ts('Contributions'), 'Contribution', 'civicrm_contribution'],
+    // Notes can be attached to notes as comments
+    [ts('Notes'), 'Note', 'civicrm_note'],
   ]);