<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
);
$fields = array_merge($fields, array(
+ 'source_contact_id' => array(
+ 'title' => ts('Source Contact'),
+ 'headerPattern' => '/Source.Contact?/i',
+ ),
'activity_label' => array(
'title' => ts('Activity Type Label'),
'headerPattern' => '/(activity.)?type label?/i',
$params['target_contact_id'] = $cid;
$params['version'] = 3;
$newActivity = civicrm_api('activity', 'create', $params);
- if (CRM_Utils_Array::value('is_error', $newActivity)) {
+ if (!empty($newActivity['is_error'])) {
array_unshift($values, $newActivity['error_message']);
return CRM_Import_Parser::ERROR;
}
}
}
- if (CRM_Utils_Array::value('external_identifier', $params)) {
+ if (!empty($params['external_identifier'])) {
if ($disp) {
$disp .= "AND {$params['external_identifier']}";
}
}
}
else {
- if (CRM_Utils_Array::value('external_identifier', $params)) {
+ if (!empty($params['external_identifier'])) {
$targetContactId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
$params['external_identifier'], 'id', 'external_identifier'
);
- if (CRM_Utils_Array::value('target_contact_id', $params) &&
+ if (!empty($params['target_contact_id']) &&
$params['target_contact_id'] != $targetContactId
) {
array_unshift($values, 'Mismatch of External identifier :' . $params['external_identifier'] . ' and Contact Id:' . $params['target_contact_id']);
$params['version'] = 3;
$newActivity = civicrm_api('activity', 'create', $params);
- if (CRM_Utils_Array::value('is_error', $newActivity)) {
+ if (!empty($newActivity['is_error'])) {
array_unshift($values, $newActivity['error_message']);
return CRM_Import_Parser::ERROR;
}