X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FActivity%2FImport%2FParser%2FActivity.php;h=9748f71f1de41639cfda6c38ba9f3dedad36d2fa;hb=32864ccf6ecdf9927f12f57a693ef0f22d9ccfb4;hp=1d5a7d6e0aa06187cf1ce60a80afec595a7576af;hpb=a22c002ab7061a4604f2352fd5f1fd0f8690531c;p=civicrm-core.git diff --git a/CRM/Activity/Import/Parser/Activity.php b/CRM/Activity/Import/Parser/Activity.php index 1d5a7d6e0a..9748f71f1d 100644 --- a/CRM/Activity/Import/Parser/Activity.php +++ b/CRM/Activity/Import/Parser/Activity.php @@ -1,7 +1,7 @@ _mapperKeys = &$mapperKeys; } /** - * the initializer code, called before the processing + * The initializer code, called before the processing * * @return void - * @access public */ - function init() { + public function init() { $activityContact = CRM_Activity_BAO_ActivityContact::import(); $activityTarget['target_contact_id'] = $activityContact['contact_id']; $fields = array_merge(CRM_Activity_BAO_Activity::importableFields(), @@ -128,38 +127,38 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { } /** - * handle the values in mapField mode + * Handle the values in mapField mode * - * @param array $values the array of values belonging to this line + * @param array $values + * The array of values belonging to this line. * * @return boolean - * @access public */ - function mapField(&$values) { + public function mapField(&$values) { return CRM_Import_Parser::VALID; } /** - * handle the values in preview mode + * Handle the values in preview mode * - * @param array $values the array of values belonging to this line + * @param array $values + * The array of values belonging to this line. * * @return boolean the result of this processing - * @access public */ - function preview(&$values) { + public function preview(&$values) { return $this->summary($values); } /** - * handle the values in summary mode + * Handle the values in summary mode * - * @param array $values the array of values belonging to this line + * @param array $values + * The array of values belonging to this line. * * @return boolean the result of this processing - * @access public */ - function summary(&$values) { + public function summary(&$values) { $erroneousField = NULL; $response = $this->setActiveFieldValues($values, $erroneousField); $index = -1; @@ -234,15 +233,16 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { } /** - * handle the values in import mode + * Handle the values in import mode * - * @param int $onDuplicate the code for what action to take on duplicates - * @param array $values the array of values belonging to this line + * @param int $onDuplicate + * The code for what action to take on duplicates. + * @param array $values + * The array of values belonging to this line. * * @return boolean the result of this processing - * @access public */ - function import($onDuplicate, &$values) { + public function import($onDuplicate, &$values) { // first make sure this is a valid line $response = $this->summary($values); @@ -265,13 +265,13 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { foreach ($params as $key => $val) { if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) { - if ($val) { + if ($key == 'activity_date_time' && $val) { $params[$key] = CRM_Utils_Date::formatDate($val, $dateType); } - elseif ($customFields[$customFieldID]['data_type'] == 'Date') { + elseif (!empty($customFields[$customFieldID]) && $customFields[$customFieldID]['data_type'] == 'Date') { CRM_Contact_Import_Parser_Contact::formatCustomDate($params, $params, $dateType, $key); } - elseif ($customFields[$customFieldID]['data_type'] == 'Boolean') { + elseif (!empty($customFields[$customFieldID]) && $customFields[$customFieldID]['data_type'] == 'Boolean') { $params[$key] = CRM_Utils_String::strtoboolstr($val); } } @@ -393,12 +393,11 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser { } /** - * the initializer code, called before the processing + * The initializer code, called before the processing * * @return void - * @access public */ - function fini() {} + public function fini() { + } } -