From: jitendrapurohit Date: Tue, 6 Sep 2016 05:45:00 +0000 (+0530) Subject: Change button name and amount X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fe552de9e29c2bc629e6dea868c299962a0bc04b;p=civicrm-core.git Change button name and amount --- diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 39af77a1ca..35470008fa 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -496,6 +496,10 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr $contribButton = ts('Continue'); $this->assign('button', ts('Continue')); } + elseif (!empty($this->_ccid)) { + $contribButton = ts('Make Payment'); + $this->assign('button', ts('Make Payment')); + } else { $contribButton = ts('Make Contribution'); $this->assign('button', ts('Make Contribution')); diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index f36f4398d5..76cdb22880 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -157,7 +157,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $this->_defaults = array_merge($this->_defaults, $billingDefaults); } if (!empty($this->_ccid) && !empty($this->_pendingAmount)) { - $this->_defaults['total_amount'] = $this->_pendingAmount; + $this->_defaults['total_amount'] = CRM_Utils_Money::format($this->_pendingAmount, NULL, '%a'); } /* @@ -544,6 +544,10 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if (empty($this->_values['is_confirm_enabled'])) { $submitButton['js'] = array('onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');"); } + //change button name for updating contribution + if (!empty($this->_ccid)) { + $submitButton['name'] = ts('Confirm Payment'); + } $this->addButtons(array($submitButton)); } diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index 8c2f80e929..fcd510d771 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -619,7 +619,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { if (empty($priceSet)) { $this->waitForElementPresent("total_amount"); - $this->assertTrue($this->isElementPresent("xpath=//input[@id='total_amount'][@readonly=1][@value=100]")); + $this->assertTrue($this->isElementPresent("xpath=//input[@id='total_amount'][@readonly=1][@value='100.00']")); } else { $this->assertElementContainsText("xpath=//div[@class='header-dark']", "Contribution Information");