From: jitendrapurohit Date: Fri, 2 Sep 2016 08:35:22 +0000 (+0530) Subject: additional fixes for pay later X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=37e877b2670ffc08bb7f61801ec7e0a11edc2429;p=civicrm-core.git additional fixes for pay later --- diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 1fee2ce6c7..f36f4398d5 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -62,7 +62,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu public function preProcess() { parent::preProcess(); - $this->_ccid = CRM_Utils_Request::retrieve('ccid', 'Positive', $this); $this->_paymentProcessors = $this->get('paymentProcessors'); $this->preProcessPaymentOptions(); @@ -341,7 +340,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu } $this->applyFilter('__ALL__', 'trim'); - $hidePayLater = FALSE; if (empty($this->_ccid)) { $this->add('text', "email-{$this->_bltID}", ts('Email Address'), @@ -353,11 +351,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu else { $this->addElement('hidden', "email-{$this->_bltID}", 1); $this->add('text', 'total_amount', ts('Total Amount'), array('readonly' => TRUE), FALSE); - if (!empty($this->_paymentProcessors[0])) { - $hidePayLater = TRUE; - } } - $this->assign('hidePayLater', $hidePayLater); $pps = array(); //@todo - this should be replaced by a check as to whether billing fields are set $onlinePaymentProcessorEnabled = FALSE; diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 697eb6c996..4f6365e81b 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -197,6 +197,7 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { // current contribution page id $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); + $this->_ccid = CRM_Utils_Request::retrieve('ccid', 'Positive', $this); if (!$this->_id) { // seems like the session is corrupted and/or we lost the id trail // lets just bump this to a regular session error and redirect user to main page @@ -291,6 +292,10 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { // check for is_monetary status $isMonetary = CRM_Utils_Array::value('is_monetary', $this->_values); $isPayLater = CRM_Utils_Array::value('is_pay_later', $this->_values); + if (!empty($this->_ccid) && $isPayLater) { + $isPayLater = FALSE; + $this->_values['is_pay_later'] = FALSE; + } if ($isMonetary && (!$isPayLater || !empty($this->_values['payment_processor'])) diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index a093570ef3..388916feb5 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -321,16 +321,11 @@ {/if} -