Afform - basic support for creating event participant
authorColeman Watts <coleman@civicrm.org>
Wed, 31 Aug 2022 02:07:53 +0000 (22:07 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 31 Aug 2022 14:55:30 +0000 (10:55 -0400)
CRM/Event/DAO/Participant.php
ext/afform/admin/afformEntities/Participant.php [new file with mode: 0644]
xml/schema/Event/Participant.xml

index aad57f4f226e4401b3e99f09e6f0510c4de62f07..d211c9dac34fa574364f7f584eee049cf6e7b0d5 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Event/Participant.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:ebc70049a0ce4ebc8b7abce72db42fbb)
+ * (GenCodeChecksum:960cee02820bf56c6680756220449e6a)
  */
 
 /**
@@ -309,6 +309,7 @@ class CRM_Event_DAO_Participant extends CRM_Core_DAO {
           'localizable' => 0,
           'FKClassName' => 'CRM_Contact_DAO_Contact',
           'html' => [
+            'type' => 'EntityRef',
             'label' => ts("Contact"),
           ],
           'add' => '1.7',
@@ -329,6 +330,7 @@ class CRM_Event_DAO_Participant extends CRM_Core_DAO {
           'localizable' => 0,
           'FKClassName' => 'CRM_Event_DAO_Event',
           'html' => [
+            'type' => 'EntityRef',
             'label' => ts("Event"),
           ],
           'add' => '1.7',
diff --git a/ext/afform/admin/afformEntities/Participant.php b/ext/afform/admin/afformEntities/Participant.php
new file mode 100644 (file)
index 0000000..42f3cad
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+return [
+  'type' => 'primary',
+  'defaults' => "{
+    data: {
+      contact_id: 'user_contact_id',
+      status_id: '1',
+      event_id: ''
+    },
+    actions: {create: true, update: false}
+  }",
+  'boilerplate' => [],
+];
index 504afc47a1cf81d9c02ef21f71845fb0f0fe1ef5..0ac96e86b41daf2dbb8fdffc7458d8a1ef199dab 100644 (file)
@@ -38,6 +38,7 @@
     <comment>FK to Contact ID</comment>
     <html>
       <label>Contact</label>
+      <type>EntityRef</type>
     </html>
     <add>1.7</add>
   </field>
@@ -57,6 +58,7 @@
     <comment>FK to Event ID</comment>
     <html>
       <label>Event</label>
+      <type>EntityRef</type>
     </html>
     <add>1.7</add>
   </field>