<?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$
*
*/
}
}
- if (!empty($values['honor_contact_id'])) {
- $sql = "SELECT display_name FROM civicrm_contact WHERE id = %1";
- $params = array(1 => array($values['honor_contact_id'], 'Integer'));
- $dao = CRM_Core_DAO::executeQuery($sql, $params);
- if ($dao->fetch()) {
- $url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid=$values[honor_contact_id]");
- $values['honor_display'] = "<A href = $url>" . $dao->display_name . "</A>";
- }
- $honor = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'honor_type_id');
- $values['honor_type'] = CRM_Utils_Array::value(CRM_Utils_Array::value('honor_type_id', $values), $honor);
- }
-
if (!empty($values['contribution_recur_id'])) {
$sql = "SELECT installments, frequency_interval, frequency_unit FROM civicrm_contribution_recur WHERE id = %1";
$params = array(1 => array($values['contribution_recur_id'], 'Integer'));
$values['billing_address'] = $addressDetails[0]['display'];
}
- //get soft credit record if exists.
- $values['softContributions'] = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($values['contribution_id']);
+ //assign soft credit record if exists.
+ $SCRecords = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($values['contribution_id'], TRUE);
+ if (!empty($SCRecords['soft_credit'])) {
+ $this->assign('softContributions', $SCRecords['soft_credit']);
+ unset($SCRecords['soft_credit']);
+ }
+
+ //assign pcp record if exists
+ foreach ($SCRecords as $name => $value) {
+ $this->assign($name, $value);
+ }
$lineItems = array();
if ($id) {
- $lineItem = CRM_Price_BAO_LineItem::getLineItems($id, 'contribution', 1);
- empty($lineItem) ? null :$lineItems[] = $lineItem;
+ $lineItem = CRM_Price_BAO_LineItem::getLineItems($id, 'contribution', 1, TRUE, TRUE);
+ if (!empty($lineItem)) {
+ $lineItems[] = $lineItem;
+ }
+
}
$this->assign('lineItem', empty($lineItems) ? FALSE : $lineItems);
$values['totalAmount'] = $values['total_amount'];
);
}
}
-