else {
$setting = explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($values['user_dashboard_options'], 1, -1));
$invoiceKey = array_search($setKey, $setting);
- if (!empty($invoiceKey)) {
- unset($setting[$invoiceKey]);
- }
+ unset($setting[$invoiceKey]);
$settingName = CRM_Core_DAO::VALUE_SEPARATOR .
implode(CRM_Core_DAO::VALUE_SEPARATOR, array_values($setting)) .
CRM_Core_DAO::VALUE_SEPARATOR;
$params = $this->_params;
// make sure we have values for it
- if (!empty($this->_values['honoree_profile_id']) && !empty($params['soft_credit_type_id'])) {
+ if (!empty($this->_values['honoree_profile_id']) && !empty($params['soft_credit_type_id']) && empty($this->_ccid)) {
$honorName = NULL;
$softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
$this->set('option', $option);
}
$config = CRM_Core_Config::singleton();
- if (in_array('CiviMember', $config->enableComponents)) {
+ if (in_array('CiviMember', $config->enableComponents) && empty($this->_ccid)) {
if (isset($params['selectMembership']) &&
$params['selectMembership'] != 'no_thanks'
) {
$this->assign('membershipBlock', FALSE);
}
}
- $this->buildCustom($this->_values['custom_pre_id'], 'customPre', TRUE);
- $this->buildCustom($this->_values['custom_post_id'], 'customPost', TRUE);
+ if (empty($this->_ccid)) {
+ $this->buildCustom($this->_values['custom_pre_id'], 'customPre', TRUE);
+ $this->buildCustom($this->_values['custom_post_id'], 'customPost', TRUE);
+ }
if (!empty($this->_values['onbehalf_profile_id']) &&
!empty($params['onbehalf']) &&
($this->_values['is_for_organization'] == 2 ||
!empty($params['is_for_organization'])
- )
+ ) && empty($this->_ccid)
) {
$fieldTypes = array('Contact', 'Organization');
$contactSubType = CRM_Contact_BAO_ContactType::subTypes('Organization');
// organization params in a separate variable, to make sure
// normal behavior is continued. And use that variable to
// process on-behalf-of functionality.
- if (!empty($this->_values['onbehalf_profile_id'])) {
+ if (!empty($this->_values['onbehalf_profile_id']) && empty($this->_ccid)) {
$behalfOrganization = array();
$orgFields = array('organization_name', 'organization_id', 'org_option');
foreach ($orgFields as $fld) {
public function buildQuickForm() {
// build profiles first so that we can determine address fields etc
// and then show copy address checkbox
- $this->buildCustom($this->_values['custom_pre_id'], 'customPre');
- $this->buildCustom($this->_values['custom_post_id'], 'customPost');
+ if (empty($this->_ccid)) {
+ $this->buildCustom($this->_values['custom_pre_id'], 'customPre');
+ $this->buildCustom($this->_values['custom_post_id'], 'customPost');
- // CRM-18399: used by template to pass pre profile id as a url arg
- $this->assign('custom_pre_id', $this->_values['custom_pre_id']);
+ // CRM-18399: used by template to pass pre profile id as a url arg
+ $this->assign('custom_pre_id', $this->_values['custom_pre_id']);
- $this->buildComponentForm($this->_id, $this);
+ $this->buildComponentForm($this->_id, $this);
+ }
// Build payment processor form
CRM_Core_Payment_ProcessorForm::buildQuickForm($this);
$this->set('amount_level', CRM_Utils_Array::value('amount_level', $params));
}
- if ($this->_ccid) {
+ if (!empty($this->_ccid)) {
$this->set('lineItem', $this->_lineItem);
}
elseif ($priceSetId = CRM_Utils_Array::value('priceSetId', $params)) {
*/
public function buildQuickForm() {
$this->assignToTemplate();
+ $this->_ccid = $this->get('ccid');
$productID = $this->get('productID');
$option = $this->get('option');
$membershipTypeID = $this->get('membershipTypeID');
$this->_separateMembershipPayment = $this->get('separateMembershipPayment');
$this->assign("is_separate_payment", $this->_separateMembershipPayment);
- $this->buildCustom($this->_values['custom_pre_id'], 'customPre', TRUE);
- $this->buildCustom($this->_values['custom_post_id'], 'customPost', TRUE);
+ if (empty($this->_ccid)) {
+ $this->buildCustom($this->_values['custom_pre_id'], 'customPre', TRUE);
+ $this->buildCustom($this->_values['custom_post_id'], 'customPost', TRUE);
+ }
if (!empty($this->_values['onbehalf_profile_id']) &&
!empty($params['onbehalf']) &&
($this->_values['is_for_organization'] == 2 ||
!empty($params['is_for_organization'])
- )
+ ) && empty($this->_ccid)
) {
$fieldTypes = array('Contact', 'Organization');
$contactSubType = CRM_Contact_BAO_ContactType::subTypes('Organization');
}
function hidePayLater() {
+ cj('#billingcheckbox').hide();
+ cj('#billingcheckbox').next('label').hide();
cj('input:radio[name="payment_processor_id"][value=0]').hide();
cj('input:radio[name="payment_processor_id"][value=0]').next('label').hide();
}
$this->webtestVerifyTabularData($expected);
}
- public function testOnlineContributionWithPayNowLink() {
+ /**
+ * CRM-19263 - Test online pay now functionality
+ */
+ public function testOnlineContributionWithPayNowLink() {
$this->webtestLogin();
$pageId = 1;
$this->openCiviPage("admin/contribute/amount", "reset=1&action=update&id=$pageId", 'is_pay_later');
1 => '$ 588.50',
2 => '$ 98.50',
);
- foreach($amountValues as $row => $amount) {
+ foreach ($amountValues as $row => $amount) {
$this->clickLink("xpath=//table[@class='selector row-highlight']/tbody/tr[{$row}]/td[8]/span//a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
// View Contribution Record and test for expected values
}
}
+ /**
+ * Contribute using pay now link
+ * @param string $firstName
+ * @param bool $priceSet
+ */
public function _testContributeWithPayNow($firstName, $priceSet = FALSE) {
//user dashboard
$this->openCiviPage("user", "reset=1");
}
+ /**
+ * Contribute with pay later
+ *
+ * @param int $pageId
+ * @param string $firstName
+ * @param bool $priceSet
+ */
public function _testContributeWithPayLater($pageId, $firstName, $priceSet = FALSE) {
$this->openCiviPage("contribute/transact", "reset=1&action=preview&id=$pageId", NULL);
$this->waitForElementPresent("email-5");
$this->assertElementContainsText("xpath=//div[@class='help']/div/p", $payLaterInstructionsText);
}
+ /**
+ * Create test user
+ *
+ * @param string $firstName
+ * @param string $lastName
+ *
+ * @return string
+ */
public function _testCreateUser($firstName, $lastName) {
$this->open($this->sboxPath . "admin/people/create");