From efa3d1d15ee4d8336bf83d60332e54c35cd37f46 Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Wed, 5 Mar 2014 10:48:51 +0530 Subject: [PATCH] CRM-13965-qa-fixes: fix for status message, financial_type select box removal, default date setting to current --- CRM/Contribute/Form/AdditionalPayment.php | 24 ++++++++----------- CRM/Event/BAO/Participant.php | 2 +- .../CRM/Contribute/Form/AdditionalPayment.tpl | 4 ---- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index 6b9c957826..073bd63c66 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -182,8 +182,17 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract CRM_Core_BAO_Address::fixAllStateSelects($this, $defaults); } + if (empty($defaults['trxn_date']) && empty($defaults['trxn_date_time'])) { + list($defaults['trxn_date'], + $defaults['trxn_date_time'] + ) = CRM_Utils_Date::setDateDefaults( + CRM_Utils_Array::value('register_date', $defaults), 'activityDateTime' + ); + } + // Set $newCredit variable in template to control whether link to credit card mode is included CRM_Core_Payment::allowBackofficeCreditCard($this); + return $defaults; } public function buildQuickForm() { @@ -258,11 +267,6 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract $attributes = CRM_Core_DAO::getAttribute('CRM_Financial_DAO_FinancialTrxn'); $this->add('select', 'payment_processor_id', ts('Payment Processor'), $this->_processors, NULL); - $this->add('select', 'financial_type_id', - ts('Financial Type'), - array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(), - TRUE - ); $label = ($this->_refund) ? 'Refund Amount' : 'Payment Amount'; $this->addMoney('total_amount', ts('%1', array(1 => $label)), @@ -389,9 +393,7 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract if (!empty($submittedValues['is_email_receipt']) && $sendReceipt) { $statusMsg .= ' ' . ts('A receipt has been emailed to the contributor.'); } - if (isset($sendReceipt)) { - $statusMsg .= ' ' . ts('Email has been sent successfully'); - } + CRM_Core_Session::setStatus($statusMsg, ts('Saved'), 'success'); $session = CRM_Core_Session::singleton(); @@ -511,12 +513,6 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract $paymentParams['contactID'] = $this->_contactId; CRM_Core_Payment_Form::mapParams($this->_bltID, $this->_params, $paymentParams, TRUE); - $contributionType = new CRM_Financial_DAO_FinancialType(); - $contributionType->id = $params['financial_type_id']; - if (!$contributionType->find(TRUE)) { - CRM_Core_Error::fatal('Could not find a system table'); - } - // add some financial type details to the params list // if folks need to use it $paymentParams['contributionType_name'] = $this->_params['contributionType_name'] = $contributionType->name; diff --git a/CRM/Event/BAO/Participant.php b/CRM/Event/BAO/Participant.php index df5d78e2d0..00122d6b58 100644 --- a/CRM/Event/BAO/Participant.php +++ b/CRM/Event/BAO/Participant.php @@ -1912,7 +1912,7 @@ WHERE (li.entity_table = 'civicrm_participant' AND li.entity_id = {$participantI ); CRM_Financial_BAO_FinancialItem::create($params, NULL, array('id' => $adjustedTrxn->id)); } - //activity creation$contributionStatuses + //activity creation self::addActivityForSelection($participantId, 'Change Registration'); } diff --git a/templates/CRM/Contribute/Form/AdditionalPayment.tpl b/templates/CRM/Contribute/Form/AdditionalPayment.tpl index c14f1a88d2..442f92a01a 100644 --- a/templates/CRM/Contribute/Form/AdditionalPayment.tpl +++ b/templates/CRM/Contribute/Form/AdditionalPayment.tpl @@ -99,10 +99,6 @@ {ts}Event{/ts}{$eventName} - - {$form.financial_type_id.label}{$form.financial_type_id.html}  - - {$form.total_amount.label} -- 2.25.1