From a05662ef0fbe0620783ce99b80a38a45db01fec0 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 8 Jun 2013 16:23:50 -0700 Subject: [PATCH] Update calls to class constants CRM-11254 ---------------------------------------- * CRM-11254: Create parent class for import http://issues.civicrm.org/jira/browse/CRM-11254 --- CRM/Activity/Import/Form/MapField.php | 2 +- CRM/Activity/Import/Form/Preview.php | 16 +-- CRM/Activity/Import/Form/Summary.php | 8 +- CRM/Activity/Import/Form/UploadFile.php | 10 +- CRM/Activity/Import/Parser/Activity.php | 30 +++--- CRM/Contact/Import/Form/DataSource.php | 22 ++-- CRM/Contact/Import/Form/MapField.php | 26 ++--- CRM/Contact/Import/Form/Preview.php | 22 ++-- CRM/Contact/Import/Form/Summary.php | 12 +-- CRM/Contact/Import/ImportJob.php | 4 +- CRM/Contact/Import/Parser.php | 32 +++--- CRM/Contact/Import/Parser/Contact.php | 102 +++++++++--------- CRM/Contribute/Import/Form/MapField.php | 26 ++--- CRM/Contribute/Import/Form/Preview.php | 16 +-- CRM/Contribute/Import/Form/Summary.php | 8 +- CRM/Contribute/Import/Form/UploadFile.php | 16 +-- CRM/Contribute/Import/Parser.php | 50 ++++----- CRM/Contribute/Import/Parser/Contribution.php | 40 +++---- CRM/Event/Import/Form/MapField.php | 16 +-- CRM/Event/Import/Form/Preview.php | 16 +-- CRM/Event/Import/Form/Summary.php | 8 +- CRM/Event/Import/Form/UploadFile.php | 20 ++-- CRM/Event/Import/Parser.php | 6 +- CRM/Event/Import/Parser/Participant.php | 38 +++---- CRM/Mailing/Event/BAO/Forward.php | 2 +- CRM/Mailing/Event/BAO/Subscribe.php | 2 +- CRM/Member/Import/Form/MapField.php | 14 +-- CRM/Member/Import/Form/Preview.php | 16 +-- CRM/Member/Import/Form/Summary.php | 8 +- CRM/Member/Import/Form/UploadFile.php | 16 +-- CRM/Member/Import/Parser.php | 6 +- CRM/Member/Import/Parser/Membership.php | 46 ++++---- CRM/Utils/DeprecatedUtils.php | 4 +- tests/phpunit/api/v3/ParticipantTest.php | 2 +- 34 files changed, 331 insertions(+), 331 deletions(-) diff --git a/CRM/Activity/Import/Form/MapField.php b/CRM/Activity/Import/Form/MapField.php index 31c455ced6..806a5ecb6e 100644 --- a/CRM/Activity/Import/Form/MapField.php +++ b/CRM/Activity/Import/Form/MapField.php @@ -588,7 +588,7 @@ class CRM_Activity_Import_Form_MapField extends CRM_Core_Form { $parser = new CRM_Activity_Import_Parser_Activity($mapperKeysMain, $mapperLocType, $mapperPhoneType); $parser->run($fileName, $seperator, $mapper, $skipColumnHeader, - CRM_Activity_Import_Parser::MODE_PREVIEW + CRM_Import_Parser::MODE_PREVIEW ); // add all the necessary variables to the form diff --git a/CRM/Activity/Import/Form/Preview.php b/CRM/Activity/Import/Form/Preview.php index 5ce3ff47af..3db91cce24 100644 --- a/CRM/Activity/Import/Form/Preview.php +++ b/CRM/Activity/Import/Form/Preview.php @@ -74,17 +74,17 @@ class CRM_Activity_Import_Form_Preview extends CRM_Core_Form { } if ($invalidRowCount) { - $urlParams = 'type=' . CRM_Activity_Import_Parser::ERROR . '&parser=CRM_Activity_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Activity_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } if ($conflictRowCount) { - $urlParams = 'type=' . CRM_Activity_Import_Parser::CONFLICT . '&parser=CRM_Activity_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Activity_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } if ($mismatchCount) { - $urlParams = 'type=' . CRM_Activity_Import_Parser::NO_MATCH . '&parser=CRM_Activity_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Activity_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } @@ -194,12 +194,12 @@ class CRM_Activity_Import_Form_Preview extends CRM_Core_Form { $parser->run($fileName, $seperator, $mapperFields, $skipColumnHeader, - CRM_Activity_Import_Parser::MODE_IMPORT, + CRM_Import_Parser::MODE_IMPORT, $onDuplicate ); // add all the necessary variables to the form - $parser->set($this, CRM_Activity_Import_Parser::MODE_IMPORT); + $parser->set($this, CRM_Import_Parser::MODE_IMPORT); // check if there is any error occured @@ -220,11 +220,11 @@ class CRM_Activity_Import_Form_Preview extends CRM_Core_Form { fclose($fd); $this->set('errorFile', $errorFile); - $urlParams = 'type=' . CRM_Activity_Import_Parser::ERROR . '&parser=CRM_Activity_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Activity_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Activity_Import_Parser::CONFLICT . '&parser=CRM_Activity_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Activity_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Activity_Import_Parser::NO_MATCH . '&parser=CRM_Activity_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Activity_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } } diff --git a/CRM/Activity/Import/Form/Summary.php b/CRM/Activity/Import/Form/Summary.php index 987581d2ed..d4ef8bb257 100644 --- a/CRM/Activity/Import/Form/Summary.php +++ b/CRM/Activity/Import/Form/Summary.php @@ -60,11 +60,11 @@ class CRM_Activity_Import_Form_Summary extends CRM_Core_Form { $onDuplicate = $this->get('onDuplicate'); $mismatchCount = $this->get('unMatchCount'); if ($duplicateRowCount > 0) { - $urlParams = 'type=' . CRM_Activity_Import_Parser::DUPLICATE . '&parser=CRM_Activity_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::DUPLICATE . '&parser=CRM_Activity_Import_Parser'; $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } elseif ($mismatchCount) { - $urlParams = 'type=' . CRM_Activity_Import_Parser::NO_MATCH . '&parser=CRM_Activity_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Activity_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } else { @@ -74,10 +74,10 @@ class CRM_Activity_Import_Form_Summary extends CRM_Core_Form { $this->assign('dupeError', FALSE); - if ($onDuplicate == CRM_Activity_Import_Parser::DUPLICATE_UPDATE) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $dupeActionString = ts('These records have been updated with the imported data.'); } - elseif ($onDuplicate == CRM_Activity_Import_Parser::DUPLICATE_FILL) { + elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) { $dupeActionString = ts('These records have been filled in with the imported data.'); } else { diff --git a/CRM/Activity/Import/Form/UploadFile.php b/CRM/Activity/Import/Form/UploadFile.php index 2ff9dfef4f..5df38277c0 100644 --- a/CRM/Activity/Import/Form/UploadFile.php +++ b/CRM/Activity/Import/Form/UploadFile.php @@ -79,13 +79,13 @@ class CRM_Activity_Import_Form_UploadFile extends CRM_Core_Form { $duplicateOptions = array(); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Skip'), CRM_Activity_Import_Parser::DUPLICATE_SKIP + NULL, NULL, ts('Skip'), CRM_Import_Parser::DUPLICATE_SKIP ); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Update'), CRM_Activity_Import_Parser::DUPLICATE_UPDATE + NULL, NULL, ts('Update'), CRM_Import_Parser::DUPLICATE_UPDATE ); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Fill'), CRM_Activity_Import_Parser::DUPLICATE_FILL + NULL, NULL, ts('Fill'), CRM_Import_Parser::DUPLICATE_FILL ); $this->addGroup($duplicateOptions, 'onDuplicate', @@ -107,7 +107,7 @@ class CRM_Activity_Import_Form_UploadFile extends CRM_Core_Form { $this->setDefaults(array( 'onDuplicate' => - CRM_Activity_Import_Parser::DUPLICATE_SKIP, + CRM_Import_Parser::DUPLICATE_SKIP, )); //build date formats @@ -160,7 +160,7 @@ class CRM_Activity_Import_Form_UploadFile extends CRM_Core_Form { $parser->run($fileName, $seperator, $mapper, $skipColumnHeader, - CRM_Activity_Import_Parser::MODE_MAPFIELD + CRM_Import_Parser::MODE_MAPFIELD ); // add all the necessary variables to the form diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index 6383db367e..11791fd4b5 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -127,7 +127,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { * @access public */ function mapField(&$values) { - return CRM_Activity_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** @@ -158,7 +158,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { if ($this->_activityTypeIndex > -1 && $this->_activityLabelIndex > -1) { array_unshift($values, ts('Please select either Activity Type ID OR Activity Type Label.')); - return CRM_Activity_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } elseif ($this->_activityLabelIndex > -1) { $index = $this->_activityLabelIndex; @@ -176,7 +176,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { if ($errorRequired) { array_unshift($values, ts('Missing required fields')); - return CRM_Activity_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } $params = &$this->getActiveFieldParams(); @@ -218,10 +218,10 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { $tempMsg = "Invalid value for field(s) : $errorMessage"; array_unshift($values, $tempMsg); $errorMessage = NULL; - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } - return CRM_Activity_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** @@ -237,7 +237,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { // first make sure this is a valid line $response = $this->summary($values); - if ($response != CRM_Activity_Import_Parser::VALID) { + if ($response != CRM_Import_Parser::VALID) { return $response; } $params = &$this->getActiveFieldParams(); @@ -276,7 +276,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { if ($formatError) { array_unshift($values, $formatError['error_message']); - return CRM_Activity_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params, @@ -297,7 +297,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { $matchedIDs = explode(',', $error['error_message']['params'][0]); if (count($matchedIDs) > 1) { array_unshift($values, 'Multiple matching contact records detected for this row. The activity was not imported'); - return CRM_Activity_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } else { $cid = $matchedIDs[0]; @@ -306,11 +306,11 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { $newActivity = civicrm_api('activity', 'create', $params); if (CRM_Utils_Array::value('is_error', $newActivity)) { array_unshift($values, $newActivity['error_message']); - return CRM_Activity_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } $this->_newActivity[] = $newActivity['id']; - return CRM_Activity_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } } else { @@ -344,7 +344,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { } array_unshift($values, 'No matching Contact found for (' . $disp . ')'); - return CRM_Activity_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } else { @@ -357,14 +357,14 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { $params['target_contact_id'] != $targetContactId ) { array_unshift($values, 'Mismatch of External identifier :' . $params['external_identifier'] . ' and Contact Id:' . $params['target_contact_id']); - return CRM_Activity_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } elseif ($targetContactId) { $params['target_contact_id'] = $targetContactId; } else { array_unshift($values, 'No Matching Contact for External identifier :' . $params['external_identifier']); - return CRM_Activity_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } @@ -372,11 +372,11 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { $newActivity = civicrm_api('activity', 'create', $params); if (CRM_Utils_Array::value('is_error', $newActivity)) { array_unshift($values, $newActivity['error_message']); - return CRM_Activity_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } $this->_newActivity[] = $newActivity['id']; - return CRM_Activity_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } } diff --git a/CRM/Contact/Import/Form/DataSource.php b/CRM/Contact/Import/Form/DataSource.php index 720408eace..2e94c3075c 100644 --- a/CRM/Contact/Import/Form/DataSource.php +++ b/CRM/Contact/Import/Form/DataSource.php @@ -149,16 +149,16 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { // duplicate handling options $duplicateOptions = array(); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Skip'), CRM_Contact_Import_Parser::DUPLICATE_SKIP + NULL, NULL, ts('Skip'), CRM_Import_Parser::DUPLICATE_SKIP ); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Update'), CRM_Contact_Import_Parser::DUPLICATE_UPDATE + NULL, NULL, ts('Update'), CRM_Import_Parser::DUPLICATE_UPDATE ); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Fill'), CRM_Contact_Import_Parser::DUPLICATE_FILL + NULL, NULL, ts('Fill'), CRM_Import_Parser::DUPLICATE_FILL ); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('No Duplicate Checking'), CRM_Contact_Import_Parser::DUPLICATE_NOCHECK + NULL, NULL, ts('No Duplicate Checking'), CRM_Import_Parser::DUPLICATE_NOCHECK ); $this->addGroup($duplicateOptions, 'onDuplicate', @@ -179,17 +179,17 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { $contactOptions = array(); if (CRM_Contact_BAO_ContactType::isActive('Individual')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Individual'), CRM_Contact_Import_Parser::CONTACT_INDIVIDUAL, $js + NULL, NULL, ts('Individual'), CRM_Import_Parser::CONTACT_INDIVIDUAL, $js ); } if (CRM_Contact_BAO_ContactType::isActive('Household')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Household'), CRM_Contact_Import_Parser::CONTACT_HOUSEHOLD, $js + NULL, NULL, ts('Household'), CRM_Import_Parser::CONTACT_HOUSEHOLD, $js ); } if (CRM_Contact_BAO_ContactType::isActive('Organization')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Organization'), CRM_Contact_Import_Parser::CONTACT_ORGANIZATION, $js + NULL, NULL, ts('Organization'), CRM_Import_Parser::CONTACT_ORGANIZATION, $js ); } @@ -231,8 +231,8 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { $config = CRM_Core_Config::singleton(); $defaults = array( 'dataSource' => 'CRM_Import_DataSource_CSV', - 'onDuplicate' => CRM_Contact_Import_Parser::DUPLICATE_SKIP, - 'contactType' => CRM_Contact_Import_Parser::CONTACT_INDIVIDUAL, + 'onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP, + 'contactType' => CRM_Import_Parser::CONTACT_INDIVIDUAL, 'fieldSeparator' => $config->fieldSeparator, ); @@ -328,11 +328,11 @@ class CRM_Contact_Import_Form_DataSource extends CRM_Core_Form { $parser->setMaxLinesToProcess(100); $parser->run($importTableName, $mapper, - CRM_Contact_Import_Parser::MODE_MAPFIELD, + CRM_Import_Parser::MODE_MAPFIELD, $contactType, $fieldNames['pk'], $fieldNames['status'], - CRM_Contact_Import_Parser::DUPLICATE_SKIP, + CRM_Import_Parser::DUPLICATE_SKIP, NULL, NULL, FALSE, CRM_Contact_Import_Parser::DEFAULT_TIMEOUT, $contactSubType, diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php index 0f2f6fba45..320ee23525 100644 --- a/CRM/Contact/Import/Form/MapField.php +++ b/CRM/Contact/Import/Form/MapField.php @@ -195,31 +195,31 @@ class CRM_Contact_Import_Form_MapField extends CRM_Core_Form { $highlightedFields[] = 'external_identifier'; //format custom field names, CRM-2676 switch ($this->get('contactType')) { - case CRM_Contact_Import_Parser::CONTACT_INDIVIDUAL: + case CRM_Import_Parser::CONTACT_INDIVIDUAL: $contactType = 'Individual'; $highlightedFields[] = 'first_name'; $highlightedFields[] = 'last_name'; break; - case CRM_Contact_Import_Parser::CONTACT_HOUSEHOLD: + case CRM_Import_Parser::CONTACT_HOUSEHOLD: $contactType = 'Household'; $highlightedFields[] = 'household_name'; break; - case CRM_Contact_Import_Parser::CONTACT_ORGANIZATION: + case CRM_Import_Parser::CONTACT_ORGANIZATION: $contactType = 'Organization'; $highlightedFields[] = 'organization_name'; break; } $this->_contactType = $contactType; - if ($this->_onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_SKIP) { + if ($this->_onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) { unset($this->_mapperFields['id']); } else { $highlightedFields[] = 'id'; } - if ($this->_onDuplicate != CRM_Contact_Import_Parser::DUPLICATE_NOCHECK) { + if ($this->_onDuplicate != CRM_Import_Parser::DUPLICATE_NOCHECK) { //Mark Dedupe Rule Fields as required, since it's used in matching contact foreach (array( 'Individual', 'Household', 'Organization') as $cType) { @@ -431,7 +431,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Core_Form { //Modified the Relationship fields if the fields are //present in dedupe rule - if ($this->_onDuplicate != CRM_Contact_Import_Parser::DUPLICATE_NOCHECK && + if ($this->_onDuplicate != CRM_Import_Parser::DUPLICATE_NOCHECK && is_array($this->_dedupeFields[$cType]) ) { static $cTypeArray = array(); @@ -498,15 +498,15 @@ class CRM_Contact_Import_Form_MapField extends CRM_Core_Form { if (isset($mappingRelation[$i])) { // relationship mapping switch ($this->get('contactType')) { - case CRM_Contact_Import_Parser::CONTACT_INDIVIDUAL: + case CRM_Import_Parser::CONTACT_INDIVIDUAL: $contactType = 'Individual'; break; - case CRM_Contact_Import_Parser::CONTACT_HOUSEHOLD: + case CRM_Import_Parser::CONTACT_HOUSEHOLD: $contactType = 'Household'; break; - case CRM_Contact_Import_Parser::CONTACT_ORGANIZATION: + case CRM_Import_Parser::CONTACT_ORGANIZATION: $contactType = 'Organization'; } //CRM-5125 @@ -964,15 +964,15 @@ class CRM_Contact_Import_Form_MapField extends CRM_Core_Form { $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'); $contactType = $this->get('contactType'); switch ($contactType) { - case CRM_Contact_Import_Parser::CONTACT_INDIVIDUAL: + case CRM_Import_Parser::CONTACT_INDIVIDUAL: $cType = 'Individual'; break; - case CRM_Contact_Import_Parser::CONTACT_HOUSEHOLD: + case CRM_Import_Parser::CONTACT_HOUSEHOLD: $cType = 'Household'; break; - case CRM_Contact_Import_Parser::CONTACT_ORGANIZATION: + case CRM_Import_Parser::CONTACT_ORGANIZATION: $cType = 'Organization'; } @@ -1040,7 +1040,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Core_Form { $statusFieldName = $this->get('statusFieldName'); $parser->run($this->_importTableName, $mapper, - CRM_Contact_Import_Parser::MODE_PREVIEW, + CRM_Import_Parser::MODE_PREVIEW, $this->get('contactType'), $primaryKeyName, $statusFieldName, diff --git a/CRM/Contact/Import/Form/Preview.php b/CRM/Contact/Import/Form/Preview.php index ad446974f8..0aa8c109ff 100644 --- a/CRM/Contact/Import/Form/Preview.php +++ b/CRM/Contact/Import/Form/Preview.php @@ -78,17 +78,17 @@ class CRM_Contact_Import_Form_Preview extends CRM_Core_Form { } if ($invalidRowCount) { - $urlParams = 'type=' . CRM_Contact_Import_Parser::ERROR . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } if ($conflictRowCount) { - $urlParams = 'type=' . CRM_Contact_Import_Parser::CONFLICT . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } if ($mismatchCount) { - $urlParams = 'type=' . CRM_Contact_Import_Parser::NO_MATCH . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } @@ -323,13 +323,13 @@ class CRM_Contact_Import_Form_Preview extends CRM_Core_Form { $this->set('errorFile', $errorFile); - $urlParams = 'type=' . CRM_Contact_Import_Parser::ERROR . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Contact_Import_Parser::CONFLICT . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Contact_Import_Parser::NO_MATCH . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } @@ -454,7 +454,7 @@ class CRM_Contact_Import_Form_Preview extends CRM_Core_Form { $tableName = $this->get('importTableName'); //print "Running parser on table: $tableName
"; $parser->run($tableName, $mapperFields, - CRM_Contact_Import_Parser::MODE_IMPORT, + CRM_Import_Parser::MODE_IMPORT, $this->get('contactType'), $this->get('primaryKeyName'), $this->get('statusFieldName'), @@ -566,7 +566,7 @@ class CRM_Contact_Import_Form_Preview extends CRM_Core_Form { } // add all the necessary variables to the form - $parser->set($this, CRM_Contact_Import_Parser::MODE_IMPORT); + $parser->set($this, CRM_Import_Parser::MODE_IMPORT); // check if there is any error occured @@ -590,13 +590,13 @@ class CRM_Contact_Import_Form_Preview extends CRM_Core_Form { $this->set('errorFile', $errorFile); - $urlParams = 'type=' . CRM_Contact_Import_Parser::ERROR . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlparams)); - $urlParams = 'type=' . CRM_Contact_Import_Parser::CONFLICT . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Contact_Import_Parser::NO_MATCH . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } } diff --git a/CRM/Contact/Import/Form/Summary.php b/CRM/Contact/Import/Form/Summary.php index 634aab53a7..7575669e4d 100644 --- a/CRM/Contact/Import/Form/Summary.php +++ b/CRM/Contact/Import/Form/Summary.php @@ -59,11 +59,11 @@ class CRM_Contact_Import_Form_Summary extends CRM_Core_Form { $mismatchCount = $this->get('unMatchCount'); $unparsedAddressCount = $this->get('unparsedAddressCount'); if ($duplicateRowCount > 0) { - $urlParams = 'type=' . CRM_Contact_Import_Parser::DUPLICATE . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::DUPLICATE . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } elseif ($mismatchCount) { - $urlParams = 'type=' . CRM_Contact_Import_Parser::NO_MATCH . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contact_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } else { @@ -71,20 +71,20 @@ class CRM_Contact_Import_Form_Summary extends CRM_Core_Form { $this->set('duplicateRowCount', $duplicateRowCount); } if ($unparsedAddressCount) { - $urlParams = 'type=' . CRM_Contact_Import_Parser::UNPARSED_ADDRESS_WARNING . '&parser=CRM_Contact_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::UNPARSED_ADDRESS_WARNING . '&parser=CRM_Contact_Import_Parser'; $this->assign('downloadAddressRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); $unparsedStreetAddressString = ts('Records imported successfully but unable to parse some of the street addresses'); $this->assign('unparsedStreetAddressString', $unparsedStreetAddressString); } $this->assign('dupeError', FALSE); - if ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_UPDATE) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $dupeActionString = ts('These records have been updated with the imported data.'); } - elseif ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_REPLACE) { + elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_REPLACE) { $dupeActionString = ts('These records have been replaced with the imported data.'); } - elseif ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_FILL) { + elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) { $dupeActionString = ts('These records have been filled in with the imported data.'); } else { diff --git a/CRM/Contact/Import/ImportJob.php b/CRM/Contact/Import/ImportJob.php index 220c0eb3c9..cb8b6fd651 100644 --- a/CRM/Contact/Import/ImportJob.php +++ b/CRM/Contact/Import/ImportJob.php @@ -262,7 +262,7 @@ class CRM_Contact_Import_ImportJob { ); $this->_parser->run($this->_tableName, $mapperFields, - CRM_Contact_Import_Parser::MODE_IMPORT, + CRM_Import_Parser::MODE_IMPORT, $this->_contactType, $this->_primaryKeyName, $this->_statusFieldName, @@ -308,7 +308,7 @@ class CRM_Contact_Import_ImportJob { } public function setFormVariables($form) { - $this->_parser->set($form, CRM_Contact_Import_Parser::MODE_IMPORT); + $this->_parser->set($form, CRM_Import_Parser::MODE_IMPORT); } private function _addImportedContactsToNewGroup($contactIds, diff --git a/CRM/Contact/Import/Parser.php b/CRM/Contact/Import/Parser.php index d35195dc71..39d1d58f07 100644 --- a/CRM/Contact/Import/Parser.php +++ b/CRM/Contact/Import/Parser.php @@ -239,15 +239,15 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { $this->_dedupeRuleGroupID = $dedupeRuleGroupID; switch ($contactType) { - case CRM_Contact_Import_Parser::CONTACT_INDIVIDUAL: + case CRM_Import_Parser::CONTACT_INDIVIDUAL: $this->_contactType = 'Individual'; break; - case CRM_Contact_Import_Parser::CONTACT_HOUSEHOLD: + case CRM_Import_Parser::CONTACT_HOUSEHOLD: $this->_contactType = 'Household'; break; - case CRM_Contact_Import_Parser::CONTACT_ORGANIZATION: + case CRM_Import_Parser::CONTACT_ORGANIZATION: $this->_contactType = 'Organization'; } @@ -826,15 +826,15 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { switch ($this->_contactType) { case 'Individual': - $store->set('contactType', CRM_Contact_Import_Parser::CONTACT_INDIVIDUAL); + $store->set('contactType', CRM_Import_Parser::CONTACT_INDIVIDUAL); break; case 'Household': - $store->set('contactType', CRM_Contact_Import_Parser::CONTACT_HOUSEHOLD); + $store->set('contactType', CRM_Import_Parser::CONTACT_HOUSEHOLD); break; case 'Organization': - $store->set('contactType', CRM_Contact_Import_Parser::CONTACT_ORGANIZATION); + $store->set('contactType', CRM_Import_Parser::CONTACT_ORGANIZATION); } if ($this->_invalidRowCount) { @@ -955,23 +955,23 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { $config = CRM_Core_Config::singleton(); $fileName = $config->uploadDir . "sqlImport"; switch ($type) { - case CRM_Contact_Import_Parser::ERROR: + case CRM_Import_Parser::ERROR: $fileName .= '.errors'; break; - case CRM_Contact_Import_Parser::CONFLICT: + case CRM_Import_Parser::CONFLICT: $fileName .= '.conflicts'; break; - case CRM_Contact_Import_Parser::DUPLICATE: + case CRM_Import_Parser::DUPLICATE: $fileName .= '.duplicates'; break; - case CRM_Contact_Import_Parser::NO_MATCH: + case CRM_Import_Parser::NO_MATCH: $fileName .= '.mismatch'; break; - case CRM_Contact_Import_Parser::UNPARSED_ADDRESS_WARNING: + case CRM_Import_Parser::UNPARSED_ADDRESS_WARNING: $fileName .= '.unparsedAddress'; break; } @@ -985,23 +985,23 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser { return $fileName; } switch ($type) { - case CRM_Contact_Import_Parser::ERROR: + case CRM_Import_Parser::ERROR: $fileName = 'Import_Errors.csv'; break; - case CRM_Contact_Import_Parser::CONFLICT: + case CRM_Import_Parser::CONFLICT: $fileName = 'Import_Conflicts.csv'; break; - case CRM_Contact_Import_Parser::DUPLICATE: + case CRM_Import_Parser::DUPLICATE: $fileName = 'Import_Duplicates.csv'; break; - case CRM_Contact_Import_Parser::NO_MATCH: + case CRM_Import_Parser::NO_MATCH: $fileName = 'Import_Mismatch.csv'; break; - case CRM_Contact_Import_Parser::UNPARSED_ADDRESS_WARNING: + case CRM_Import_Parser::UNPARSED_ADDRESS_WARNING: $fileName = 'Import_Unparsed_Address.csv'; break; } diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 7ec2f4d67b..a2456192c4 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -234,8 +234,8 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $this->_updateWithId = FALSE; if (in_array('id', $this->_mapperKeys) || ($this->_externalIdentifierIndex >= 0 && in_array($this->_onDuplicate, array( - CRM_Contact_Import_Parser::DUPLICATE_UPDATE, - CRM_Contact_Import_Parser::DUPLICATE_FILL, + CRM_Import_Parser::DUPLICATE_UPDATE, + CRM_Import_Parser::DUPLICATE_FILL, )))) { $this->_updateWithId = TRUE; } @@ -252,7 +252,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @access public */ function mapField(&$values) { - return CRM_Contact_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** @@ -332,7 +332,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } @@ -349,7 +349,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } /* otherwise, count it and move on */ @@ -370,7 +370,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } //check for duplicate external Identifier @@ -386,7 +386,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { "${statusFieldName}Msg" => $errorMessage, ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } //otherwise, count it and move on $this->_allExternalIdentifiers[$externalID] = $this->_lineCount; @@ -421,7 +421,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $this->updateImportRecord($values[count($values) - 1], $importRecordParams); array_unshift($values, $tempMsg); $errorMessage = NULL; - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } //if user correcting errors by walking back @@ -432,7 +432,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** @@ -457,7 +457,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $response = $this->summary($values); $statusFieldName = $this->_statusFieldName; - if ($response != CRM_Contact_Import_Parser::VALID) { + if ($response != CRM_Import_Parser::VALID) { $importRecordParams = array( $statusFieldName => 'INVALID', "${statusFieldName}Msg" => "Invalid (Error Code: $response)", @@ -478,8 +478,8 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { //check if external identifier exists in database if (CRM_Utils_Array::value('external_identifier', $params) && (CRM_Utils_Array::value('id', $params) || in_array($onDuplicate, array( - CRM_Contact_Import_Parser::DUPLICATE_SKIP, - CRM_Contact_Import_Parser::DUPLICATE_NOCHECK, + CRM_Import_Parser::DUPLICATE_SKIP, + CRM_Import_Parser::DUPLICATE_NOCHECK, )))) { if ($internalCid = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $params['external_identifier'], 'id', 'external_identifier')) { @@ -491,7 +491,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { "${statusFieldName}Msg" => $errorMessage, ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::DUPLICATE; + return CRM_Import_Parser::DUPLICATE; } } } @@ -508,7 +508,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { elseif (!CRM_Contact_BAO_ContactType::isExtendsContactType($subType, $this->_contactType)) { $message = "Mismatched or Invalid Contact SubType."; array_unshift($values, $message); - return CRM_Contact_Import_Parser::NO_MATCH; + return CRM_Import_Parser::NO_MATCH; } } @@ -549,7 +549,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { else { $message = "More than one matching contact found for given criteria."; array_unshift($values, $message); - $this->_retCode = CRM_Contact_Import_Parser::NO_MATCH; + $this->_retCode = CRM_Import_Parser::NO_MATCH; } } else { @@ -580,26 +580,26 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $message = "Mismatched contact SubTypes :"; array_unshift($values, $message); $updateflag = FALSE; - $this->_retCode = CRM_Contact_Import_Parser::NO_MATCH; + $this->_retCode = CRM_Import_Parser::NO_MATCH; } else { $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactId, FALSE, $this->_dedupeRuleGroupID); $updateflag = FALSE; - $this->_retCode = CRM_Contact_Import_Parser::VALID; + $this->_retCode = CRM_Import_Parser::VALID; } } else { $message = "Mismatched contact Types :"; array_unshift($values, $message); $updateflag = FALSE; - $this->_retCode = CRM_Contact_Import_Parser::NO_MATCH; + $this->_retCode = CRM_Import_Parser::NO_MATCH; } } } if ($updateflag) { $message = "Mismatched contact IDs OR Mismatched contact Types :"; array_unshift($values, $message); - $this->_retCode = CRM_Contact_Import_Parser::NO_MATCH; + $this->_retCode = CRM_Import_Parser::NO_MATCH; } } } @@ -620,26 +620,26 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $message = "Mismatched contact SubTypes :"; array_unshift($values, $message); - $this->_retCode = CRM_Contact_Import_Parser::NO_MATCH; + $this->_retCode = CRM_Import_Parser::NO_MATCH; } else { $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $params['id'], FALSE, $this->_dedupeRuleGroupID); - $this->_retCode = CRM_Contact_Import_Parser::VALID; + $this->_retCode = CRM_Import_Parser::VALID; } } else { $message = "Mismatched contact Types :"; array_unshift($values, $message); - $this->_retCode = CRM_Contact_Import_Parser::NO_MATCH; + $this->_retCode = CRM_Import_Parser::NO_MATCH; } } else { // we should avoid multiple errors for single record // since we have already retCode and we trying to force again. - if ($this->_retCode != CRM_Contact_Import_Parser::NO_MATCH) { + if ($this->_retCode != CRM_Import_Parser::NO_MATCH) { $message = "No contact found for this contact ID:" . $params['id']; array_unshift($values, $message); - $this->_retCode = CRM_Contact_Import_Parser::NO_MATCH; + $this->_retCode = CRM_Import_Parser::NO_MATCH; } } } @@ -694,12 +694,12 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { //get return code if we create new contact in update mode, CRM-4148 if ($this->_updateWithId) { - $this->_retCode = CRM_Contact_Import_Parser::VALID; + $this->_retCode = CRM_Import_Parser::VALID; } } elseif (isset($newContact) && CRM_Core_Error::isAPIError($newContact, CRM_Core_ERROR::DUPLICATE_CONTACT)) { // if duplicate, no need of further processing - if ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_SKIP) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) { $errorMessage = "Skipping duplicate record"; array_unshift($values, $errorMessage); $importRecordParams = array( @@ -707,7 +707,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { "${statusFieldName}Msg" => $errorMessage, ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::DUPLICATE; + return CRM_Import_Parser::DUPLICATE; } $relationship = TRUE; @@ -775,7 +775,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { if ($relCsType = CRM_Utils_Array::value('contact_sub_type', $params[$key]) && $relCsType != $relationType->$direction) { $errorMessage = ts("Mismatched or Invalid contact subtype found for this related contact"); array_unshift($values, $errorMessage); - return CRM_Contact_Import_Parser::NO_MATCH; + return CRM_Import_Parser::NO_MATCH; } else { $formatting['contact_sub_type'] = $relationType->$direction; @@ -792,14 +792,14 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { } // check for valid related contact id in update/fill mode, CRM-4424 if (in_array($onDuplicate, array( - CRM_Contact_Import_Parser::DUPLICATE_UPDATE, - CRM_Contact_Import_Parser::DUPLICATE_FILL, + CRM_Import_Parser::DUPLICATE_UPDATE, + CRM_Import_Parser::DUPLICATE_FILL, )) && CRM_Utils_Array::value('id', $params[$key])) { $relatedContactType = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $params[$key]['id'], 'contact_type'); if (!$relatedContactType) { $errorMessage = ts("No contact found for this related contact ID: %1", array(1 => $params[$key]['id'])); array_unshift($values, $errorMessage); - return CRM_Contact_Import_Parser::NO_MATCH; + return CRM_Import_Parser::NO_MATCH; } else { //validation of related contact subtype for update mode @@ -813,7 +813,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $relatedCsType != CRM_Utils_Array::value('contact_sub_type', $formatting))) { $errorMessage = ts("Mismatched or Invalid contact subtype found for this related contact ID: %1", array(1 => $params[$key]['id'])); array_unshift($values, $errorMessage); - return CRM_Contact_Import_Parser::NO_MATCH; + return CRM_Import_Parser::NO_MATCH; } else { // get related contact id to format data in update/fill mode, @@ -832,7 +832,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { if (!$allowToCreate) { $errorMessage = ts('Related contact required fields are missing.'); array_unshift($values, $errorMessage); - return CRM_Contact_Import_Parser::NO_MATCH; + return CRM_Import_Parser::NO_MATCH; } //fixed for CRM-4148 @@ -866,7 +866,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { "${statusFieldName}Msg" => $errorMessage, ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } else { @@ -874,8 +874,8 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { } // update/fill related contact after getting matching Contact Ids, CRM-4424 if (in_array($onDuplicate, array( - CRM_Contact_Import_Parser::DUPLICATE_UPDATE, - CRM_Contact_Import_Parser::DUPLICATE_FILL, + CRM_Import_Parser::DUPLICATE_UPDATE, + CRM_Import_Parser::DUPLICATE_FILL, ))) { //validation of related contact subtype for update mode //CRM-5125 @@ -887,7 +887,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { if (!empty($relatedCsType) && (!CRM_Contact_BAO_ContactType::isAllowEdit($matchedIDs[0], $relatedCsType) && $relatedCsType != CRM_Utils_Array::value('contact_sub_type', $formatting))) { $errorMessage = ts("Mismatched or Invalid contact subtype found for this related contact."); array_unshift($values, $errorMessage); - return CRM_Contact_Import_Parser::NO_MATCH; + return CRM_Import_Parser::NO_MATCH; } else { $updatedContact = $this->createContact($formatting, $contactFields, $onDuplicate, $matchedIDs[0]); @@ -1013,7 +1013,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $errorMessage .= "\n" . $url_string; array_unshift($values, $errorMessage); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } // Params only had one id, so shift it out @@ -1022,14 +1022,14 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $vals = array('contact_id' => $contactId); - if ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_REPLACE) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_REPLACE) { civicrm_api('contact', 'delete', $vals); $cid = CRM_Contact_BAO_Contact::createProfileContact($formatted, $contactFields, $contactId, NULL, NULL, $formatted['contact_type']); } - elseif ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_UPDATE) { + elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactId); } - elseif ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_FILL) { + elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) { $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactId); } // else skip does nothing and just returns an error code. @@ -1050,14 +1050,14 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { } } //CRM-262 No Duplicate Checking - if ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_SKIP) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) { array_unshift($values, $url_string); $importRecordParams = array( $statusFieldName => 'DUPLICATE', "${statusFieldName}Msg" => "Skipping duplicate record", ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::DUPLICATE; + return CRM_Import_Parser::DUPLICATE; } $importRecordParams = array( @@ -1065,7 +1065,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); //return warning if street address is not parsed, CRM-5886 - return $this->processMessage($values, $statusFieldName, CRM_Contact_Import_Parser::VALID); + return $this->processMessage($values, $statusFieldName, CRM_Import_Parser::VALID); } else { // Not a dupe, so we had an error @@ -1076,11 +1076,11 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { "${statusFieldName}Msg" => $errorMessage, ); $this->updateImportRecord($values[count($values) - 1], $importRecordParams); - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } // sleep(3); - return $this->processMessage($values, $statusFieldName, CRM_Contact_Import_Parser::VALID); + return $this->processMessage($values, $statusFieldName, CRM_Import_Parser::VALID); } /** @@ -1633,7 +1633,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $newContact = NULL; - if (is_null($contactId) && ($onDuplicate != CRM_Contact_Import_Parser::DUPLICATE_NOCHECK)) { + if (is_null($contactId) && ($onDuplicate != CRM_Import_Parser::DUPLICATE_NOCHECK)) { $dupeCheck = (bool)($onDuplicate); } @@ -1694,7 +1694,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { * @param $cid int contact id */ function formatParams(&$params, $onDuplicate, $cid) { - if ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_SKIP) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) { return; } @@ -1707,11 +1707,11 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $modeUpdate = $modeFill = FALSE; - if ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_UPDATE) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $modeUpdate = TRUE; } - if ($onDuplicate == CRM_Contact_Import_Parser::DUPLICATE_FILL) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) { $modeFill = TRUE; } @@ -2037,7 +2037,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { $statusFieldName => 'ERROR', "${statusFieldName}Msg" => $errorMessage, ); - $returnCode = CRM_Contact_Import_Parser::UNPARSED_ADDRESS_WARNING; + $returnCode = CRM_Import_Parser::UNPARSED_ADDRESS_WARNING; } $this->updateImportRecord($values[count($values) - 1], $importRecordParams); return $returnCode; diff --git a/CRM/Contribute/Import/Form/MapField.php b/CRM/Contribute/Import/Form/MapField.php index c1ac3be980..0463eda5d8 100644 --- a/CRM/Contribute/Import/Form/MapField.php +++ b/CRM/Contribute/Import/Form/MapField.php @@ -185,7 +185,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Core_Form { $highlightedFields[] = 'financial_type'; //CRM-2219 removing other required fields since for updation only //invoice id or trxn id or contribution id is required. - if ($this->_onDuplicate == CRM_Contribute_Import_Parser::DUPLICATE_UPDATE) { + if ($this->_onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $remove = array('contribution_contact_id', 'email', 'first_name', 'last_name', 'external_identifier'); foreach ($remove as $value) { unset($this->_mapperFields[$value]); @@ -198,7 +198,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Core_Form { $highlightedFields[] = $key; } } - elseif ($this->_onDuplicate == CRM_Contribute_Import_Parser::DUPLICATE_SKIP) { + elseif ($this->_onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) { unset($this->_mapperFields['contribution_id']); $highlightedFieldsArray = array('contribution_contact_id', 'email', 'first_name', 'last_name', 'external_identifier', 'total_amount'); foreach ($highlightedFieldsArray as $name) { @@ -295,9 +295,9 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Core_Form { // get contact type for this import $contactTypeId = $this->get('contactType'); $contactTypes = array( - CRM_Contribute_Import_Parser::CONTACT_INDIVIDUAL => 'Individual', - CRM_Contribute_Import_Parser::CONTACT_HOUSEHOLD => 'Household', - CRM_Contribute_Import_Parser::CONTACT_ORGANIZATION => 'Organization', + CRM_Import_Parser::CONTACT_INDIVIDUAL => 'Individual', + CRM_Import_Parser::CONTACT_HOUSEHOLD => 'Household', + CRM_Import_Parser::CONTACT_ORGANIZATION => 'Organization', ); $contactType = $contactTypes[$contactTypeId]; @@ -465,9 +465,9 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Core_Form { $contactTypeId = $self->get('contactType'); $contactTypes = array( - CRM_Contribute_Import_Parser::CONTACT_INDIVIDUAL => 'Individual', - CRM_Contribute_Import_Parser::CONTACT_HOUSEHOLD => 'Household', - CRM_Contribute_Import_Parser::CONTACT_ORGANIZATION => 'Organization', + CRM_Import_Parser::CONTACT_INDIVIDUAL => 'Individual', + CRM_Import_Parser::CONTACT_HOUSEHOLD => 'Household', + CRM_Import_Parser::CONTACT_ORGANIZATION => 'Organization', ); $params = array( 'used' => 'Unsupervised', @@ -495,12 +495,12 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Core_Form { if (!in_array($field, $importKeys)) { if ($field == 'contribution_contact_id') { if (!($weightSum >= $threshold || in_array('external_identifier', $importKeys)) && - $self->_onDuplicate != CRM_Contribute_Import_Parser::DUPLICATE_UPDATE + $self->_onDuplicate != CRM_Import_Parser::DUPLICATE_UPDATE ) { $errors['_qf_default'] .= ts('Missing required contact matching fields.') . " $fieldMessage " . ts('(Sum of all weights should be greater than or equal to threshold: %1).', array( 1 => $threshold)) . '
'; } - elseif ($self->_onDuplicate == CRM_Contribute_Import_Parser::DUPLICATE_UPDATE && + elseif ($self->_onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE && !(in_array('invoice_id', $importKeys) || in_array('trxn_id', $importKeys) || in_array('contribution_id', $importKeys) ) @@ -509,7 +509,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Core_Form { } } else { - if ($self->_onDuplicate != CRM_Contribute_Import_Parser::DUPLICATE_UPDATE) { + if ($self->_onDuplicate != CRM_Import_Parser::DUPLICATE_UPDATE) { $errors['_qf_default'] .= ts('Missing required field: %1', array( 1 => $title)) . '
'; } @@ -518,7 +518,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Core_Form { } //at least one field should be mapped during update. - if ($self->_onDuplicate == CRM_Contribute_Import_Parser::DUPLICATE_UPDATE) { + if ($self->_onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $atleastOne = FALSE; foreach ($self->_mapperFields as $key => $field) { if (in_array($key, $importKeys) && @@ -659,7 +659,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Core_Form { $parser = new CRM_Contribute_Import_Parser_Contribution($mapperKeysMain, $mapperSoftCredit, $mapperPhoneType); $parser->run($fileName, $seperator, $mapper, $skipColumnHeader, - CRM_Contribute_Import_Parser::MODE_PREVIEW, $this->get('contactType') + CRM_Import_Parser::MODE_PREVIEW, $this->get('contactType') ); // add all the necessary variables to the form diff --git a/CRM/Contribute/Import/Form/Preview.php b/CRM/Contribute/Import/Form/Preview.php index 28038f6df4..7c6dc2c86b 100644 --- a/CRM/Contribute/Import/Form/Preview.php +++ b/CRM/Contribute/Import/Form/Preview.php @@ -75,17 +75,17 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Core_Form { } if ($invalidRowCount) { - $urlParams = 'type=' . CRM_Contribute_Import_Parser::ERROR . '&parser=CRM_Contribute_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Contribute_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } if ($conflictRowCount) { - $urlParams = 'type=' . CRM_Contribute_Import_Parser::CONFLICT . '&parser=CRM_Contribute_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Contribute_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } if ($mismatchCount) { - $urlParams = 'type=' . CRM_Contribute_Import_Parser::NO_MATCH . '&parser=CRM_Contribute_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contribute_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } @@ -187,13 +187,13 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Core_Form { $parser->run($fileName, $seperator, $mapperFields, $skipColumnHeader, - CRM_Contribute_Import_Parser::MODE_IMPORT, + CRM_Import_Parser::MODE_IMPORT, $this->get('contactType'), $onDuplicate ); // add all the necessary variables to the form - $parser->set($this, CRM_Contribute_Import_Parser::MODE_IMPORT); + $parser->set($this, CRM_Import_Parser::MODE_IMPORT); // check if there is any error occured @@ -214,11 +214,11 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Core_Form { fclose($fd); $this->set('errorFile', $errorFile); - $urlParams = 'type=' . CRM_Contribute_Import_Parser::ERROR . '&parser=CRM_Contribute_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Contribute_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Contribute_Import_Parser::CONFLICT . '&parser=CRM_Contribute_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Contribute_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Contribute_Import_Parser::NO_MATCH . '&parser=CRM_Contribute_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contribute_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } } diff --git a/CRM/Contribute/Import/Form/Summary.php b/CRM/Contribute/Import/Form/Summary.php index d78904f860..ea3bb9edbc 100644 --- a/CRM/Contribute/Import/Form/Summary.php +++ b/CRM/Contribute/Import/Form/Summary.php @@ -71,11 +71,11 @@ class CRM_Contribute_Import_Form_Summary extends CRM_Core_Form { $onDuplicate = $this->get('onDuplicate'); $mismatchCount = $this->get('unMatchCount'); if ($duplicateRowCount > 0) { - $urlParams = 'type=' . CRM_Contribute_Import_Parser::DUPLICATE . '&parser=CRM_Contribute_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::DUPLICATE . '&parser=CRM_Contribute_Import_Parser'; $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } elseif ($mismatchCount) { - $urlParams = 'type=' . CRM_Contribute_Import_Parser::NO_MATCH . '&parser=CRM_Contribute_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contribute_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } else { @@ -85,10 +85,10 @@ class CRM_Contribute_Import_Form_Summary extends CRM_Core_Form { $this->assign('dupeError', FALSE); - if ($onDuplicate == CRM_Contribute_Import_Parser::DUPLICATE_UPDATE) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $dupeActionString = ts('These records have been updated with the imported data.'); } - elseif ($onDuplicate == CRM_Contribute_Import_Parser::DUPLICATE_FILL) { + elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) { $dupeActionString = ts('These records have been filled in with the imported data.'); } else { diff --git a/CRM/Contribute/Import/Form/UploadFile.php b/CRM/Contribute/Import/Form/UploadFile.php index e76f8fc9fd..65a5dd7932 100644 --- a/CRM/Contribute/Import/Form/UploadFile.php +++ b/CRM/Contribute/Import/Form/UploadFile.php @@ -79,10 +79,10 @@ class CRM_Contribute_Import_Form_UploadFile extends CRM_Core_Form { $duplicateOptions = array(); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Insert new contributions'), CRM_Contribute_Import_Parser::DUPLICATE_SKIP + NULL, NULL, ts('Insert new contributions'), CRM_Import_Parser::DUPLICATE_SKIP ); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Update existing contributions'), CRM_Contribute_Import_Parser::DUPLICATE_UPDATE + NULL, NULL, ts('Update existing contributions'), CRM_Import_Parser::DUPLICATE_UPDATE ); $this->addGroup($duplicateOptions, 'onDuplicate', ts('Import mode') @@ -104,24 +104,24 @@ class CRM_Contribute_Import_Form_UploadFile extends CRM_Core_Form { $this->setDefaults(array( 'onDuplicate' => - CRM_Contribute_Import_Parser::DUPLICATE_SKIP, + CRM_Import_Parser::DUPLICATE_SKIP, )); //contact types option $contactOptions = array(); if (CRM_Contact_BAO_ContactType::isActive('Individual')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Individual'), CRM_Contribute_Import_Parser::CONTACT_INDIVIDUAL + NULL, NULL, ts('Individual'), CRM_Import_Parser::CONTACT_INDIVIDUAL ); } if (CRM_Contact_BAO_ContactType::isActive('Household')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Household'), CRM_Contribute_Import_Parser::CONTACT_HOUSEHOLD + NULL, NULL, ts('Household'), CRM_Import_Parser::CONTACT_HOUSEHOLD ); } if (CRM_Contact_BAO_ContactType::isActive('Organization')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Organization'), CRM_Contribute_Import_Parser::CONTACT_ORGANIZATION + NULL, NULL, ts('Organization'), CRM_Import_Parser::CONTACT_ORGANIZATION ); } @@ -131,7 +131,7 @@ class CRM_Contribute_Import_Form_UploadFile extends CRM_Core_Form { $this->setDefaults(array( 'contactType' => - CRM_Contribute_Import_Parser::CONTACT_INDIVIDUAL, + CRM_Import_Parser::CONTACT_INDIVIDUAL, )); //build date formats @@ -186,7 +186,7 @@ class CRM_Contribute_Import_Form_UploadFile extends CRM_Core_Form { $parser->run($fileName, $seperator, $mapper, $skipColumnHeader, - CRM_Contribute_Import_Parser::MODE_MAPFIELD, $contactType + CRM_Import_Parser::MODE_MAPFIELD, $contactType ); // add all the necessary variables to the form diff --git a/CRM/Contribute/Import/Parser.php b/CRM/Contribute/Import/Parser.php index 56dc7f6f16..04fa45fb7e 100644 --- a/CRM/Contribute/Import/Parser.php +++ b/CRM/Contribute/Import/Parser.php @@ -704,15 +704,15 @@ pppp * @return void switch ($this->_contactType) { case 'Individual': - $store->set('contactType', CRM_Contribute_Import_Parser::CONTACT_INDIVIDUAL); + $store->set('contactType', CRM_Import_Parser::CONTACT_INDIVIDUAL); break; case 'Household': - $store->set('contactType', CRM_Contribute_Import_Parser::CONTACT_HOUSEHOLD); + $store->set('contactType', CRM_Import_Parser::CONTACT_HOUSEHOLD); break; case 'Organization': - $store->set('contactType', CRM_Contribute_Import_Parser::CONTACT_ORGANIZATION); + $store->set('contactType', CRM_Import_Parser::CONTACT_ORGANIZATION); } if ($this->_invalidRowCount) { @@ -812,22 +812,22 @@ pppp * @return void $fileName = $config->uploadDir . "sqlImport"; switch ($type) { - case CRM_Contribute_Import_Parser::ERROR: - case CRM_Contribute_Import_Parser::NO_MATCH: - case CRM_Contribute_Import_Parser::CONFLICT: - case CRM_Contribute_Import_Parser::DUPLICATE: + case CRM_Import_Parser::ERROR: + case CRM_Import_Parser::NO_MATCH: + case CRM_Import_Parser::CONFLICT: + case CRM_Import_Parser::DUPLICATE: //here constants get collides. - if ($type == CRM_Contribute_Import_Parser::ERROR) { - $type = CRM_Contact_Import_Parser::ERROR; + if ($type == CRM_Import_Parser::ERROR) { + $type = CRM_Import_Parser::ERROR; } - elseif ($type == CRM_Contribute_Import_Parser::NO_MATCH) { - $type = CRM_Contact_Import_Parser::NO_MATCH; + elseif ($type == CRM_Import_Parser::NO_MATCH) { + $type = CRM_Import_Parser::NO_MATCH; } - elseif ($type == CRM_Contribute_Import_Parser::CONFLICT) { - $type = CRM_Contact_Import_Parser::CONFLICT; + elseif ($type == CRM_Import_Parser::CONFLICT) { + $type = CRM_Import_Parser::CONFLICT; } else { - $type = CRM_Contact_Import_Parser::DUPLICATE; + $type = CRM_Import_Parser::DUPLICATE; } $fileName = CRM_Contact_Import_Parser::errorFileName($type); break; @@ -851,22 +851,22 @@ pppp * @return void } switch ($type) { - case CRM_Contribute_Import_Parser::ERROR: - case CRM_Contribute_Import_Parser::NO_MATCH: - case CRM_Contribute_Import_Parser::CONFLICT: - case CRM_Contribute_Import_Parser::DUPLICATE: + case CRM_Import_Parser::ERROR: + case CRM_Import_Parser::NO_MATCH: + case CRM_Import_Parser::CONFLICT: + case CRM_Import_Parser::DUPLICATE: //here constants get collides. - if ($type == CRM_Contribute_Import_Parser::ERROR) { - $type = CRM_Contact_Import_Parser::ERROR; + if ($type == CRM_Import_Parser::ERROR) { + $type = CRM_Import_Parser::ERROR; } - elseif ($type == CRM_Contribute_Import_Parser::NO_MATCH) { - $type = CRM_Contact_Import_Parser::NO_MATCH; + elseif ($type == CRM_Import_Parser::NO_MATCH) { + $type = CRM_Import_Parser::NO_MATCH; } - elseif ($type == CRM_Contribute_Import_Parser::CONFLICT) { - $type = CRM_Contact_Import_Parser::CONFLICT; + elseif ($type == CRM_Import_Parser::CONFLICT) { + $type = CRM_Import_Parser::CONFLICT; } else { - $type = CRM_Contact_Import_Parser::DUPLICATE; + $type = CRM_Import_Parser::DUPLICATE; } $fileName = CRM_Contact_Import_Parser::saveFileName($type); break; diff --git a/CRM/Contribute/Import/Parser/Contribution.php b/CRM/Contribute/Import/Parser/Contribution.php index acbb3cf968..63c425545d 100644 --- a/CRM/Contribute/Import/Parser/Contribution.php +++ b/CRM/Contribute/Import/Parser/Contribution.php @@ -136,7 +136,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa * @access public */ function mapField(&$values) { - return CRM_Contribute_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** @@ -221,10 +221,10 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa $tempMsg = "Invalid value for field(s) : $errorMessage"; array_unshift($values, $tempMsg); $errorMessage = NULL; - return CRM_Contribute_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } - return CRM_Contribute_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** @@ -239,7 +239,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa function import($onDuplicate, &$values) { // first make sure this is a valid line $response = $this->summary($values); - if ($response != CRM_Contribute_Import_Parser::VALID) { + if ($response != CRM_Import_Parser::VALID) { return $response; } @@ -296,14 +296,14 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa } //import contribution record according to select contact type - if ($onDuplicate == CRM_Contribute_Import_Parser::DUPLICATE_SKIP && + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP && (CRM_Utils_Array::value('contribution_contact_id', $paramValues) || CRM_Utils_Array::value('external_identifier', $paramValues) ) ) { $paramValues['contact_type'] = $this->_contactType; } - elseif ($onDuplicate == CRM_Contribute_Import_Parser::DUPLICATE_UPDATE && + elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE && ($paramValues['contribution_id'] || $values['trxn_id'] || $paramValues['invoice_id']) ) { $paramValues['contact_type'] = $this->_contactType; @@ -330,10 +330,10 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa elseif (CRM_Utils_Array::value('error_data', $formatError) == 'pledge_payment') { return CRM_Contribute_Import_Parser::PLEDGE_PAYMENT_ERROR; } - return CRM_Contribute_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } - if ($onDuplicate != CRM_Contribute_Import_Parser::DUPLICATE_UPDATE) { + if ($onDuplicate != CRM_Import_Parser::DUPLICATE_UPDATE) { $formatted['custom'] = CRM_Core_BAO_CustomField::postProcess($formatted, CRM_Core_DAO::$_nullObject, NULL, @@ -342,7 +342,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa } else { //fix for CRM-2219 - Update Contribution - // onDuplicate == CRM_Contribute_Import_Parser::DUPLICATE_UPDATE + // onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE if (CRM_Utils_Array::value('invoice_id',$paramValues) || CRM_Utils_Array::value('trxn_id', $paramValues) || $paramValues['contribution_id']) { $dupeIds = array( @@ -407,7 +407,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa // process pledge payment assoc w/ the contribution return self::processPledgePayments($formatted); - return CRM_Contribute_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } else { $labels = array( @@ -422,7 +422,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa } $errorMsg = implode(' AND ', $errorMsg); array_unshift($values, 'Matching Contribution record not found for ' . $errorMsg . '. Row was skipped.'); - return CRM_Contribute_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } } @@ -442,7 +442,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa $matchedIDs = explode(',', $error['error_message']['params'][0]); if (count($matchedIDs) > 1) { array_unshift($values, 'Multiple matching contact records detected for this row. The contribution was not imported'); - return CRM_Contribute_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } else { $cid = $matchedIDs[0]; @@ -453,12 +453,12 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa if (is_array($newContribution['error_message'])) { array_unshift($values, $newContribution['error_message']['message']); if ($newContribution['error_message']['params'][0]) { - return CRM_Contribute_Import_Parser::DUPLICATE; + return CRM_Import_Parser::DUPLICATE; } } else { array_unshift($values, $newContribution['error_message']); - return CRM_Contribute_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } @@ -473,7 +473,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa // process pledge payment assoc w/ the contribution return self::processPledgePayments($formatted); - return CRM_Contribute_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } } else { @@ -506,7 +506,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa } array_unshift($values, 'No matching Contact found for (' . $disp . ')'); - return CRM_Contribute_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } else { @@ -516,7 +516,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa $checkCid->find(TRUE); if ($checkCid->id != $formatted['contact_id']) { array_unshift($values, 'Mismatch of External identifier :' . $paramValues['external_identifier'] . ' and Contact Id:' . $formatted['contact_id']); - return CRM_Contribute_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } $newContribution = civicrm_api('contribution', 'create', $formatted); @@ -524,12 +524,12 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa if (is_array($newContribution['error_message'])) { array_unshift($values, $newContribution['error_message']['message']); if ($newContribution['error_message']['params'][0]) { - return CRM_Contribute_Import_Parser::DUPLICATE; + return CRM_Import_Parser::DUPLICATE; } } else { array_unshift($values, $newContribution['error_message']); - return CRM_Contribute_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } @@ -544,7 +544,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa // process pledge payment assoc w/ the contribution return self::processPledgePayments($formatted); - return CRM_Contribute_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } } diff --git a/CRM/Event/Import/Form/MapField.php b/CRM/Event/Import/Form/MapField.php index a3b3842622..c0bb4cdaa8 100644 --- a/CRM/Event/Import/Form/MapField.php +++ b/CRM/Event/Import/Form/MapField.php @@ -185,7 +185,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Core_Form { else { $this->assign('rowDisplayCount', 2); } - if ($this->_onDuplicate == CRM_Event_Import_Parser::DUPLICATE_UPDATE) { + if ($this->_onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $remove = array('participant_contact_id', 'email', 'first_name', 'last_name', 'external_identifier'); foreach ($remove as $value) { unset($this->_mapperFields[$value]); @@ -195,8 +195,8 @@ class CRM_Event_Import_Form_MapField extends CRM_Core_Form { $highlightedFields[] = $name; } } - elseif ($this->_onDuplicate == CRM_Event_Import_Parser::DUPLICATE_SKIP || - $this->_onDuplicate == CRM_Event_Import_Parser::DUPLICATE_NOCHECK + elseif ($this->_onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP || + $this->_onDuplicate == CRM_Import_Parser::DUPLICATE_NOCHECK ) { unset($this->_mapperFields['participant_id']); $highlightedFieldsArray = array('participant_contact_id', 'event_id', 'email', 'first_name', 'last_name', 'external_identifier', 'participant_status_id'); @@ -420,9 +420,9 @@ class CRM_Event_Import_Form_MapField extends CRM_Core_Form { $contactTypeId = $self->get('contactType'); $contactTypes = array( - CRM_Event_Import_Parser::CONTACT_INDIVIDUAL => 'Individual', - CRM_Event_Import_Parser::CONTACT_HOUSEHOLD => 'Household', - CRM_Event_Import_Parser::CONTACT_ORGANIZATION => 'Organization', + CRM_Import_Parser::CONTACT_INDIVIDUAL => 'Individual', + CRM_Import_Parser::CONTACT_HOUSEHOLD => 'Household', + CRM_Import_Parser::CONTACT_ORGANIZATION => 'Organization', ); $params = array( 'used' => 'Unsupervised', @@ -447,7 +447,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Core_Form { ) { continue; } - if ($self->_onDuplicate == CRM_Event_Import_Parser::DUPLICATE_UPDATE) { + if ($self->_onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $errors['_qf_default'] .= ts('Missing required field: Provide Particiapnt ID') . '
'; } else { @@ -594,7 +594,7 @@ class CRM_Event_Import_Form_MapField extends CRM_Core_Form { $parser = new CRM_Event_Import_Parser_Participant($mapperKeysMain); $parser->run($fileName, $seperator, $mapper, $skipColumnHeader, - CRM_Event_Import_Parser::MODE_PREVIEW, $this->get('contactType') + CRM_Import_Parser::MODE_PREVIEW, $this->get('contactType') ); // add all the necessary variables to the form $parser->set($this); diff --git a/CRM/Event/Import/Form/Preview.php b/CRM/Event/Import/Form/Preview.php index 9d64177398..29be2c8d8c 100644 --- a/CRM/Event/Import/Form/Preview.php +++ b/CRM/Event/Import/Form/Preview.php @@ -74,17 +74,17 @@ class CRM_Event_Import_Form_Preview extends CRM_Core_Form { } if ($invalidRowCount) { - $urlParams = 'type=' . CRM_Event_Import_Parser::ERROR . '&parser=CRM_Event_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Event_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } if ($conflictRowCount) { - $urlParams = 'type=' . CRM_Event_Import_Parser::CONFLICT . '&parser=CRM_Event_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Event_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } if ($mismatchCount) { - $urlParams = 'type=' . CRM_Event_Import_Parser::NO_MATCH . '&parser=CRM_Event_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Event_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } @@ -178,13 +178,13 @@ class CRM_Event_Import_Form_Preview extends CRM_Core_Form { $parser->run($fileName, $seperator, $mapperFields, $skipColumnHeader, - CRM_Event_Import_Parser::MODE_IMPORT, + CRM_Import_Parser::MODE_IMPORT, $this->get('contactType'), $onDuplicate ); // add all the necessary variables to the form - $parser->set($this, CRM_Event_Import_Parser::MODE_IMPORT); + $parser->set($this, CRM_Import_Parser::MODE_IMPORT); // check if there is any error occured @@ -205,11 +205,11 @@ class CRM_Event_Import_Form_Preview extends CRM_Core_Form { fclose($fd); $this->set('errorFile', $errorFile); - $urlParams = 'type=' . CRM_Event_Import_Parser::ERROR . '&parser=CRM_Event_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Event_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Event_Import_Parser::CONFLICT . '&parser=CRM_Event_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Event_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Event_Import_Parser::NO_MATCH . '&parser=CRM_Event_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Event_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } } diff --git a/CRM/Event/Import/Form/Summary.php b/CRM/Event/Import/Form/Summary.php index ca28a62b1e..dcbc8f0fbd 100644 --- a/CRM/Event/Import/Form/Summary.php +++ b/CRM/Event/Import/Form/Summary.php @@ -59,11 +59,11 @@ class CRM_Event_Import_Form_Summary extends CRM_Core_Form { $onDuplicate = $this->get('onDuplicate'); $mismatchCount = $this->get('unMatchCount'); if ($duplicateRowCount > 0) { - $urlParams = 'type=' . CRM_Event_Import_Parser::DUPLICATE . '&parser=CRM_Event_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::DUPLICATE . '&parser=CRM_Event_Import_Parser'; $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } elseif ($mismatchCount) { - $urlParams = 'type=' . CRM_Event_Import_Parser::NO_MATCH . '&parser=CRM_Event_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Event_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } else { @@ -73,10 +73,10 @@ class CRM_Event_Import_Form_Summary extends CRM_Core_Form { $this->assign('dupeError', FALSE); - if ($onDuplicate == CRM_Event_Import_Parser::DUPLICATE_UPDATE) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $dupeActionString = ts('These records have been updated with the imported data.'); } - elseif ($onDuplicate == CRM_Event_Import_Parser::DUPLICATE_FILL) { + elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) { $dupeActionString = ts('These records have been filled in with the imported data.'); } else { diff --git a/CRM/Event/Import/Form/UploadFile.php b/CRM/Event/Import/Form/UploadFile.php index 5cb152830f..d1ed33c829 100644 --- a/CRM/Event/Import/Form/UploadFile.php +++ b/CRM/Event/Import/Form/UploadFile.php @@ -79,17 +79,17 @@ class CRM_Event_Import_Form_UploadFile extends CRM_Core_Form { $duplicateOptions = array(); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Skip'), CRM_Event_Import_Parser::DUPLICATE_SKIP + NULL, NULL, ts('Skip'), CRM_Import_Parser::DUPLICATE_SKIP ); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Update'), CRM_Event_Import_Parser::DUPLICATE_UPDATE + NULL, NULL, ts('Update'), CRM_Import_Parser::DUPLICATE_UPDATE ); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('No Duplicate Checking'), CRM_Event_Import_Parser::DUPLICATE_NOCHECK + NULL, NULL, ts('No Duplicate Checking'), CRM_Import_Parser::DUPLICATE_NOCHECK ); // for contributions NOCHECK == SKIP // $duplicateOptions[] = $this->createElement('radio', - // null, null, ts('No Duplicate Checking'), CRM_Contribute_Import_Parser::DUPLICATE_NOCHECK); + // null, null, ts('No Duplicate Checking'), CRM_Import_Parser::DUPLICATE_NOCHECK); $this->addGroup($duplicateOptions, 'onDuplicate', ts('On Duplicate Entries') @@ -110,31 +110,31 @@ class CRM_Event_Import_Form_UploadFile extends CRM_Core_Form { $this->setDefaults(array( 'onDuplicate' => - CRM_Event_Import_Parser::DUPLICATE_SKIP, + CRM_Import_Parser::DUPLICATE_SKIP, )); //contact types option $contactOptions = array(); if (CRM_Contact_BAO_ContactType::isActive('Individual')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Individual'), CRM_Event_Import_Parser::CONTACT_INDIVIDUAL + NULL, NULL, ts('Individual'), CRM_Import_Parser::CONTACT_INDIVIDUAL ); } if (CRM_Contact_BAO_ContactType::isActive('Household')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Household'), CRM_Event_Import_Parser::CONTACT_HOUSEHOLD + NULL, NULL, ts('Household'), CRM_Import_Parser::CONTACT_HOUSEHOLD ); } if (CRM_Contact_BAO_ContactType::isActive('Organization')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Organization'), CRM_Event_Import_Parser::CONTACT_ORGANIZATION + NULL, NULL, ts('Organization'), CRM_Import_Parser::CONTACT_ORGANIZATION ); } $this->addGroup($contactOptions, 'contactType', ts('Contact Type')); $this->setDefaults(array( 'contactType' => - CRM_Event_Import_Parser::CONTACT_INDIVIDUAL, + CRM_Import_Parser::CONTACT_INDIVIDUAL, ) ); @@ -189,7 +189,7 @@ class CRM_Event_Import_Form_UploadFile extends CRM_Core_Form { $parser->run($fileName, $seperator, $mapper, $skipColumnHeader, - CRM_Event_Import_Parser::MODE_MAPFIELD, $contactType + CRM_Import_Parser::MODE_MAPFIELD, $contactType ); // add all the necessary variables to the form diff --git a/CRM/Event/Import/Parser.php b/CRM/Event/Import/Parser.php index 9f49826c04..06813afcc4 100644 --- a/CRM/Event/Import/Parser.php +++ b/CRM/Event/Import/Parser.php @@ -584,15 +584,15 @@ abstract class CRM_Event_Import_Parser extends CRM_Import_Parser { switch ($this->_contactType) { case 'Individual': - $store->set('contactType', CRM_Event_Import_Parser::CONTACT_INDIVIDUAL); + $store->set('contactType', CRM_Import_Parser::CONTACT_INDIVIDUAL); break; case 'Household': - $store->set('contactType', CRM_Event_Import_Parser::CONTACT_HOUSEHOLD); + $store->set('contactType', CRM_Import_Parser::CONTACT_HOUSEHOLD); break; case 'Organization': - $store->set('contactType', CRM_Event_Import_Parser::CONTACT_ORGANIZATION); + $store->set('contactType', CRM_Import_Parser::CONTACT_ORGANIZATION); } if ($this->_invalidRowCount) { diff --git a/CRM/Event/Import/Parser/Participant.php b/CRM/Event/Import/Parser/Participant.php index 22f0794b5b..b19491da52 100644 --- a/CRM/Event/Import/Parser/Participant.php +++ b/CRM/Event/Import/Parser/Participant.php @@ -132,7 +132,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { * @access public */ function mapField(&$values) { - return CRM_Event_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** @@ -164,7 +164,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { if ($this->_eventIndex > -1 && $this->_eventTitleIndex > -1) { array_unshift($values, ts('Select either EventID OR Event Title')); - return CRM_Event_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } elseif ($this->_eventTitleIndex > -1) { $index = $this->_eventTitleIndex; @@ -196,7 +196,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { if ($errorRequired) { array_unshift($values, ts('Missing required field(s) :') . $missingField); - return CRM_Event_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } $errorMessage = NULL; @@ -258,9 +258,9 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { $tempMsg = "Invalid value for field(s) : $errorMessage"; array_unshift($values, $tempMsg); $errorMessage = NULL; - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } - return CRM_Event_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** @@ -276,7 +276,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { // first make sure this is a valid line $response = $this->summary($values); - if ($response != CRM_Event_Import_Parser::VALID) { + if ($response != CRM_Import_Parser::VALID) { return $response; } $params = &$this->getActiveFieldParams(); @@ -335,15 +335,15 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { if ($formatError) { array_unshift($values, $formatError['error_message']); - return CRM_Event_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } if (!CRM_Utils_Rule::integer($formatted['event_id'])) { array_unshift($values, ts('Invalid value for Event ID')); - return CRM_Event_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } - if ($onDuplicate != CRM_Event_Import_Parser::DUPLICATE_UPDATE) { + if ($onDuplicate != CRM_Import_Parser::DUPLICATE_UPDATE) { $formatted['custom'] = CRM_Core_BAO_CustomField::postProcess($formatted, CRM_Core_DAO::$_nullObject, NULL, @@ -370,7 +370,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { $newParticipant = _civicrm_api3_deprecated_participant_check_params($formatted, $participantValues, FALSE); if ($newParticipant['error_message']) { array_unshift($values, $newParticipant['error_message']); - return CRM_Event_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } $newParticipant = CRM_Event_BAO_Participant::create($formatted, $ids); if( CRM_Utils_Array::value('fee_level', $formatted)) { @@ -382,11 +382,11 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { } $this->_newParticipant[] = $newParticipant->id; - return CRM_Event_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } else { array_unshift($values, 'Matching Participant record not found for Participant ID ' . $formatValues['participant_id'] . '. Row was skipped.'); - return CRM_Event_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } } @@ -439,7 +439,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { } array_unshift($values, 'No matching Contact found for (' . $disp . ')'); - return CRM_Event_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } else { @@ -449,7 +449,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { $checkCid->find(TRUE); if ($checkCid->id != $formatted['contact_id']) { array_unshift($values, 'Mismatch of External identifier :' . $formatValues['external_identifier'] . ' and Contact Id:' . $formatted['contact_id']); - return CRM_Event_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } @@ -457,7 +457,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { } if (is_array($newParticipant) && civicrm_error($newParticipant)) { - if ($onDuplicate == CRM_Event_Import_Parser::DUPLICATE_SKIP) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) { $contactID = CRM_Utils_Array::value('contactID', $newParticipant); $participantID = CRM_Utils_Array::value('participantID', $newParticipant); @@ -468,13 +468,13 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { ($participantID == $newParticipant['error_message']['params'][0]) ) { array_unshift($values, $url); - return CRM_Event_Import_Parser::DUPLICATE; + return CRM_Import_Parser::DUPLICATE; } elseif ($newParticipant['error_message']) { array_unshift($values, $newParticipant['error_message']); - return CRM_Event_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } - return CRM_Event_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } @@ -482,7 +482,7 @@ class CRM_Event_Import_Parser_Participant extends CRM_Event_Import_Parser { $this->_newParticipants[] = CRM_Utils_Array::value('id', $newParticipant); } - return CRM_Event_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** diff --git a/CRM/Mailing/Event/BAO/Forward.php b/CRM/Mailing/Event/BAO/Forward.php index 2ecbf1a291..9f479685f5 100644 --- a/CRM/Mailing/Event/BAO/Forward.php +++ b/CRM/Mailing/Event/BAO/Forward.php @@ -119,7 +119,7 @@ class CRM_Mailing_Event_BAO_Forward extends CRM_Mailing_Event_DAO_Forward { ); require_once 'CRM/Utils/DeprecatedUtils.php'; _civicrm_api3_deprecated_add_formatted_param($value, $formatted); - $formatted['onDuplicate'] = CRM_Contact_Import_Parser::DUPLICATE_SKIP; + $formatted['onDuplicate'] = CRM_Import_Parser::DUPLICATE_SKIP; $formatted['fixAddress'] = TRUE; $contact = civicrm_api('contact', 'create', $formatted); if (civicrm_error($contact)) { diff --git a/CRM/Mailing/Event/BAO/Subscribe.php b/CRM/Mailing/Event/BAO/Subscribe.php index 144271a4dd..ad7d1e5fcc 100644 --- a/CRM/Mailing/Event/BAO/Subscribe.php +++ b/CRM/Mailing/Event/BAO/Subscribe.php @@ -114,7 +114,7 @@ LEFT JOIN civicrm_email ON contact_a.id = civicrm_email.contact_id ); _civicrm_api3_deprecated_add_formatted_param($value, $formatted); - $formatted['onDuplicate'] = CRM_Contact_Import_Parser::DUPLICATE_SKIP; + $formatted['onDuplicate'] = CRM_Import_Parser::DUPLICATE_SKIP; $formatted['fixAddress'] = TRUE; require_once 'api/api.php'; $contact = civicrm_api('contact', 'create', $formatted); diff --git a/CRM/Member/Import/Form/MapField.php b/CRM/Member/Import/Form/MapField.php index 81ec6ce08e..1159c47907 100644 --- a/CRM/Member/Import/Form/MapField.php +++ b/CRM/Member/Import/Form/MapField.php @@ -196,7 +196,7 @@ class CRM_Member_Import_Form_MapField extends CRM_Core_Form { //CRM-2219 removing other required fields since for updation only //membership id is required. - if ($this->_onDuplicate == CRM_Member_Import_Parser::DUPLICATE_UPDATE) { + if ($this->_onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $remove = array('membership_contact_id', 'email', 'first_name', 'last_name', 'external_identifier'); foreach ($remove as $value) { unset($this->_mapperFields[$value]); @@ -206,7 +206,7 @@ class CRM_Member_Import_Form_MapField extends CRM_Core_Form { $highlightedFields[] = $name; } } - elseif ($this->_onDuplicate == CRM_Member_Import_Parser::DUPLICATE_SKIP) { + elseif ($this->_onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) { unset($this->_mapperFields['membership_id']); $highlightedFieldsArray = array('membership_contact_id', 'email', 'external_identifier', 'membership_start_date', 'membership_type_id'); foreach ($highlightedFieldsArray as $name) { @@ -438,9 +438,9 @@ class CRM_Member_Import_Form_MapField extends CRM_Core_Form { $contactTypeId = $self->get('contactType'); $contactTypes = array( - CRM_Member_Import_Parser::CONTACT_INDIVIDUAL => 'Individual', - CRM_Member_Import_Parser::CONTACT_HOUSEHOLD => 'Household', - CRM_Member_Import_Parser::CONTACT_ORGANIZATION => 'Organization', + CRM_Import_Parser::CONTACT_INDIVIDUAL => 'Individual', + CRM_Import_Parser::CONTACT_HOUSEHOLD => 'Household', + CRM_Import_Parser::CONTACT_ORGANIZATION => 'Organization', ); $params = array( 'used' => 'Unsupervised', @@ -462,7 +462,7 @@ class CRM_Member_Import_Form_MapField extends CRM_Core_Form { if (!in_array($field, $importKeys)) { if ($field == 'membership_contact_id') { if ((($weightSum >= $threshold || in_array('external_identifier', $importKeys)) && - $self->_onDuplicate != CRM_Member_Import_Parser::DUPLICATE_UPDATE + $self->_onDuplicate != CRM_Import_Parser::DUPLICATE_UPDATE ) || in_array('membership_id', $importKeys) ) { @@ -626,7 +626,7 @@ class CRM_Member_Import_Form_MapField extends CRM_Core_Form { $parser = new CRM_Member_Import_Parser_Membership($mapperKeysMain, $mapperLocType, $mapperPhoneType); $parser->run($fileName, $seperator, $mapper, $skipColumnHeader, - CRM_Member_Import_Parser::MODE_PREVIEW, $this->get('contactType') + CRM_Import_Parser::MODE_PREVIEW, $this->get('contactType') ); // add all the necessary variables to the form $parser->set($this); diff --git a/CRM/Member/Import/Form/Preview.php b/CRM/Member/Import/Form/Preview.php index 22cb5c7ba7..9c1636f375 100644 --- a/CRM/Member/Import/Form/Preview.php +++ b/CRM/Member/Import/Form/Preview.php @@ -74,17 +74,17 @@ class CRM_Member_Import_Form_Preview extends CRM_Core_Form { } if ($invalidRowCount) { - $urlParams = 'type=' . CRM_Member_Import_Parser::ERROR . '&parser=CRM_Member_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Member_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } if ($conflictRowCount) { - $urlParams = 'type=' . CRM_Member_Import_Parser::CONFLICT . '&parser=CRM_Member_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Member_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } if ($mismatchCount) { - $urlParams = 'type=' . CRM_Member_Import_Parser::NO_MATCH . '&parser=CRM_Member_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Member_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } @@ -197,13 +197,13 @@ class CRM_Member_Import_Form_Preview extends CRM_Core_Form { $parser->run($fileName, $seperator, $mapperFields, $skipColumnHeader, - CRM_Member_Import_Parser::MODE_IMPORT, + CRM_Import_Parser::MODE_IMPORT, $this->get('contactType'), $onDuplicate ); // add all the necessary variables to the form - $parser->set($this, CRM_Member_Import_Parser::MODE_IMPORT); + $parser->set($this, CRM_Import_Parser::MODE_IMPORT); // check if there is any error occured @@ -224,11 +224,11 @@ class CRM_Member_Import_Form_Preview extends CRM_Core_Form { fclose($fd); $this->set('errorFile', $errorFile); - $urlParams = 'type=' . CRM_Member_Import_Parser::ERROR . '&parser=CRM_Member_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Member_Import_Parser'; $this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Member_Import_Parser::CONFLICT . '&parser=CRM_Member_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Member_Import_Parser'; $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); - $urlParams = 'type=' . CRM_Member_Import_Parser::NO_MATCH . '&parser=CRM_Member_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Member_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } } diff --git a/CRM/Member/Import/Form/Summary.php b/CRM/Member/Import/Form/Summary.php index 8b702ac1bb..9a6a5ccb61 100644 --- a/CRM/Member/Import/Form/Summary.php +++ b/CRM/Member/Import/Form/Summary.php @@ -60,11 +60,11 @@ class CRM_Member_Import_Form_Summary extends CRM_Core_Form { $onDuplicate = $this->get('onDuplicate'); $mismatchCount = $this->get('unMatchCount'); if ($duplicateRowCount > 0) { - $urlParams = 'type=' . CRM_Member_Import_Parser::DUPLICATE . '&parser=CRM_Member_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::DUPLICATE . '&parser=CRM_Member_Import_Parser'; $this->set('downloadDuplicateRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } elseif ($mismatchCount) { - $urlParams = 'type=' . CRM_Member_Import_Parser::NO_MATCH . '&parser=CRM_Member_Import_Parser'; + $urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Member_Import_Parser'; $this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams)); } else { @@ -74,10 +74,10 @@ class CRM_Member_Import_Form_Summary extends CRM_Core_Form { $this->assign('dupeError', FALSE); - if ($onDuplicate == CRM_Member_Import_Parser::DUPLICATE_UPDATE) { + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE) { $dupeActionString = ts('These records have been updated with the imported data.'); } - elseif ($onDuplicate == CRM_Member_Import_Parser::DUPLICATE_FILL) { + elseif ($onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) { $dupeActionString = ts('These records have been filled in with the imported data.'); } else { diff --git a/CRM/Member/Import/Form/UploadFile.php b/CRM/Member/Import/Form/UploadFile.php index 609ede02ec..075c17b4b9 100644 --- a/CRM/Member/Import/Form/UploadFile.php +++ b/CRM/Member/Import/Form/UploadFile.php @@ -79,10 +79,10 @@ class CRM_Member_Import_Form_UploadFile extends CRM_Core_Form { $duplicateOptions = array(); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Insert new Membership'), CRM_Member_Import_Parser::DUPLICATE_SKIP + NULL, NULL, ts('Insert new Membership'), CRM_Import_Parser::DUPLICATE_SKIP ); $duplicateOptions[] = $this->createElement('radio', - NULL, NULL, ts('Update existing Membership'), CRM_Member_Import_Parser::DUPLICATE_UPDATE + NULL, NULL, ts('Update existing Membership'), CRM_Import_Parser::DUPLICATE_UPDATE ); $this->addGroup($duplicateOptions, 'onDuplicate', @@ -90,7 +90,7 @@ class CRM_Member_Import_Form_UploadFile extends CRM_Core_Form { ); $this->setDefaults(array( 'onDuplicate' => - CRM_Member_Import_Parser::DUPLICATE_SKIP, + CRM_Import_Parser::DUPLICATE_SKIP, )); //get the saved mapping details @@ -110,17 +110,17 @@ class CRM_Member_Import_Form_UploadFile extends CRM_Core_Form { $contactOptions = array(); if (CRM_Contact_BAO_ContactType::isActive('Individual')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Individual'), CRM_Member_Import_Parser::CONTACT_INDIVIDUAL + NULL, NULL, ts('Individual'), CRM_Import_Parser::CONTACT_INDIVIDUAL ); } if (CRM_Contact_BAO_ContactType::isActive('Household')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Household'), CRM_Member_Import_Parser::CONTACT_HOUSEHOLD + NULL, NULL, ts('Household'), CRM_Import_Parser::CONTACT_HOUSEHOLD ); } if (CRM_Contact_BAO_ContactType::isActive('Organization')) { $contactOptions[] = $this->createElement('radio', - NULL, NULL, ts('Organization'), CRM_Member_Import_Parser::CONTACT_ORGANIZATION + NULL, NULL, ts('Organization'), CRM_Import_Parser::CONTACT_ORGANIZATION ); } @@ -130,7 +130,7 @@ class CRM_Member_Import_Form_UploadFile extends CRM_Core_Form { $this->setDefaults(array( 'contactType' => - CRM_Member_Import_Parser::CONTACT_INDIVIDUAL, + CRM_Import_Parser::CONTACT_INDIVIDUAL, )); //build date formats @@ -185,7 +185,7 @@ class CRM_Member_Import_Form_UploadFile extends CRM_Core_Form { $parser->run($fileName, $seperator, $mapper, $skipColumnHeader, - CRM_Member_Import_Parser::MODE_MAPFIELD, $contactType + CRM_Import_Parser::MODE_MAPFIELD, $contactType ); // add all the necessary variables to the form diff --git a/CRM/Member/Import/Parser.php b/CRM/Member/Import/Parser.php index e4d86ee271..4b733e6906 100644 --- a/CRM/Member/Import/Parser.php +++ b/CRM/Member/Import/Parser.php @@ -572,15 +572,15 @@ abstract class CRM_Member_Import_Parser extends CRM_Import_Parser { switch ($this->_contactType) { case 'Individual': - $store->set('contactType', CRM_Member_Import_Parser::CONTACT_INDIVIDUAL); + $store->set('contactType', CRM_Import_Parser::CONTACT_INDIVIDUAL); break; case 'Household': - $store->set('contactType', CRM_Member_Import_Parser::CONTACT_HOUSEHOLD); + $store->set('contactType', CRM_Import_Parser::CONTACT_HOUSEHOLD); break; case 'Organization': - $store->set('contactType', CRM_Member_Import_Parser::CONTACT_ORGANIZATION); + $store->set('contactType', CRM_Import_Parser::CONTACT_ORGANIZATION); } if ($this->_invalidRowCount) { diff --git a/CRM/Member/Import/Parser/Membership.php b/CRM/Member/Import/Parser/Membership.php index 13c5e106aa..f90fbddbdb 100644 --- a/CRM/Member/Import/Parser/Membership.php +++ b/CRM/Member/Import/Parser/Membership.php @@ -116,7 +116,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { * @access public */ function mapField(&$values) { - return CRM_Member_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** @@ -154,7 +154,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { if ($errorRequired) { array_unshift($values, ts('Missing required fields')); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } $params = &$this->getActiveFieldParams(); @@ -240,10 +240,10 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { $tempMsg = "Invalid value for field(s) : $errorMessage"; array_unshift($values, $tempMsg); $errorMessage = NULL; - return CRM_Contact_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } - return CRM_Member_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } /** @@ -259,7 +259,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { // first make sure this is a valid line $response = $this->summary($values); - if ($response != CRM_Member_Import_Parser::VALID) { + if ($response != CRM_Import_Parser::VALID) { return $response; } @@ -366,10 +366,10 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { if ($formatError) { array_unshift($values, $formatError['error_message']); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } - if ($onDuplicate != CRM_Member_Import_Parser::DUPLICATE_UPDATE) { + if ($onDuplicate != CRM_Import_Parser::DUPLICATE_UPDATE) { $formatted['custom'] = CRM_Core_BAO_CustomField::postProcess($formatted, CRM_Core_DAO::$_nullObject, NULL, @@ -378,12 +378,12 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { } else { //fix for CRM-2219 Update Membership - // onDuplicate == CRM_Member_Import_Parser::DUPLICATE_UPDATE + // onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE if (CRM_Utils_Array::value('is_override', $formatted) && !CRM_Utils_Array::value('status_id', $formatted) ) { array_unshift($values, 'Required parameter missing: Status'); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } if ($formatValues['membership_id']) { @@ -410,16 +410,16 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { $newMembership = CRM_Member_BAO_Membership::create($formatted, $ids, TRUE); if (civicrm_error($newMembership)) { array_unshift($values, $newMembership['is_error'] . ' for Membership ID ' . $formatValues['membership_id'] . '. Row was skipped.'); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } else { $this->_newMemberships[] = $newMembership->id; - return CRM_Member_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } } else { array_unshift($values, 'Matching Membership record not found for Membership ID ' . $formatValues['membership_id'] . '. Row was skipped.'); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } } @@ -441,7 +441,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { $matchedIDs = explode(',', $error['error_message']['params'][0]); if (count($matchedIDs) > 1) { array_unshift($values, 'Multiple matching contact records detected for this row. The membership was not imported'); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } else { $cid = $matchedIDs[0]; @@ -474,12 +474,12 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { elseif (!CRM_Utils_Array::value('is_override', $formatted)) { if (empty($calcStatus)) { array_unshift($values, 'Status in import row (' . $formatValues['status_id'] . ') does not match calculated status based on your configured Membership Status Rules. Record was not imported.'); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } elseif ($formatted['status_id'] != $calcStatus['id']) { //Status Hold" is either NOT mapped or is FALSE array_unshift($values, 'Status in import row (' . $formatValues['status_id'] . ') does not match calculated status based on your configured Membership Status Rules (' . $calcStatus['name'] . '). Record was not imported.'); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } @@ -487,11 +487,11 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { $newMembership = civicrm_api('membership', 'create', $formatted); if (civicrm_error($newMembership)) { array_unshift($values, $newMembership['error_message']); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } $this->_newMemberships[] = $newMembership['id']; - return CRM_Member_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } } else { @@ -525,7 +525,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { } array_unshift($values, 'No matching Contact found for (' . $disp . ')'); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } else { @@ -535,7 +535,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { $checkCid->find(TRUE); if ($checkCid->id != $formatted['contact_id']) { array_unshift($values, 'Mismatch of External identifier :' . $formatValues['external_identifier'] . ' and Contact Id:' . $formatted['contact_id']); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } @@ -566,12 +566,12 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { elseif (!CRM_Utils_Array::value('is_override', $formatted)) { if (empty($calcStatus)) { array_unshift($values, 'Status in import row (' . CRM_Utils_Array::value('status_id', $formatValues) . ') does not match calculated status based on your configured Membership Status Rules. Record was not imported.'); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } elseif ($formatted['status_id'] != $calcStatus['id']) { //Status Hold" is either NOT mapped or is FALSE array_unshift($values, 'Status in import row (' . CRM_Utils_Array::value('status_id', $formatValues) . ') does not match calculated status based on your configured Membership Status Rules (' . $calcStatus['name'] . '). Record was not imported.'); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } } @@ -579,11 +579,11 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser { $newMembership = civicrm_api('membership', 'create', $formatted); if (civicrm_error($newMembership)) { array_unshift($values, $newMembership['error_message']); - return CRM_Member_Import_Parser::ERROR; + return CRM_Import_Parser::ERROR; } $this->_newMemberships[] = $newMembership['id']; - return CRM_Member_Import_Parser::VALID; + return CRM_Import_Parser::VALID; } } diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php index 293d3d08a6..8177c20756 100644 --- a/CRM/Utils/DeprecatedUtils.php +++ b/CRM/Utils/DeprecatedUtils.php @@ -472,7 +472,7 @@ function _civicrm_api3_deprecated_formatted_param($params, &$values, $create = F //retrieve pledge details as well as to validate pledge ID //first need to check for update mode - if ($onDuplicate == CRM_Contribute_Import_Parser::DUPLICATE_UPDATE && + if ($onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE && ($params['contribution_id'] || $params['trxn_id'] || $params['invoice_id']) ) { $contribution = new CRM_Contribute_DAO_Contribution(); @@ -1377,7 +1377,7 @@ function _civicrm_api3_deprecated_membership_format_params($params, &$values, $c */ function _civicrm_api3_deprecated_create_participant_formatted($params, $onDuplicate) { require_once 'CRM/Event/Import/Parser.php'; - if ($onDuplicate != CRM_Event_Import_Parser::DUPLICATE_NOCHECK) { + if ($onDuplicate != CRM_Import_Parser::DUPLICATE_NOCHECK) { CRM_Core_Error::reset(); $error = _civicrm_api3_deprecated_participant_check_params($params, TRUE); if (civicrm_error($error)) { diff --git a/tests/phpunit/api/v3/ParticipantTest.php b/tests/phpunit/api/v3/ParticipantTest.php index df332aa450..2b44894e7b 100644 --- a/tests/phpunit/api/v3/ParticipantTest.php +++ b/tests/phpunit/api/v3/ParticipantTest.php @@ -738,7 +738,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { 'version' => 3, ); require_once 'CRM/Event/Import/Parser.php'; - $onDuplicate = CRM_Event_Import_Parser::DUPLICATE_NOCHECK; + $onDuplicate = CRM_Import_Parser::DUPLICATE_NOCHECK; $participant = _civicrm_api3_deprecated_create_participant_formatted($params, $onDuplicate); $this->assertEquals($participant['is_error'], 0); } -- 2.25.1