<?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$
*
*/
*
* @access public
*
- * @return None
+ * @return array defaults
*/
function setDefaultValues() {
$defaults = array();
if (isset($this->_id)) {
$params = array('id' => $this->_id);
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $this->_BAOName) . ".php");
- eval($this->_BAOName . '::retrieve( $params, $defaults );');
+ $baoName = $this->_BAOName;
+ $baoName::retrieve($params, $defaults);
}
if (isset($defaults['minimum_fee'])) {
/**
* Function to actually build the form
*
- * @return None
+ * @return void
* @access public
*/
public function buildQuickForm() {
* then they weill differ
*
* @param $formValues array values from form. The important values we are looking for are
- * - contact_select_id[1]
- * - contribution_contact_select_id[1]
+ * - contact_id
+ * - soft_credit_contact_id
+ */
+ /**
+ * @param $formValues
*/
function storeContactFields($formValues){
// in a 'standalone form' (contact id not in the url) the contact will be in the form values
- if (CRM_Utils_Array::value('contact_select_id', $formValues)) {
- $this->_contactID = $formValues['contact_select_id'][1];
+ if (!empty($formValues['contact_id'])) {
+ $this->_contactID = $formValues['contact_id'];
}
list($this->_memberDisplayName,
//CRM-10375 Where the payer differs to the member the payer should get the email.
// here we store details in order to do that
- if (CRM_Utils_Array::value('contribution_contact_select_id', $formValues) && CRM_Utils_Array::value('1', $formValues['contribution_contact_select_id'])) {
- $this->_receiptContactId = $this->_contributorContactID = $formValues['contribution_contact_select_id'][1];
+ if (!empty($formValues['soft_credit_contact_id'])) {
+ $this->_receiptContactId = $this->_contributorContactID = $formValues['soft_credit_contact_id'];
list( $this->_contributorDisplayName,
$this->_contributorEmail ) = CRM_Contact_BAO_Contact_Location::getEmailDetails( $this->_contributorContactID );
}