$lineItem = CRM_Price_BAO_LineItem::getLineItems($this->_compId);
}
else {
- $lineItem = CRM_Price_BAO_LineItem::getLineItems($this->_id, 'contribution', 1);
+ $lineItem = CRM_Price_BAO_LineItem::getLineItems($this->_id, 'contribution', 1, TRUE, TRUE);
}
empty($lineItem) ? NULL : $this->_lineItems[] = $lineItem;
}
$this->assign('lineItem', empty($this->_lineItems) ? FALSE : $this->_lineItems);
// Set title
- if ($this->_contactID) {
- $displayName = CRM_Contact_BAO_Contact::displayName($this->_contactID);
-
- // Check if this is default domain contact CRM-10482
- if (CRM_Contact_BAO_Contact::checkDomainContact($this->_contactID)) {
- $displayName .= ' (' . ts('default organization') . ')';
- }
-
- // omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container
- CRM_Utils_System::setTitle(ts('Contribution from') . ' ' . $displayName);
+ if ($this->_mode) {
+ $this->setPageTitle($this->_ppID ? ts('Credit Card Pledge Payment') : ts('Credit Card Contribution'));
+ }
+ else {
+ $this->setPageTitle($this->_ppID ? ts('Pledge Payment') : ts('Contribution'));
}
if ($this->_id) {
$billingDefaults = $this->getProfileDefaults('Billing', $this->_contactID);
$defaults = array_merge($defaults, $billingDefaults);
-
- // now fix all state country selectors, set correct state based on country
- CRM_Core_BAO_Address::fixAllStateSelects($this, $defaults);
}
if ($this->_id) {
$this->assign('entityID', $this->_id);
if ($this->_context == 'standalone') {
- $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE), TRUE);
+ $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
}
$attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution');
);
}
- $trxnId = $this->add('text', 'trxn_id', ts('Transaction ID'), $attributes['trxn_id']);
+ $trxnId = $this->add('text', 'trxn_id', ts('Transaction ID'), array('class' => 'twelve') + $attributes['trxn_id']);
//add receipt for offline contribution
$this->addElement('checkbox', 'is_email_receipt', ts('Send Receipt?'));
);
CRM_Event_BAO_Participant::add($participantParams);
if (empty($this->_lineItems)) {
- $this->_lineItems = CRM_Price_BAO_LineItem::getLineItems($entityID, 'participant', 1);
+ $this->_lineItems[] = CRM_Price_BAO_LineItem::getLineItems($entityID, 'participant', 1);
}
}
else {
}
// Set is_pay_later flag for back-office offline Pending status contributions CRM-8996
+ // else if contribution_status is changed to Completed is_pay_later flag is changed to 0, CRM-15041
if ($params['contribution_status_id'] == CRM_Core_OptionGroup::getValue('contribution_status', 'Pending', 'name')) {
$params['is_pay_later'] = 1;
}
+ elseif ($params['contribution_status_id'] == CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name')) {
+ $params['is_pay_later'] = 0;
+ }
$ids['contribution'] = $params['id'] = $this->_id;
unset($submittedValues[$key]);
}
}
-
+ $isTest = ($this->_mode == 'test') ? 1 : 0;
// CRM-12680 set $_lineItem if its not set
if (empty($this->_lineItem) && !empty($lineItem)) {
$this->_lineItem = $lineItem;
$paymentParams['receive_date'] = $this->_params['receive_date'];
}
- $result = NULL;
-
// For recurring contribution, create Contribution Record first.
// Contribution ID, Recurring ID and Contact ID needed
// When we get a callback from the payment processor, CRM-7115
if (!empty($paymentParams['is_recur'])) {
$contribution = CRM_Contribute_Form_Contribution_Confirm::processContribution($this,
$this->_params,
- $result,
+ NULL,
$this->_contactID,
$contributionType,
- FALSE,
TRUE,
- FALSE
+ FALSE,
+ $isTest,
+ $this->_lineItem
);
$paymentParams['contributionID'] = $contribution->id;
$paymentParams['contributionTypeID'] = $contribution->financial_type_id;
$paymentParams['contributionPageID'] = $contribution->contribution_page_id;
$paymentParams['contributionRecurID'] = $contribution->contribution_recur_id;
}
-
+ $result = NULL;
if ($paymentParams['amount'] > 0.0) {
// force a re-get of the payment processor in case the form changed it, CRM-7179
$payment = CRM_Core_Payment::singleton($this->_mode, $this->_paymentProcessor, $this, TRUE);
$result,
$this->_contactID,
$contributionType,
- FALSE, FALSE, FALSE
+ FALSE, FALSE,
+ $isTest,
+ $this->_lineItem
);
}
}
}
}
-