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_Member_Import_Form_DataSource
extends CRM_Import_Form_DataSource
{
23 const PATH
= 'civicrm/member/import';
25 const IMPORT_ENTITY
= 'Membership';
28 * Build the form object.
32 public function buildQuickForm() {
33 parent
::buildQuickForm();
35 $this->addRadio('onDuplicate', ts('Import mode'), [
36 CRM_Import_Parser
::DUPLICATE_SKIP
=> ts('Insert new Membership'),
37 CRM_Import_Parser
::DUPLICATE_UPDATE
=> ts('Update existing Membership'),
40 'onDuplicate' => CRM_Import_Parser
::DUPLICATE_SKIP
,
43 $this->addContactTypeSelector();
47 * Process the uploaded file.
51 public function postProcess() {
52 $this->storeFormValues([
59 $this->submitFileForMapping('CRM_Member_Import_Parser_Membership');
63 * @return \CRM_Member_Import_Parser_Membership
65 protected function getParser(): CRM_Member_Import_Parser_Membership
{
67 $this->parser
= new CRM_Member_Import_Parser_Membership();
68 $this->parser
->setUserJobID($this->getUserJobID());
69 $this->parser
->init();