From 92a9d4d9c147bb665c8218d71d3e0491777f2bf3 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 30 Aug 2022 22:07:53 -0400 Subject: [PATCH] Afform - basic support for creating event participant --- CRM/Event/DAO/Participant.php | 4 +++- ext/afform/admin/afformEntities/Participant.php | 13 +++++++++++++ xml/schema/Event/Participant.xml | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 ext/afform/admin/afformEntities/Participant.php diff --git a/CRM/Event/DAO/Participant.php b/CRM/Event/DAO/Participant.php index aad57f4f22..d211c9dac3 100644 --- a/CRM/Event/DAO/Participant.php +++ b/CRM/Event/DAO/Participant.php @@ -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 index 0000000000..42f3cad7e2 --- /dev/null +++ b/ext/afform/admin/afformEntities/Participant.php @@ -0,0 +1,13 @@ + 'primary', + 'defaults' => "{ + data: { + contact_id: 'user_contact_id', + status_id: '1', + event_id: '' + }, + actions: {create: true, update: false} + }", + 'boilerplate' => [], +]; diff --git a/xml/schema/Event/Participant.xml b/xml/schema/Event/Participant.xml index 504afc47a1..0ac96e86b4 100644 --- a/xml/schema/Event/Participant.xml +++ b/xml/schema/Event/Participant.xml @@ -38,6 +38,7 @@ FK to Contact ID + EntityRef 1.7 @@ -57,6 +58,7 @@ FK to Event ID + EntityRef 1.7 -- 2.25.1