+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
*/
* Class constructor.
*
* @param array $mapperKeys
- * @param null $mapperLocType
- * @param null $mapperPhoneType
+ * @param int $mapperLocType
+ * @param int $mapperPhoneType
*/
public function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) {
parent::__construct();
$this->_mapperKeys = &$mapperKeys;
}
+ /**
+ * Function of undocumented functionality required by the interface.
+ */
+ protected function fini() {}
+
/**
* The initializer code, called before the processing.
*/
*/
public function summary(&$values) {
$erroneousField = NULL;
- $response = $this->setActiveFieldValues($values, $erroneousField);
+ $this->setActiveFieldValues($values, $erroneousField);
$index = -1;
- $errorRequired = FALSE;
if ($this->_activityTypeIndex > -1 && $this->_activityLabelIndex > -1) {
array_unshift($values, ts('Please select either Activity Type ID OR Activity Type Label.'));
$errorMessage = NULL;
- //for date-Formats
+ // For date-Formats
$session = CRM_Core_Session::singleton();
$dateType = $session->get('dateTypes');
if (!isset($params['source_contact_id'])) {
CRM_Contact_Import_Parser_Contact::addToErrorMsg('Activity Engagement Index', $errorMessage);
}
}
- //date-Format part ends
+ // Date-Format part ends.
- //checking error in custom data
+ // Checking error in custom data.
$params['contact_type'] = isset($this->_contactType) ? $this->_contactType : 'Activity';
CRM_Contact_Import_Parser_Contact::isErrorInCustomData($params, $errorMessage);
* the result of this processing
*/
public function import($onDuplicate, &$values) {
- // first make sure this is a valid line
+ // First make sure this is a valid line
$response = $this->summary($values);
if ($response != CRM_Import_Parser::VALID) {
if ($activityLabel) {
$params = array_merge($params, array('activity_label' => $values[$activityLabel]));
}
- //for date-Formats
+ // For date-Formats.
$session = CRM_Core_Session::singleton();
$dateType = $session->get('dateTypes');
if (!isset($params['source_contact_id'])) {
$params['source_contact_id'] = $session->get('userID');
}
- $formatted = array();
- $customFields = CRM_Core_BAO_CustomField::getFields(CRM_Utils_Array::value('contact_type', $params));
+
+ $customFields = CRM_Core_BAO_CustomField::getFields('Activity');
foreach ($params as $key => $val) {
if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) {
$params['subject'] = $val;
}
}
- //date-Format part ends
+ // Date-Format part ends.
require_once 'CRM/Utils/DeprecatedUtils.php';
$formatError = _civicrm_api3_deprecated_activity_formatted_param($params, $params, TRUE);
if ($this->_contactIdIndex < 0) {
- //retrieve contact id using contact dedupe rule.
- //since we are support only individual's activity import.
+ // Retrieve contact id using contact dedupe rule.
+ // Since we are supporting only individual's activity import.
$params['contact_type'] = 'Individual';
$params['version'] = 3;
$error = _civicrm_api3_deprecated_duplicate_formatted_contact($params);
}
}
- /**
- * The initializer code, called before the processing.
- */
- public function fini() {
- }
-
}