3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class gets the name of the file to upload
21 class CRM_Event_Import_Form_DataSource
extends CRM_Import_Form_DataSource
{
23 const PATH
= 'civicrm/event/import';
25 const IMPORT_ENTITY
= 'Participant';
28 * Build the form object.
32 public function buildQuickForm() {
33 parent
::buildQuickForm();
35 $duplicateOptions = [];
36 $duplicateOptions[] = $this->createElement('radio',
37 NULL, NULL, ts('Skip'), CRM_Import_Parser
::DUPLICATE_SKIP
39 $duplicateOptions[] = $this->createElement('radio',
40 NULL, NULL, ts('Update'), CRM_Import_Parser
::DUPLICATE_UPDATE
42 $duplicateOptions[] = $this->createElement('radio',
43 NULL, NULL, ts('No Duplicate Checking'), CRM_Import_Parser
::DUPLICATE_NOCHECK
45 $this->addGroup($duplicateOptions, 'onDuplicate',
46 ts('On Duplicate Entries')
49 $this->setDefaults(['onDuplicate' => CRM_Import_Parser
::DUPLICATE_SKIP
]);
51 $this->addContactTypeSelector();
55 * Process the uploaded file.
59 public function postProcess() {
60 $this->storeFormValues([
67 $this->submitFileForMapping('CRM_Event_Import_Parser_Participant');