<?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$
*
*/
}
}
+ 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])) {
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;