X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FForm%2FUpdateBilling.php;h=88d4f22c69cad124f86ecffc20ca40fd327d8680;hb=8381af809c027065ceb28f18b5530ffb3a51ada3;hp=25c2bb1ec4b24e010e7b1830113b990a57aca6b0;hpb=32dc2494c6d263ecee6621ad3d7ca4e892bb3d7a;p=civicrm-core.git diff --git a/CRM/Contribute/Form/UpdateBilling.php b/CRM/Contribute/Form/UpdateBilling.php index 25c2bb1ec4..88d4f22c69 100644 --- a/CRM/Contribute/Form/UpdateBilling.php +++ b/CRM/Contribute/Form/UpdateBilling.php @@ -1,7 +1,7 @@ _paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_crid, 'recur', 'info'); $this->_paymentProcessorObj = CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity($this->_crid, 'recur', 'obj'); $this->_subscriptionDetails = CRM_Contribute_BAO_ContributionRecur::getSubscriptionDetails($this->_crid); - + // Are we cancelling a recurring contribution that is linked to an auto-renew membership? if ($this->_subscriptionDetails->membership_id) { $this->_mid = $this->_subscriptionDetails->membership_id; @@ -109,7 +109,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { $this->assign('paymentProcessor', $this->_paymentProcessor); // get the billing location type - $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'); + $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate'); $this->_bltID = array_search('Billing', $locationTypes); $this->assign('bltID', $this->_bltID); if (!$this->_bltID) { @@ -163,7 +163,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { $config = CRM_Core_Config::singleton(); // set default country from config if no country set - if (!CRM_Utils_Array::value("billing_country_id-{$this->_bltID}", $this->_defaults)) { + if (empty($this->_defaults["billing_country_id-{$this->_bltID}"])) { $this->_defaults["billing_country_id-{$this->_bltID}"] = $config->defaultContactCountry; } @@ -176,7 +176,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { /** * Function to build the form * - * @return None + * @return void * @access public */ public function buildQuickForm() { @@ -290,7 +290,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { ); $msgTitle = ts('Details Updated'); $msgType = 'success'; - + $tplParams = array( 'recur_frequency_interval' => $this->_subscriptionDetails->frequency_interval, 'recur_frequency_unit' => $this->_subscriptionDetails->frequency_unit, @@ -317,7 +317,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { // format new billing name $name = $processorParams['first_name']; - if (CRM_Utils_Array::value('middle_name', $processorParams)) { + if (!empty($processorParams['middle_name'])) { $name .= " {$processorParams['middle_name']}"; } $name .= ' ' . $processorParams['last_name']; @@ -326,7 +326,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { // format old billing name $name = $this->_defaults['first_name']; - if (CRM_Utils_Array::value('middle_name', $this->_defaults)) { + if (!empty($this->_defaults['middle_name'])) { $name .= " {$this->_defaults['middle_name']}"; } $name .= ' ' . $this->_defaults['last_name']; @@ -400,7 +400,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { 'toName' => $donorDisplayName, 'toEmail' => $donorEmail, ); - list($sent) = CRM_Core_BAO_MessageTemplates::sendTemplate($sendTemplateParams); + list($sent) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams); } else { $status = ts('There was some problem updating the billing details.'); @@ -413,12 +413,12 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { if ( $userID && $status) { $session->setStatus($status, $msgTitle, $msgType); } else if (!$userID) { - if ($status) + if ($status) CRM_Utils_System::setUFMessage($status); $result = (int) ($updateSubscription && isset($ctype)); - if (isset($tplParams)) + if (isset($tplParams)) $session->set('resultParams', $tplParams); - return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus', + return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus', "reset=1&task=billing&result={$result}")); } }