const IMPORT_ENTITY = 'Activity';
+ /**
+ * Get the name of the type to be stored in civicrm_user_job.type_id.
+ *
+ * @return string
+ */
+ public function getUserJobType(): string {
+ return 'activity_import';
+ }
+
/**
* @var bool
*/
*/
class CRM_Contact_Import_Form_DataSource extends CRM_Import_Form_DataSource {
+ /**
+ * Get the name of the type to be stored in civicrm_user_job.type_id.
+ *
+ * @return string
+ */
+ public function getUserJobType(): string {
+ return 'contact_import';
+ }
+
/**
* Get any smarty elements that may not be present in the form.
*
const IMPORT_ENTITY = 'Contribution';
+ /**
+ * Get the name of the type to be stored in civicrm_user_job.type_id.
+ *
+ * @return string
+ */
+ public function getUserJobType(): string {
+ return 'contribution_import';
+ }
+
/**
* Build the form object.
*/
'id' => 1,
'name' => 'contact_import',
'label' => ts('Contact Import'),
+ 'class' => 'CRM_Contact_Import_Parser_Contact',
+ ],
+ [
+ 'id' => 2,
+ 'name' => 'contribution_import',
+ 'label' => ts('Contribution Import'),
+ 'class' => 'CRM_Contribute_Import_Parser_Contribution',
+ ],
+ [
+ 'id' => 3,
+ 'name' => 'membership_import',
+ 'label' => ts('Membership Import'),
+ 'class' => 'CRM_Member_Import_Parser_Membership',
+ ],
+ [
+ 'id' => 4,
+ 'name' => 'activity_import',
+ 'label' => ts('Activity Import'),
+ 'class' => 'CRM_Activity_Import_Parser_Activity',
+ ],
+ [
+ 'id' => 5,
+ 'name' => 'participant_import',
+ 'label' => ts('Participant Import'),
+ 'class' => 'CRM_Event_Import_Parser_Participant',
+ ],
+ [
+ 'id' => 6,
+ 'name' => 'custom_field_import',
+ 'label' => ts('Multiple Value Custom Field Import'),
+ 'class' => 'CRM_Custom_Import_Parser_Api',
],
];
}
const IMPORT_ENTITY = 'Multi value custom data';
+ /**
+ * Get the name of the type to be stored in civicrm_user_job.type_id.
+ *
+ * @return string
+ */
+ public function getUserJobType(): string {
+ return 'custom_field_import';
+ }
+
/**
* Get the import entity (translated).
*
const IMPORT_ENTITY = 'Participant';
+ /**
+ * Get the name of the type to be stored in civicrm_user_job.type_id.
+ *
+ * @return string
+ */
+ public function getUserJobType(): string {
+ return 'participant_import';
+ }
+
/**
* Build the form object.
*
$id = UserJob::create(FALSE)
->setValues([
'created_id' => CRM_Core_Session::getLoggedInContactID(),
- 'type_id:name' => 'contact_import',
+ 'type_id:name' => $this->getUserJobType(),
'status_id:name' => 'draft',
// This suggests the data could be cleaned up after this.
'expires_date' => '+ 1 week',
const IMPORT_ENTITY = 'Membership';
+ /**
+ * Get the name of the type to be stored in civicrm_user_job.type_id.
+ *
+ * @return string
+ */
+ public function getUserJobType(): string {
+ return 'membership_import';
+ }
+
/**
* Build the form object.
*