<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | 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 $_haveColumnHeader;
+ /**
+ * @param $fileName
+ * @param string $seperator
+ * @param $mapper
+ * @param bool $skipColumnHeader
+ * @param int $mode
+ * @param int $contactType
+ * @param int $onDuplicate
+ *
+ * @return mixed
+ * @throws Exception
+ */
function run($fileName,
$seperator = ',',
&$mapper,
}
}
+ /**
+ * @param $elements
+ */
function setActiveFieldSoftCredit($elements) {
for ($i = 0; $i < count($elements); $i++) {
$this->_activeFields[$i]->_softCreditField = $elements[$i];
}
}
+ /**
+ * @param $elements
+ */
+ function setActiveFieldSoftCreditType($elements) {
+ for ($i = 0; $i < count($elements); $i++) {
+ $this->_activeFields[$i]->_softCreditType = $elements[$i];
+ }
+ }
/**
* function to format the field values for input to the api
*
if (!isset($params[$this->_activeFields[$i]->_name])) {
$params[$this->_activeFields[$i]->_name] = array();
}
- $params[$this->_activeFields[$i]->_name][$this->_activeFields[$i]->_softCreditField] = $this->_activeFields[$i]->_value;
+ $params[$this->_activeFields[$i]->_name][$i][$this->_activeFields[$i]->_softCreditField] = $this->_activeFields[$i]->_value;
+ if(isset($this->_activeFields[$i]->_softCreditType)){
+ $params[$this->_activeFields[$i]->_name][$i]['soft_credit_type_id'] = $this->_activeFields[$i]->_softCreditType;
+ }
}
if (!isset($params[$this->_activeFields[$i]->_name])) {
return $params;
}
+ /**
+ * @param $name
+ * @param $title
+ * @param int $type
+ * @param string $headerPattern
+ * @param string $dataPattern
+ */
function addField($name, $title, $type = CRM_Utils_Type::T_INT, $headerPattern = '//', $dataPattern = '//') {
if (empty($name)) {
$this->_fields['doNotImport'] = new CRM_Contribute_Import_Field($name, $title, $type, $headerPattern, $dataPattern);
*
* @param CRM_Core_Session $store
*
+ * @param int $mode
+ *
* @return void
* @access public
*/
/**
* Export data to a CSV file
*
- * @param string $filename
+ * @param $fileName
* @param array $header
* @param data $data
*
+ * @internal param string $filename
* @return void
* @access public
*/
foreach ($data as $datum) {
foreach ($datum as $key => $value) {
- if (is_array($value[0])) {
+ if (isset($value[0]) && is_array($value)) {
foreach ($value[0] as $k1 => $v1) {
if ($k1 == 'location_type_id') {
continue;
fclose($fd);
}
+ /**
+ * Determines the file extension based on error code
+ *
+ * @var $type error code constant
+ * @return string
+ * @static
+ */
+ /**
+ * @param error $type
+ *
+ * @return string
+ */
static function errorFileName($type) {
$fileName = NULL;
if (empty($type)) {
return $fileName;
}
+ /**
+ * Determines the file name based on error code
+ *
+ * @var $type error code constant
+ * @return string
+ * @static
+ */
+ /**
+ * @param error $type
+ *
+ * @return string
+ */
static function saveFileName($type) {
$fileName = NULL;
if (empty($type)) {