<?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$
*
*/
protected $_newParticipants;
/**
- * class constructor
+ * Class constructor
*/
function __construct(&$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL) {
parent::__construct();
}
/**
- * the initializer code, called before the processing
+ * The initializer code, called before the processing
*
* @return void
* @access public
}
/**
- * handle the values in mapField mode
+ * Handle the values in mapField mode
*
* @param array $values the array of values belonging to this line
*
}
/**
- * handle the values in preview mode
+ * Handle the values in preview mode
*
* @param array $values the array of values belonging to this line
*
}
/**
- * handle the values in summary mode
+ * Handle the values in summary mode
*
* @param array $values the array of values belonging to this line
*
if (!(($index < 0) || ($this->_participantStatusIndex < 0))) {
$errorRequired = !CRM_Utils_Array::value($this->_participantStatusIndex, $values);
- if (!CRM_Utils_Array::value('event_id', $params) && !CRM_Utils_Array::value('event_title', $params)) {
+ if (empty($params['event_id']) && empty($params['event_title'])) {
CRM_Contact_Import_Parser_Contact::addToErrorMsg('Event', $missingField);
}
- if (!CRM_Utils_Array::value('participant_status_id', $params)) {
+ if (empty($params['participant_status_id'])) {
CRM_Contact_Import_Parser_Contact::addToErrorMsg('Participant Status', $missingField);
}
}
}
/**
- * 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
$params[$key] = CRM_Utils_String::strtoboolstr($val);
}
}
+ if($key == 'participant_register_date') {
+ CRM_Utils_Date::convertToDefaultDate($params, $dateType, 'participant_register_date');
+ $formatted['participant_register_date'] = CRM_Utils_Date::processDate($params['participant_register_date']);
+ }
}
}
- if (!(CRM_Utils_Array::value('participant_role_id', $params) || CRM_Utils_Array::value('participant_role', $params))) {
- if (CRM_Utils_Array::value('event_id', $params)) {
+ if (!(!empty($params['participant_role_id']) || !empty($params['participant_role']))) {
+ if (!empty($params['event_id'])) {
$params['participant_role_id'] = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['event_id'], 'default_role_id');
}
else {
return CRM_Import_Parser::ERROR;
}
$newParticipant = CRM_Event_BAO_Participant::create($formatted, $ids);
- if( CRM_Utils_Array::value('fee_level', $formatted)) {
+ if (!empty($formatted['fee_level'])) {
$otherParams = array(
'fee_label' => $formatted['fee_level'],
'event_id' => $newParticipant->event_id
}
}
- 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', $formatValues)) {
+ if (!empty($formatValues['external_identifier'])) {
$checkCid = new CRM_Contact_DAO_Contact();
$checkCid->external_identifier = $formatValues['external_identifier'];
$checkCid->find(TRUE);
}
/**
- * the initializer code, called before the processing
+ * The initializer code, called before the processing
*
* @return void
* @access public