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_Contribute_Import_Form_DataSource
extends CRM_Import_Form_DataSource
{
23 const PATH
= 'civicrm/contribute/import';
25 const IMPORT_ENTITY
= 'Contribution';
28 * Build the form object.
30 public function buildQuickForm() {
31 parent
::buildQuickForm();
33 $duplicateOptions = [];
34 $duplicateOptions[] = $this->createElement('radio',
35 NULL, NULL, ts('Insert new contributions'), CRM_Import_Parser
::DUPLICATE_SKIP
37 $duplicateOptions[] = $this->createElement('radio',
38 NULL, NULL, ts('Update existing contributions'), CRM_Import_Parser
::DUPLICATE_UPDATE
40 $this->addGroup($duplicateOptions, 'onDuplicate',
44 $this->setDefaults(['onDuplicate' => CRM_Import_Parser
::DUPLICATE_SKIP
]);
46 $this->addElement('submit', 'loadMapping', ts('Load Mapping'), NULL, ['onclick' => 'checkSelect()']);
48 $this->addContactTypeSelector();
52 * Process the uploaded file.
54 public function postProcess() {
55 $this->storeFormValues([
62 $this->submitFileForMapping('CRM_Contribute_Import_Parser_Contribution');