Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove obsolete addField from activity import #24376

Merged
merged 1 commit into from
Aug 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 0 additions & 108 deletions CRM/Activity/Import/Field.php

This file was deleted.

34 changes: 0 additions & 34 deletions CRM/Activity/Import/Parser/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ public static function getUserJobInfo(): array {
*/
public function init() {
$this->setFieldMetadata();

foreach ($this->importableFieldsMetadata as $name => $field) {
$field['type'] = CRM_Utils_Array::value('type', $field, CRM_Utils_Type::T_INT);
$field['dataPattern'] = CRM_Utils_Array::value('dataPattern', $field, '//');
$field['headerPattern'] = CRM_Utils_Array::value('headerPattern', $field, '//');
if (!empty($field['custom_group_id'])) {
$field['title'] = $field["groupTitle"] . ' :: ' . $field["title"];
}
$this->addField($name, $field['title'], $field['type'], $field['headerPattern'], $field['dataPattern']);
}
}

/**
Expand Down Expand Up @@ -192,30 +182,6 @@ protected function getRequiredFields(): array {
return [['activity_type_id' => ts('Activity Type'), 'activity_date_time' => ts('Activity Date')]];
}

/**
* @deprecated - these are just used in a couple of parent class functions now.
* @param string $name
* @param $title
* @param int $type
* @param string $headerPattern
* @param string $dataPattern
*/
public function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') {
if (empty($name)) {
$this->_fields['doNotImport'] = new CRM_Activity_Import_Field($name, $title, $type, $headerPattern, $dataPattern);
}
else {

$tempField = CRM_Contact_BAO_Contact::importableFields('Individual', NULL);
if (!array_key_exists($name, $tempField)) {
$this->_fields[$name] = new CRM_Activity_Import_Field($name, $title, $type, $headerPattern, $dataPattern);
}
else {
$this->_fields[$name] = new CRM_Contact_Import_Field($name, $title, $type, $headerPattern, $dataPattern, CRM_Utils_Array::value('hasLocationType', $tempField[$name]));
}
}
}

/**
* Ensure metadata is loaded.
*/
Expand Down