INFRA-132 - CRM/Contribute - phpcbf
authorTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 21:09:20 +0000 (13:09 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 23:04:26 +0000 (15:04 -0800)
44 files changed:
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Contribute/BAO/ContributionPage.php
CRM/Contribute/BAO/ContributionRecur.php
CRM/Contribute/BAO/ContributionSoft.php
CRM/Contribute/BAO/ManagePremiums.php
CRM/Contribute/BAO/Premium.php
CRM/Contribute/Form.php
CRM/Contribute/Form/Contribution/Main.php
CRM/Contribute/Form/Contribution/ThankYou.php
CRM/Contribute/Form/ContributionBase.php
CRM/Contribute/Form/ContributionCharts.php
CRM/Contribute/Form/ContributionPage.php
CRM/Contribute/Form/ContributionPage/AddProduct.php
CRM/Contribute/Form/ContributionPage/Amount.php
CRM/Contribute/Form/ContributionPage/Custom.php
CRM/Contribute/Form/ContributionPage/Premium.php
CRM/Contribute/Form/ContributionPage/Settings.php
CRM/Contribute/Form/ContributionPage/TabHeader.php
CRM/Contribute/Form/ContributionPage/ThankYou.php
CRM/Contribute/Form/ContributionPage/Widget.php
CRM/Contribute/Form/ContributionView.php
CRM/Contribute/Form/ManagePremiums.php
CRM/Contribute/Form/Search.php
CRM/Contribute/Form/SoftCredit.php
CRM/Contribute/Form/Task.php
CRM/Contribute/Form/Task/Batch.php
CRM/Contribute/Form/Task/Invoice.php
CRM/Contribute/Form/Task/PDF.php
CRM/Contribute/Form/Task/PDFLetterCommon.php
CRM/Contribute/Form/Task/Result.php
CRM/Contribute/Form/Task/Status.php
CRM/Contribute/Import/Field.php
CRM/Contribute/Import/Form/MapField.php
CRM/Contribute/Import/Form/Preview.php
CRM/Contribute/Info.php
CRM/Contribute/Page/ContributionPage.php
CRM/Contribute/Page/ManagePremiums.php
CRM/Contribute/Page/PaymentInfo.php
CRM/Contribute/Page/SubscriptionStatus.php
CRM/Contribute/Page/Tab.php
CRM/Contribute/Page/UserDashboard.php
CRM/Contribute/PseudoConstant.php
CRM/Contribute/Selector/Search.php
CRM/Contribute/Task.php

index 1595e684b774015bc179d03772ba65239b992491..eae7ce350ad90b0a5e743a983a4f1825bfda3c1b 100644 (file)
@@ -87,10 +87,9 @@ class CRM_Contribute_BAO_Contribution_Utils {
     //CRM-15297 - contributionType is obsolete - pass financial type as well so people can deprecate it
     $paymentParams['financialType_name'] = $paymentParams['contributionType_name'] = $form->_params['contributionType_name'] = $contributionType->name;
     //CRM-11456
-    $paymentParams['financialType_accounting_code'] =  $paymentParams['contributionType_accounting_code'] = $form->_params['contributionType_accounting_code'] = CRM_Financial_BAO_FinancialAccount::getAccountingCode($contributionTypeId);
+    $paymentParams['financialType_accounting_code'] = $paymentParams['contributionType_accounting_code'] = $form->_params['contributionType_accounting_code'] = CRM_Financial_BAO_FinancialAccount::getAccountingCode($contributionTypeId);
     $paymentParams['contributionPageID'] = $form->_params['contributionPageID'] = $form->_values['id'];
 
-
     $payment = NULL;
     $paymentObjError = ts('The system did not record payment details for this payment and so could not process the transaction. Please report this error to the site administrator.');
 
@@ -121,7 +120,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
       );
 
       if ($contribution) {
-      $form->_params['contributionID'] = $contribution->id;
+        $form->_params['contributionID'] = $contribution->id;
       }
 
       $form->_params['contributionTypeID'] = $contributionTypeId;
@@ -350,12 +349,12 @@ class CRM_Contribute_BAO_Contribution_Utils {
 
     // finally send an email receipt
     if ($contribution) {
-    $form->_values['contribution_id'] = $contribution->id;
+      $form->_values['contribution_id'] = $contribution->id;
       CRM_Contribute_BAO_ContributionPage::sendMail($contactID,
         $form->_values, $contribution->is_test,
       FALSE, $fieldTypes
-    );
-  }
+      );
+    }
   }
 
   /**
@@ -507,7 +506,8 @@ INNER JOIN   civicrm_contact contact ON ( contact.id = contrib.contact_id )
     }
     if (!CRM_Utils_System::isNull($params['email'])) {
       $params['email'] = array(
-        1 => array('email' => $params['email'],
+        1 => array(
+      'email' => $params['email'],
           'location_type_id' => $billingLocTypeId,
         ));
     }
@@ -899,7 +899,7 @@ LIMIT 1
    */
   public static function calculateTaxAmount($amount, $taxRate) {
     $taxAmount = array();
-    $taxAmount['tax_amount'] = ($taxRate/100) * CRM_Utils_Rule::cleanMoney($amount);
+    $taxAmount['tax_amount'] = ($taxRate / 100) * CRM_Utils_Rule::cleanMoney($amount);
 
     return $taxAmount;
   }
index 58212b82ba44c012d38d3718711a2a9e3866c0bf..468fe9c1d256fb7f1bb3eb597698fcf6174b4fac 100644 (file)
@@ -108,7 +108,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
     // if ($values ['financial_type_id']) {
     //   $values ['accountingCode'] = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_FinancialType', $values ['financial_type_id'], 'accounting_code' );
     // }
-    }
+  }
 
   /**
    * Send the emails
@@ -238,7 +238,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
         if ($gId) {
           $email = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $gId, 'notify');
           if ($email) {
-            $val = CRM_Core_BAO_UFGroup::checkFieldsEmptyValues($gId, $contactID, CRM_Utils_Array::value($key, $params), true );
+            $val = CRM_Core_BAO_UFGroup::checkFieldsEmptyValues($gId, $contactID, CRM_Utils_Array::value($key, $params), TRUE );
             CRM_Core_BAO_UFGroup::commonSendMail($contactID, $val);
           }
         }
@@ -407,7 +407,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
         $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
         $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue);
         if (count($taxAmt) > 0 && (isset($invoicing) && isset($prefixValue['is_email_pdf']))) {
-          $sendTemplateParams['isEmailPdf'] = True;
+          $sendTemplateParams['isEmailPdf'] = TRUE;
           $sendTemplateParams['contributionId'] = $values['contribution_id'];
         }
         list($sent, $subject, $message, $html) = CRM_Core_BAO_MessageTemplate::sendTemplate($sendTemplateParams);
@@ -827,7 +827,8 @@ LEFT JOIN  civicrm_premiums            ON ( civicrm_premiums.entity_id = civicrm
       case 'financial_type_id':
         // Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get
         return CRM_Financial_BAO_FinancialType::getIncomeFinancialType();
-        break;
+
+      break;
     }
     return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
   }
@@ -835,7 +836,7 @@ LEFT JOIN  civicrm_premiums            ON ( civicrm_premiums.entity_id = civicrm
   /**
    * Get or Set multilingually affected honor params for processing module_data or setting default values.
    *
-   * @param array|String $params: Array when we need to format it according to language state or String as a json encode
+   * @param string $params:
    * @param bool $setDefault: If yes then returns array to used for setting default value afterward
    *
    * @return array|string
@@ -883,10 +884,10 @@ LEFT JOIN  civicrm_premiums            ON ( civicrm_premiums.entity_id = civicrm
     else {
       //if in multilingual state then retrieve the module_data against this contribution and
       //merge with earlier module_data json data to current so not to lose earlier multilingual module_data information
-      $sctJson =  array(
+      $sctJson = array(
         'soft_credit' => array(
           'soft_credit_types' => $params['soft_credit_types'],
-          $config->lcMessages => array (
+          $config->lcMessages => array(
             'honor_block_title' => $params['honor_block_title'],
             'honor_block_text' => $params['honor_block_text']
           )
@@ -899,14 +900,14 @@ LEFT JOIN  civicrm_premiums            ON ( civicrm_premiums.entity_id = civicrm
       $ufJoinDAO->find(TRUE);
       $jsonData = json_decode($ufJoinDAO->module_data);
       if ($jsonData) {
-        $sctJson['soft_credit'] = array_merge((array)$jsonData->soft_credit, $sctJson['soft_credit']);
+        $sctJson['soft_credit'] = array_merge((array) $jsonData->soft_credit, $sctJson['soft_credit']);
       }
       $sctJson = json_encode($sctJson);
     }
     return $sctJson;
   }
 
-   /**
+  /**
    * Generate html for pdf in confirmation receipt email  attachment
    * @param int $contributionId
    *   Contribution Page Id.
index 4d0e12f2722de9b38de3fa02b103ac982ccbdcb8..0e182ad8bd45605b3ab055c6798ed63ccadc6545 100644 (file)
@@ -272,7 +272,7 @@ SELECT r.payment_processor_id
         else {
           $details .= '
 <br/>' . ts('The recurring contribution of %1, every %2 %3 has been cancelled.', array(
-  1 => $dao->amount,
+          1 => $dao->amount,
               2 => $dao->frequency_interval,
               3 => $dao->frequency_unit
             ));
index 3e9fab2164de94ece748d418f48fb9fe7c12f6fd..e0453133093a8af44de6bbd70bdb2486ef0a80ce 100644 (file)
@@ -113,7 +113,8 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
     WHERE cc.is_test = %2 AND ccs.contact_id = %1
     GROUP BY currency';
 
-    $params = array(1 => array($contact_id, 'Integer'),
+    $params = array(
+    1 => array($contact_id, 'Integer'),
       2 => array($isTest, 'Integer'));
 
     $cs = CRM_Core_DAO::executeQuery($query, $params);
@@ -205,7 +206,7 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
    *
    * @return array
    */
-  public static function getSoftCreditIds($contributionID , $isPCP = FALSE) {
+  public static function getSoftCreditIds($contributionID, $isPCP = FALSE) {
     $query = "
   SELECT id
   FROM  civicrm_contribution_soft
@@ -348,24 +349,26 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
           );
           unset($profileFields['prefix_id']);
         }
-          $honorName .= ' ' . $params['first_name'] . ' ' . $params['last_name'];
-          unset($profileFields['first_name']);
-          unset($profileFields['last_name']);
-          if (array_key_exists('suffix_id', $params)) {
-            $honorName .= ' ' . CRM_Utils_Array::value(CRM_Utils_Array::value('suffix_id', $params),
+        $honorName .= ' ' . $params['first_name'] . ' ' . $params['last_name'];
+        unset($profileFields['first_name']);
+        unset($profileFields['last_name']);
+        if (array_key_exists('suffix_id', $params)) {
+          $honorName .= ' ' . CRM_Utils_Array::value(CRM_Utils_Array::value('suffix_id', $params),
               CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id')
             );
-            unset($profileFields['suffix_id']);
-          }
-          break;
-        case 'Organization':
-          $honorName = $params['organization_name'];
-          unset($profileFields['organization_name']);
-          break;
-        case 'Household':
-          $honorName = $params['household_name'];
-          unset($profileFields['household_name']);
-          break;
+          unset($profileFields['suffix_id']);
+        }
+        break;
+
+      case 'Organization':
+        $honorName = $params['organization_name'];
+        unset($profileFields['organization_name']);
+        break;
+
+      case 'Household':
+        $honorName = $params['household_name'];
+        unset($profileFields['household_name']);
+        break;
     }
 
     if ($honorId) {
index 990ac820a8ab01c5ad4ddf70ef046bedbe040739..1c567fc505eea9fde3af51302d4897af35166464 100644 (file)
@@ -89,7 +89,7 @@ class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_DAO_Product {
   }
 
   /**
-     * add the financial types
+   * add the financial types
    *
    * @param array $params
    *   Reference array contains the values submitted by the form.
@@ -148,7 +148,7 @@ class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_DAO_Product {
       return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/contribute/managePremiums', 'reset=1&action=browse'));
     }
 
-        //delete from financial Type table
+    //delete from financial Type table
     $premium = new CRM_Contribute_DAO_Product();
     $premium->id = $productID;
     $premium->delete();
index e2e5d837eabb53914a33f0642ac0ddde317e7eac..5839377d7c0c97597bb80bef3eff828105737523 100644 (file)
@@ -94,7 +94,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium {
   public static function del($premiumID) {
     //check dependencies
 
-        //delete from financial Type table
+    //delete from financial Type table
     $premium = new CRM_Contribute_DAO_Premium();
     $premium->id = $premiumID;
     $premium->delete();
index 1b97fa906b53b09fe579dbeb07b36e803a469ea5..b8a4dee7fd7d15eb020c76735ab4526054cea4d1 100644 (file)
@@ -61,7 +61,7 @@ class CRM_Contribute_Form extends CRM_Admin_Form {
     }
     elseif ($this->_action == CRM_Core_Action::ADD) {
       $condition = " AND is_default = 1";
-      $values = CRM_Core_OptionGroup::values('financial_account_type', false, false, false, $condition);
+      $values = CRM_Core_OptionGroup::values('financial_account_type', FALSE, FALSE, FALSE, $condition);
       $defaults['financial_account_type_id'] = array_keys($values);
       $defaults['is_active'] = 1;
 
index 5bdaa227b665f1c75270148447ba8ece6b1cb930..0c8d042bd14486ff98d1892d84f95996235fbc55 100644 (file)
@@ -40,7 +40,7 @@
 class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_ContributionBase {
 
   /**
-   *Define default MembershipType Id
+   * Define default MembershipType Id
    *
    */
   public $_defaultMemTypeId;
@@ -519,7 +519,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       CRM_Contact_Form_ProfileContact::buildQuickForm($this);
     }
 
-
     //don't build pledge block when mid is passed
     if (!$this->_mid) {
       $config = CRM_Core_Config::singleton();
@@ -682,7 +681,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
 
     // CRM 10860, display text instead of a dropdown if there's only 1 frequency unit
     if(sizeof($unitVals) == 1) {
-      $form->assign('one_frequency_unit', true);
+      $form->assign('one_frequency_unit', TRUE);
       $unit = $unitVals[0];
       $form->add('hidden', 'frequency_unit', $unit);
       if (!empty($form->_values['is_recur_interval']) || $className == 'CRM_Contribute_Form_Contribution') {
@@ -690,7 +689,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       }
       $form->assign('frequency_unit', $unit);
     } else {
-      $form->assign('one_frequency_unit', false);
+      $form->assign('one_frequency_unit', FALSE);
       $units = array();
       $frequencyUnits = CRM_Core_OptionGroup::values('recur_frequency_units');
       foreach ($unitVals as $key => $val) {
@@ -704,7 +703,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       $frequencyUnit = &$form->add('select', 'frequency_unit', NULL, $units);
     }
 
-
     // FIXME: Ideally we should freeze select box if there is only
     // one option but looks there is some problem /w QF freeze.
     //if ( count( $units ) == 1 ) {
@@ -1230,7 +1228,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config');
       if ($is_quick_config) {
         foreach ($this->_priceSet['fields'] as $fieldKey => $fieldVal) {
-          if ($fieldVal['name'] == 'membership_amount' && !empty($params['price_' . $fieldKey ])) {
+          if ($fieldVal['name'] == 'membership_amount' && !empty($params['price_' . $fieldKey])) {
             $fieldId     = $fieldVal['id'];
             $fieldOption = $params['price_' . $fieldId];
             $proceFieldAmount += $fieldVal['options'][$this->_submitValues['price_' . $fieldId]]['amount'];
@@ -1252,7 +1250,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
         }
       }
     }
-  
+
     if (!isset($params['amount_other'])) {
       $this->set('amount_level', CRM_Utils_Array::value('amount_level', $params));
     }
@@ -1261,7 +1259,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       $lineItem = array();
       $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config' );
       if ( $is_quick_config ) {
-        foreach ( $this->_values['fee'] as $key => & $val ) {  
+        foreach ( $this->_values['fee'] as $key => & $val ) {
           if ( $val['name'] == 'other_amount' && $val['html_type'] == 'Text' && array_key_exists( 'price_'.$key, $params )  ) {
             $params['price_'.$key] = CRM_Utils_Rule::cleanMoney($params['price_'.$key]); //Clean out any currency symbols
             if ( $params['price_'.$key] != 0 ) {
@@ -1378,7 +1376,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       // redirect to thank you page
       CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/transact', "_qf_ThankYou_display=1&qfKey=$qfKey", TRUE, NULL, FALSE));
     }
-   
+
   }
 
   /**
index 8b3b6564d4708118828babb85ecfb2d650f3df19..05523c1a6c3252fdfa85c3a74a38c702eb4c2f85 100644 (file)
@@ -116,7 +116,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
     $this->assign('useForMember', $this->get('useForMember'));
 
     $params = $this->_params;
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings');
+    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     if ($invoicing) {
       $getTaxDetails = FALSE;
@@ -135,7 +135,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
       $this->assign('totalTaxAmount', $params['tax_amount']);
     }
     if ($this->_honor_block_is_active && !empty($params['soft_credit_type_id'])) {
-      $honorName = null;
+      $honorName = NULL;
       $softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
 
       $this->assign('honor_block_is_active', $this->_honor_block_is_active);
@@ -160,7 +160,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont
       }
     }
 
-    $this->assign( 'qParams' , $qParams );
+    $this->assign( 'qParams', $qParams );
 
     if ($membershipTypeID) {
       $transactionID    = $this->get('membership_trx_id');
index 31919c8314ace3f28778b55b2ee8c41447f6a38d..7df238d58ab4fae256f7a82896d9d69d379691a6 100644 (file)
@@ -176,11 +176,11 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
 
   public $_action;
 
- /**
-   * Is honor block is enabled for this contribution?
-   *
-   * @var boolean
-   */
 /**
+  * Is honor block is enabled for this contribution?
+  *
+  * @var boolean
+  */
   public $_honor_block_is_active = FALSE;
 
   /**
index fa54c5f8bb759683b34ef703e625c495e9418c24..68af8adf4dc7102d92852c0ca386906ef1dc8043 100644 (file)
@@ -87,7 +87,7 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form {
         krsort($this->_years);
       }
       foreach ($this->_years as $k => $v) {
-        $years[substr($k,0,4)] = substr($k,0,4);
+        $years[substr($k, 0, 4)] = substr($k, 0, 4);
       }
     }
 
@@ -172,9 +172,9 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form {
       if ($chartKey == 'by_year') {
         $yearlyChart = TRUE;
         if (!empty($config->fiscalYearStart) && ($config->fiscalYearStart['M'] !== 1 || $config->fiscalYearStart['d'] !== 1)) {
-          $values['xLabelAngle'] = 45 ;
+          $values['xLabelAngle'] = 45;
         } else {
-          $values['xLabelAngle'] = 0 ;
+          $values['xLabelAngle'] = 0;
         }
       }
       if ($chartKey == 'by_month') {
@@ -199,12 +199,12 @@ class CRM_Contribute_Form_ContributionCharts extends CRM_Core_Form {
         }
         elseif ($chartKey == 'by_year') {
           if (!empty($config->fiscalYearStart) && ($config->fiscalYearStart['M'] != 1 || $config->fiscalYearStart['d'] != 1)) {
-            $startDate = date('Ymd', mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], substr($index,0,4)));
-            $endDate   = date('Ymd', mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], (substr($index,0,4)) + 1));
+            $startDate = date('Ymd', mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], substr($index, 0, 4)));
+            $endDate   = date('Ymd', mktime(0, 0, 0, $config->fiscalYearStart['M'], $config->fiscalYearStart['d'], (substr($index, 0, 4)) + 1));
           }
           else {
-            $startDate = CRM_Utils_Date::format(array('Y' => substr($index,0,4)));
-            $endDate   = date('Ymd', mktime(0, 0, 0, 13, 0, substr($index,0,4)));
+            $startDate = CRM_Utils_Date::format(array('Y' => substr($index, 0, 4)));
+            $endDate   = date('Ymd', mktime(0, 0, 0, 13, 0, substr($index, 0, 4)));
           }
           $urlParams = "reset=1&force=1&status=1&start={$startDate}&end={$endDate}&test=0";
         }
index 078e96f0caecd9207519adec32b5dddb66527a8f..ea742c6d63fb3420e4df16e876014760f6bd6546 100644 (file)
@@ -154,7 +154,6 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
       $this->addElement('hidden', 'cancelURL', $this->_cancelURL);
     }
 
-
     if ($this->_single) {
       $this->addButtons(array(
           array(
@@ -368,7 +367,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form {
         case 'Contribute':
           $attributes  = $this->getVar('_attributes');
           $subPage     = strtolower(basename(CRM_Utils_Array::value('action', $attributes)));
-          $subPageName = ucFirst($subPage);
+          $subPageName = ucfirst($subPage);
           if ($subPage == 'friend') {
             $nextPage = 'custom';
           }
index 0238893e9b4adad14a8e695385f0d4cdbec68aa3..f63547aa2141ec37c429befbafe21ad20ca47984 100644 (file)
@@ -82,7 +82,7 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
       $dao->id = $this->_pid;
       $dao->find(TRUE);
       $defaults['product_id'] = $dao->product_id;
-            $defaults['financial_type_id']   = $dao->financial_type_id;
+      $defaults['financial_type_id']   = $dao->financial_type_id;
       $defaults['weight'] = $dao->weight;
     } else {
       $dao = new CRM_Contribute_DAO_Product();
@@ -172,9 +172,9 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
     CRM_Core_PseudoConstant::populate(
       $premiumFinancialType,
       'CRM_Financial_DAO_EntityFinancialAccount',
-      $all = True,
+      $all = TRUE,
       $retrieve = 'entity_id',
-      $filter = null,
+      $filter = NULL,
       'account_relationship = 8'
     );
 
@@ -182,15 +182,16 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
     CRM_Core_PseudoConstant::populate(
       $costFinancialType,
       'CRM_Financial_DAO_EntityFinancialAccount',
-      $all = True,
+      $all = TRUE,
       $retrieve = 'entity_id',
-      $filter = null,
+      $filter = NULL,
       'account_relationship = 7'
     );
     $productFinancialType = array_intersect($costFinancialType, $premiumFinancialType);
     foreach( $financialType as $key => $financialTypeName ){
-      if(!in_array( $key, $productFinancialType))
+      if(!in_array( $key, $productFinancialType)) {
         unset( $financialType[$key] );
+      }
     }
     if( count( $financialType ) ){
       $this->assign( 'financialType', $financialType );
@@ -199,7 +200,7 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
       'select',
       'financial_type_id',
       ts( 'Financial Type' ),
-      array(''=>ts('- select -')) + $financialType
+      array('' => ts('- select -')) + $financialType
     );
     $this->addRule('weight', ts('Please enter integer value for weight'), 'integer');
     $session->pushUserContext(CRM_Utils_System::url($urlParams, 'action=update&reset=1&id=' . $this->_id));
index 76d74b36c4d3e11533a2c09c24324c12756e4061..93091297a582ccee4d6045ffc45ec1be693093fa 100644 (file)
@@ -117,7 +117,6 @@ SELECT id
       array('&nbsp;&nbsp;', '&nbsp;&nbsp;', '&nbsp;&nbsp;', '<br/>')
     );
 
-
     //check if selected payment processor supports recurring payment
     if (!empty($recurringPaymentProcessor)) {
       $this->addElement('checkbox', 'is_recur', ts('Recurring Contributions'), NULL,
@@ -390,7 +389,7 @@ SELECT id
           $paymentProcessorID,
           'payment_processor_type_id'
         );
-        $paymentProcessorType = CRM_Core_PseudoConstant::paymentProcessorType(false, $paymentProcessorTypeId, 'name');
+        $paymentProcessorType = CRM_Core_PseudoConstant::paymentProcessorType(FALSE, $paymentProcessorTypeId, 'name');
         if ($paymentProcessorType == 'Google_Checkout') {
           $errors['is_recur_interval'] = ts('Google Checkout does not support recurring intervals');
           break;
@@ -527,7 +526,8 @@ SELECT id
             if (isset($values[$i]) &&
               (strlen(trim($values[$i])) > 0)
             ) {
-              $options[] = array('label' => trim($labels[$i]),
+              $options[] = array(
+              'label' => trim($labels[$i]),
                 'value' => CRM_Utils_Rule::cleanMoney(trim($values[$i])),
                 'weight' => $i,
                 'is_active' => 1,
@@ -535,7 +535,7 @@ SELECT id
               );
             }
           }
-            /* || !empty($params['price_field_value']) || CRM_Utils_Array::value( 'price_field_other', $params )*/
+          /* || !empty($params['price_field_value']) || CRM_Utils_Array::value( 'price_field_other', $params )*/
           if (!empty($options) || !empty($params['is_allow_other_amount'])) {
             $fieldParams['is_quick_config'] = 1;
             $noContriAmount = NULL;
@@ -550,7 +550,7 @@ SELECT id
                 $setParams['name'] = $pageTitle . '_' . $this->_id;
               }
               else {
-                $timeSec = explode(".", microtime(true));
+                $timeSec = explode(".", microtime(TRUE));
                 $setParams['name'] = $pageTitle . '_' . date('is', $timeSec[0]) . $timeSec[1];
               }
               $setParams['is_quick_config'] = 1;
@@ -579,7 +579,8 @@ SELECT id
                   CRM_Price_BAO_PriceField::setIsActive($priceFieldId, '0');
                 }
               }
-              else $priceFieldId = CRM_Utils_Array::value('price_field_other', $params);
+              else { $priceFieldId = CRM_Utils_Array::value('price_field_other', $params);
+              }
               $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $priceFieldId, 'price_set_id');
             }
             CRM_Price_BAO_PriceSet::addTo('civicrm_contribution_page', $this->_id, $priceSetId);
@@ -742,10 +743,10 @@ SELECT id
       }
 
       if ($deleteAmountBlk ) {
-        $priceField = !empty($params['price_field_id']) ?$params['price_field_id']:CRM_Utils_Array::value('price_field_other', $params);
+        $priceField = !empty($params['price_field_id']) ? $params['price_field_id'] : CRM_Utils_Array::value('price_field_other', $params);
         if ($priceField) {
           $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', $priceField, 'price_set_id');
-          CRM_Price_BAO_PriceSet::setIsQuickConfig($priceSetID,0);
+          CRM_Price_BAO_PriceSet::setIsQuickConfig($priceSetID, 0);
         }
       }
     }
index a89c32cd30eb80cb12a5034b5bf8a137aac9737e..db41f6df36235db91e5cec07f735efbd3980611e 100644 (file)
@@ -90,7 +90,6 @@ class CRM_Contribute_Form_ContributionPage_Custom extends CRM_Contribute_Form_Co
       CRM_Utils_System::setTitle(ts('Include Profiles') . " ($title)");
     }
 
-
     $ufJoinParams = array(
       'module' => 'CiviContribute',
       'entity_table' => 'civicrm_contribution_page',
@@ -100,7 +99,6 @@ class CRM_Contribute_Form_ContributionPage_Custom extends CRM_Contribute_Form_Co
       $second) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
     $defaults['custom_post_id'] = $second ? array_shift($second) : '';
 
-
     return $defaults;
   }
 
index d057483c7a6ab91155fe21e21b2df8384224e60f..7af17b2d36d2fe65b0be17d11b149260b4bf1385 100644 (file)
@@ -85,7 +85,7 @@ class CRM_Contribute_Form_ContributionPage_Premium extends CRM_Contribute_Form_C
     // CRM-10999 Control label and position for No Thank-you radio button
     $this->add('text', 'premiums_nothankyou_label', ts('No Thank-you Label'), $attributes['premiums_nothankyou_label']);
     $positions = array(1 => ts('Before Premiums'), 2 => ts('After Premiums'));
-    $this->add('select','premiums_nothankyou_position', ts('No Thank-you Option'), $positions);
+    $this->add('select', 'premiums_nothankyou_position', ts('No Thank-you Option'), $positions);
     $showForm = TRUE;
 
     if ($this->_single) {
index 630a90bdd5b4d48706e51b68d17f7443c66e23b1..8b5e7dc43662831f0c7751bce4caab564871dd78 100644 (file)
@@ -347,23 +347,22 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
         )
     );
 
-
     foreach ($ufJoinParams as $index => $ufJoinParam) {
       if (!empty($params[$index])) {
-          $ufJoinParam['weight'] = 1;
-          if ($index == 'honor_block_is_active') {
-            $ufJoinParam['is_active'] = 1;
-            $ufJoinParam['module'] = 'soft_credit';
-            $ufJoinParam['uf_group_id'] = $params['honoree_profile'];
-            $ufJoinParam['module_data'] = $sctJSON;
-          }
-          else {
-            // first delete all past entries
-            CRM_Core_BAO_UFJoin::deleteAll($ufJoinParam);
-            $ufJoinParam['uf_group_id'] = $params[$index];
-          }
-            CRM_Core_BAO_UFJoin::create($ufJoinParam);
+        $ufJoinParam['weight'] = 1;
+        if ($index == 'honor_block_is_active') {
+          $ufJoinParam['is_active'] = 1;
+          $ufJoinParam['module'] = 'soft_credit';
+          $ufJoinParam['uf_group_id'] = $params['honoree_profile'];
+          $ufJoinParam['module_data'] = $sctJSON;
+        }
+        else {
+          // first delete all past entries
+          CRM_Core_BAO_UFJoin::deleteAll($ufJoinParam);
+          $ufJoinParam['uf_group_id'] = $params[$index];
         }
+        CRM_Core_BAO_UFJoin::create($ufJoinParam);
+      }
       elseif ($index == 'honor_block_is_active') {
         //On subsequent honor_block_is_active uncheck, disable(don't delete)
         //that particular honoree profile entry in UFjoin table, CRM-13981
index 637dacbe68220fb815a78b1c0ddb1f9b862cc6dc..d0398713f3ec51dbd6e978f3632259ee31adc0fe 100644 (file)
@@ -51,7 +51,8 @@ class CRM_Contribute_Form_ContributionPage_TabHeader {
     $form->assign_by_ref('tabHeader', $tabs);
     CRM_Core_Resources::singleton()
       ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
-      ->addSetting(array('tabSettings' => array(
+      ->addSetting(array(
+    'tabSettings' => array(
         'active' => self::getCurrentTab($tabs),
       )));
     return $tabs;
@@ -68,55 +69,64 @@ class CRM_Contribute_Form_ContributionPage_TabHeader {
     }
 
     $tabs = array(
-      'settings' => array('title' => ts('Title'),
+      'settings' => array(
+    'title' => ts('Title'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
-      'amount' => array('title' => ts('Amounts'),
+      'amount' => array(
+    'title' => ts('Amounts'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
-      'membership' => array('title' => ts('Memberships'),
+      'membership' => array(
+    'title' => ts('Memberships'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
-      'thankyou' => array('title' => ts('Receipt'),
+      'thankyou' => array(
+    'title' => ts('Receipt'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
-      'friend' => array('title' => ts('Tell a Friend'),
+      'friend' => array(
+    'title' => ts('Tell a Friend'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
-      'custom' => array('title' => ts('Profiles'),
+      'custom' => array(
+    'title' => ts('Profiles'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
-      'premium' => array('title' => ts('Premiums'),
+      'premium' => array(
+    'title' => ts('Premiums'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
-      'widget' => array('title' => ts('Widgets'),
+      'widget' => array(
+    'title' => ts('Widgets'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
         'current' => FALSE,
       ),
-      'pcp' => array('title' => ts('Personal Campaigns'),
+      'pcp' => array(
+    'title' => ts('Personal Campaigns'),
         'link' => NULL,
         'valid' => FALSE,
         'active' => FALSE,
index 5e0204c1b1572ffa4e85be8293f7f215f9b7bfa3..27a35df7ffa9600e61e4ca150e07abd1bffa90a5 100644 (file)
@@ -63,14 +63,14 @@ class CRM_Contribute_Form_ContributionPage_ThankYou extends CRM_Contribute_Form_
     $this->add('text', 'thankyou_title', ts('Thank-you Page Title'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'thankyou_title'), TRUE);
 
     $attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'thankyou_text');
-    $attributes['click_wysiwyg'] = true;
+    $attributes['click_wysiwyg'] = TRUE;
     $this->addWysiwyg('thankyou_text', ts('Thank-you Message'), $attributes);
     // FIXME: This hack forces height of editor to 175px. Need to modify QF classes for editors to allow passing
     // explicit height and width.
     $footerAttribs = array(
       'rows' => 2,
       'cols' => 40,
-      'click_wysiwyg' => true,
+      'click_wysiwyg' => TRUE,
     );
     $this->addWysiwyg('thankyou_footer', ts('Thank-you Footer'), $footerAttribs);
 
index bff6ddcd4f26a7888ccaefcb411571f284a3f926..0080b68ccc111b2cba841a7943c420647011ab51 100644 (file)
@@ -63,7 +63,8 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co
       'title'
     );
 
-    $this->_fields = array('title' => array(ts('Title'),
+    $this->_fields = array(
+    'title' => array(ts('Title'),
         'text',
         FALSE,
         $title,
@@ -80,7 +81,8 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co
       ),
     );
 
-    $this->_colorFields = array('color_title' => array(ts('Title Text Color'),
+    $this->_colorFields = array(
+    'color_title' => array(ts('Title Text Color'),
         'text',
         FALSE,
         '#2786C2',
index 6372e0371cb7dd4daba41fff9eed8997af6e1038..425414cd9148ab1a20e7fe8aa3b0b06031b2dac6 100644 (file)
@@ -152,7 +152,7 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form {
 
     // assign values to the template
     $this->assign($values);
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings');
+    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $this->assign('invoicing', $invoicing);
     if ($invoicing && isset($values['tax_amount'])) {
index a764bc62d01b81c783283699ad5d46a265956778..fcd0c60eae038b3139874568638fecdbb9126a80 100644 (file)
@@ -122,7 +122,6 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
 
     $this->add('file', 'uploadFile', ts('Image File Name'), 'onChange="select_option();"');
 
-
     $this->add('text', 'price', ts('Market Value'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'price'), TRUE);
     $this->addRule('price', ts('Please enter the Market Value for this product.'), 'money');
 
@@ -152,9 +151,9 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
     CRM_Core_PseudoConstant::populate(
       $premiumFinancialType,
       'CRM_Financial_DAO_EntityFinancialAccount',
-      $all = True,
+      $all = TRUE,
       $retrieve = 'entity_id',
-      $filter = null,
+      $filter = NULL,
       'account_relationship = 8'
     );
 
@@ -162,15 +161,16 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
     CRM_Core_PseudoConstant::populate(
       $costFinancialType,
       'CRM_Financial_DAO_EntityFinancialAccount',
-      $all = True,
+      $all = TRUE,
       $retrieve = 'entity_id',
-      $filter = null,
+      $filter = NULL,
       'account_relationship = 7'
     );
     $productFinancialType = array_intersect($costFinancialType, $premiumFinancialType);
     foreach( $financialType as $key => $financialTypeName ){
-      if(!in_array( $key, $productFinancialType))
+      if(!in_array( $key, $productFinancialType)) {
         unset( $financialType[$key] );
+      }
     }
     if( count( $financialType ) ){
       $this->assign( 'financialType', $financialType );
@@ -179,7 +179,7 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
       'select',
       'financial_type_id',
       ts( 'Financial Type' ),
-      array(''=>ts('- select -')) + $financialType
+      array('' => ts('- select -')) + $financialType
     );
 
     $this->add('checkbox', 'is_active', ts('Enabled?'));
@@ -264,7 +264,6 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
       $errors['frequency_interval'] = ts('Please enter the Frequency Interval for this subscription or service.');
     }
 
-
     return empty($errors) ? TRUE : $errors;
   }
 
@@ -304,12 +303,12 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
           $gdSupport = CRM_Utils_System::getModuleSetting('gd', 'GD Support');
           if($gdSupport) {
             if($imageFile) {
-              $error = false;
+              $error = FALSE;
               $params['image'] = $this->_resizeImage($imageFile, "_full", 200, 200);
               $params['thumbnail'] = $this->_resizeImage($imageFile, "_thumb", 50, 50);
             }
           } else {
-            $error = true;
+            $error = TRUE;
             $params['image'] = $config->resourceBase . 'i/contribute/default_premium.jpg';
             $params['thumbnail'] = $config->resourceBase . 'i/contribute/default_premium_thumb.jpg';
           }
@@ -381,10 +380,10 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
     // save the resized image
     $fp = fopen($newFilename, 'w+');
     ob_start();
-    ImageJPEG($image);
+    imagejpeg($image);
     $image_buffer = ob_get_contents();
     ob_end_clean();
-    ImageDestroy($image);
+    imagedestroy($image);
     fwrite($fp, $image_buffer);
     rewind($fp);
     fclose($fp);
index d96afcca7e16b1f9b0247a09778619f383c79e72..69267ac13b9953ee3e1f0256c80565dd91148068 100644 (file)
@@ -163,8 +163,7 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search {
   }
 
   public function setDefaultValues() {
-    if (empty($this->_defaults
-['contribution_status'])) {
+    if (empty($this->_defaults['contribution_status'])) {
       $this->_defaults['contribution_status'][1] = 1;
     }
     return $this->_defaults;
@@ -291,7 +290,6 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search {
         }
       }
 
-
       if (!$config->groupTree) {
         $group = CRM_Utils_Array::value('group', $this->_formValues);
         if ($group && !is_array($group)) {
@@ -326,7 +324,6 @@ class CRM_Contribute_Form_Search extends CRM_Core_Form_Search {
       return;
     }
 
-
     $sortID = NULL;
     if ($this->get(CRM_Utils_Sort::SORT_ID)) {
       $sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_Utils_Sort::SORT_ID),
index e252cb929014a58b4b8229bc2ecd39647f69a7a7..666c37582b2494eed49a3fad7ab235f7ff77aca6 100644 (file)
@@ -94,7 +94,7 @@ class CRM_Contribute_Form_SoftCredit {
           $form->addGroup($honorTypes, 'soft_credit_type_id', NULL)->setAttribute('allowClear', TRUE);
         }
       }
-        return $form;
+      return $form;
     }
 
     // by default generate 5 blocks
index 4d2108d75f6bf50014e3874c215e41a3e7de3dd2..90c10e02e87b18df9c985b83e585014150de1f60 100644 (file)
@@ -122,7 +122,7 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form {
     }
     else {
       $queryParams = $form->get('queryParams');
-      $sortOrder = null;
+      $sortOrder = NULL;
       if ( $form->get( CRM_Utils_Sort::SORT_ORDER  ) ) {
         $sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER );
       }
index 55228fdc8e6eb592276e0ac6e84e0f8ae0ff4d0d..65c470afd2c8a3eede54f4590a7a3efeec0162c4 100644 (file)
@@ -136,7 +136,6 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task {
       )
     );
 
-
     $this->assign('profileTitle', $this->_title);
     $this->assign('componentIds', $this->_contributionIds);
 
index 90d2c0ab12b59dc48f52f36a68c6f40591489926..ca80ed7c115eece969ee6043cff0d323635e3285 100644 (file)
@@ -641,7 +641,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
    * @return string
    */
   static public function putFile($html) {
-    require_once("packages/dompdf/dompdf_config.inc.php");
+    require_once "packages/dompdf/dompdf_config.inc.php";
     spl_autoload_register('DOMPDF_autoload');
     $doc = new DOMPDF();
     $doc->load_html($html);
index db371182460cccfae42df5d591d812f3d62452dc..af5d4a2aa39ca0d7ff1792847468c6f553bc4c9c 100644 (file)
@@ -91,7 +91,8 @@ AND    {$this->_componentClause}";
 
     $url = CRM_Utils_System::url('civicrm/contribute/search', $urlParams);
     $breadCrumb = array(
-      array('url' => $url,
+      array(
+    'url' => $url,
         'title' => ts('Search Results'),
       ));
 
@@ -194,7 +195,6 @@ AND    {$this->_componentClause}";
       $values = array();
       $mail = $elements['baseIPN']->sendMail($input, $ids, $objects, $values, FALSE, $elements['createPdf']);
 
-
       if ($mail['html']) {
         $message[] = $mail['html'];
       }
@@ -282,9 +282,9 @@ AND    {$this->_componentClause}";
           (empty($params['override_privacy']) && !empty($values['do_not_email']))
           || CRM_Utils_Array::value('is_deceased', $values)
           || !empty($values['on_hold'])) {
-            $suppressedEmails++;
-            $pdfElements['suppressedEmails'] = $suppressedEmails;
-            $excludeContactIds[] = $values['contact_id'];
+          $suppressedEmails++;
+          $pdfElements['suppressedEmails'] = $suppressedEmails;
+          $excludeContactIds[] = $values['contact_id'];
         }
       }
     }
index 624ff8b29d08be7d8669a86e9ab728cb923353f5..d98f7eb8d925c7164925b122673eef1d622cb8a4 100644 (file)
@@ -170,30 +170,30 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
     return ($within == $total);
   }
 
- /**
-  *
-  * @param string $html_message
-  * @param array $contact
-  * @param array $contribution
-  * @param array $messageToken
-  * @param array $categories
-  * @param bool $grouped
-  *   Does this letter represent more than one contribution.
-  * @param string $separator
-  *   What is the preferred letter separator.
-  * @return string
-  */
- private static function resolveTokens($html_message, $contact, $contribution, $messageToken, $categories, $grouped, $separator) {
-   $tokenHtml = CRM_Utils_Token::replaceContactTokens($html_message, $contact, TRUE, $messageToken);
-   if($grouped) {
-     $tokenHtml = CRM_Utils_Token::replaceMultipleContributionTokens($separator, $tokenHtml, $contribution, TRUE, $messageToken);
-   }
-   else {
-     // no change to normal behaviour to avoid risk of breakage
-     $tokenHtml = CRM_Utils_Token::replaceContributionTokens($tokenHtml, $contribution, TRUE, $messageToken);
-   }
-   $tokenHtml = CRM_Utils_Token::replaceHookTokens($tokenHtml, $contact, $categories, TRUE);
-   if (defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY) {
 /**
+   *
+   * @param string $html_message
+   * @param array $contact
+   * @param array $contribution
+   * @param array $messageToken
+   * @param array $categories
+   * @param bool $grouped
+   *   Does this letter represent more than one contribution.
+   * @param string $separator
+   *   What is the preferred letter separator.
+   * @return string
+   */
 private static function resolveTokens($html_message, $contact, $contribution, $messageToken, $categories, $grouped, $separator) {
+    $tokenHtml = CRM_Utils_Token::replaceContactTokens($html_message, $contact, TRUE, $messageToken);
+    if($grouped) {
+      $tokenHtml = CRM_Utils_Token::replaceMultipleContributionTokens($separator, $tokenHtml, $contribution, TRUE, $messageToken);
+    }
+    else {
+      // no change to normal behaviour to avoid risk of breakage
+      $tokenHtml = CRM_Utils_Token::replaceContributionTokens($tokenHtml, $contribution, TRUE, $messageToken);
+    }
+    $tokenHtml = CRM_Utils_Token::replaceHookTokens($tokenHtml, $contact, $categories, TRUE);
+    if (defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY) {
       $smarty = CRM_Core_Smarty::singleton();
       // also add the tokens to the template
       $smarty->assign_by_ref('contact', $contact);
@@ -237,9 +237,9 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF
         //@todo find out why this happens & add comments
         list($contactID) = explode('-', $item);
         $contactID = (int) $contactID;
-       }
+      }
       else {
-         $contactID = $contribution['contact_id'];
+        $contactID = $contribution['contact_id'];
       }
       if(!isset($contacts[$contactID])) {
         list($contact) = CRM_Utils_Token::getTokenDetails(array('contact_id' => $contactID),
index e2a8fb249aa11ca0d977149b5ff66da875229439..13d8df14cc0976d1f7eb4d27bd01df4819e5d4d7 100644 (file)
@@ -45,7 +45,8 @@ class CRM_Contribute_Form_Task_Result extends CRM_Contribute_Form_Task {
    *
    * @return void
    */
-  public function preProcess() {}
+  public function preProcess() {
+  }
 
   /**
    * Build the form object
index d6c68770a18624a433c2753574af5ad357ef62ea..ee4321dc0ef3dd45f11845c3165cf09214a19233 100644 (file)
@@ -141,7 +141,6 @@ AND    co.id IN ( $contribIDs )";
         array('CRM_Contribute_DAO_Contribution', $dao->contribution_id, 'trxn_id')
       );
 
-
       $row['fee_amount'] = &$this->add('text', "fee_amount_{$row['contribution_id']}", ts('Fee Amount'),
         $attributes['fee_amount']
       );
index d256d59827a10cbe037c8d8c5fb06e6e47b036d4..535b5fd75cbfe8fe89c80dc548a8edec14f7aae2 100644 (file)
@@ -165,10 +165,10 @@ class CRM_Contribute_Import_Field {
       case 'currency':
         return CRM_Utils_Rule::currencyCode($this->_value);
 
-        case 'financial_type':
+      case 'financial_type':
         static $contributionTypes = NULL;
         if (!$contributionTypes) {
-                $contributionTypes = CRM_Contribute_PseudoConstant::financialType();
+          $contributionTypes = CRM_Contribute_PseudoConstant::financialType();
         }
         if (in_array($this->_value, $contributionTypes)) {
           return TRUE;
@@ -176,7 +176,7 @@ class CRM_Contribute_Import_Field {
         else {
           return FALSE;
         }
-        break;
+          break;
 
       case 'payment_instrument':
         static $paymentInstruments = NULL;
index c4d92a95fcc9be9e740ce5849d876f0c979dcc42..516708f6ba6bdfbb49763a8f09d23797bec99243 100644 (file)
@@ -289,11 +289,11 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
           );
         }
         if(!empty($mapperKeysValues) && $mapperKeysValues[$i][0] == 'soft_credit') {
-          $js .="cj('#mapper_".$i."_1').val($mapperKeysValues[$i][1]);\n";
-          $js .="cj('#mapper_".$i."_2').val($mapperKeysValues[$i][2]);\n";
+          $js .= "cj('#mapper_".$i."_1').val($mapperKeysValues[$i][1]);\n";
+          $js .= "cj('#mapper_".$i."_2').val($mapperKeysValues[$i][2]);\n";
         }
       }
-      $sel->setOptions(array($sel1, $sel2, $sel3,$sel4));
+      $sel->setOptions(array($sel1, $sel2, $sel3, $sel4));
     }
     $js .= "</script>\n";
     $this->assign('initHideBoxes', $js);
@@ -500,7 +500,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
 
       if (isset($mapperKeys[$i][0]) && $mapperKeys[$i][0] == 'soft_credit') {
         $mapperSoftCredit[$i] = $mapperKeys[$i][1];
-        if (strpos($mapperSoftCredit[$i], '_') !== false) {
+        if (strpos($mapperSoftCredit[$i], '_') !== FALSE) {
           list($first, $second) = explode('_', $mapperSoftCredit[$i]);
           $softCreditFields[$i] = ucwords($first . " " . $second);
         }
@@ -513,7 +513,7 @@ class CRM_Contribute_Import_Form_MapField extends CRM_Import_Form_MapField {
         );
       }
       else {
-        $mapperSoftCredit[$i] = $softCreditFields[$i] =  $mapperSoftCreditType[$i] = NULL;
+        $mapperSoftCredit[$i] = $softCreditFields[$i] = $mapperSoftCreditType[$i] = NULL;
       }
     }
 
index 5c3d8ff761c019ff2f0fe05693bf614872ccad30..1877a10c18533a84d0d232e429e84229e57f31a2 100644 (file)
@@ -134,7 +134,7 @@ class CRM_Contribute_Import_Form_Preview extends CRM_Import_Form_Preview {
         $mapperSoftCreditType[$key] = $mapperSoftCreditType[$key]['value'];
       }
       else {
-        $mapperSoftCredit[$key] = $mapperSoftCreditType[$key] =  NULL;
+        $mapperSoftCredit[$key] = $mapperSoftCreditType[$key] = NULL;
       }
     }
 
index 88e57343aa2bb30176608d7fd8db3679c40fd36c..caa1eeb256b107162b9f600ecabf759d197a92fc 100644 (file)
@@ -118,7 +118,8 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    * @return array|null
    */
   public function getUserDashboardElement() {
-    return array('name' => ts('Contributions'),
+    return array(
+    'name' => ts('Contributions'),
       'title' => ts('Your Contribution(s)'),
       'perm' => array('make online contributions'),
       'weight' => 10,
@@ -138,7 +139,8 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info {
    * @return array|null
    */
   public function registerTab() {
-    return array('title' => ts('Contributions'),
+    return array(
+    'title' => ts('Contributions'),
       'url' => 'contribution',
       'weight' => 20,
     );
index 1d891c9c025c1798121f43527d5c661478434cd6..ae80cd90df544c092958e64ca430826685cc3a60 100644 (file)
@@ -288,7 +288,8 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page {
     );
 
     // set breadcrumb to append to 2nd layer pages
-    $breadCrumb = array(array('title' => ts('Manage Contribution Pages'),
+    $breadCrumb = array(array(
+    'title' => ts('Manage Contribution Pages'),
         'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(),
           'reset=1'
         ),
@@ -471,15 +472,15 @@ ORDER BY title asc
       $action += array_sum(array_keys(self::contributionLinks()));
 
       if ($dao->is_active) {
-        $action -= (int)CRM_Core_Action::ENABLE;
+        $action -= (int) CRM_Core_Action::ENABLE;
       }
       else {
-        $action -= (int)CRM_Core_Action::DISABLE;
+        $action -= (int) CRM_Core_Action::DISABLE;
       }
 
       //CRM-4418
       if (!$allowToDelete) {
-        $action -= (int)CRM_Core_Action::DELETE;
+        $action -= (int) CRM_Core_Action::DELETE;
       }
 
       //build the configure links.
@@ -537,8 +538,7 @@ ORDER BY title asc
   }
 
   public function search() {
-    if (isset($this->_action) &
-      (CRM_Core_Action::ADD |
+    if (isset($this->_action) & (CRM_Core_Action::ADD |
         CRM_Core_Action::UPDATE |
         CRM_Core_Action::DELETE
       )
@@ -627,8 +627,8 @@ ORDER BY title asc
     // The unfiltered value from the session cannot be trusted, it needs to be
     // processed to get a clean array of positive integers.
     $ids = array();
-    foreach ((array)$this->get('campaign_id') as $id) {
-      if ((string)(int)$id === (string)$id && $id > 0) {
+    foreach ((array) $this->get('campaign_id') as $id) {
+      if ((string) (int) $id === (string) $id && $id > 0) {
         $ids[] = $id;
       }
     }
index 9c599fa929f6e1a5f80341c6cffe0bc000deab79..ac7a93c5a780a2ac1e42cc14018f04c9fcfe456e 100644 (file)
@@ -153,7 +153,6 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
       // form all action links
       $action = array_sum(array_keys($this->links()));
 
-
       if ($dao->is_active) {
         $action -= CRM_Core_Action::ENABLE;
       }
@@ -170,12 +169,12 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
         'Premium',
         $dao->id
       );
-           //Financial Type
-                if( !empty( $dao->financial_type_id )  ){
-                    require_once 'CRM/Core/DAO.php';
-                    $premiums[$dao->id]['financial_type_id'] = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_FinancialType', $dao->financial_type_id, 'name' );
+      //Financial Type
+      if( !empty( $dao->financial_type_id )  ){
+        require_once 'CRM/Core/DAO.php';
+        $premiums[$dao->id]['financial_type_id'] = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_FinancialType', $dao->financial_type_id, 'name' );
+      }
     }
-        }
     $this->assign('rows', $premiums);
   }
 
index f1aea8c81881001bf4cb3af3d7795be64ac910b2..95cec3c57ea169a6c5f2d96d66d8a3cb0acd9977 100644 (file)
@@ -37,8 +37,8 @@ class CRM_Contribute_Page_PaymentInfo extends CRM_Core_Page {
     $this->_component = CRM_Utils_Request::retrieve('component', 'String', $this, TRUE);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
     $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
-    $this->_context =  CRM_Utils_Request::retrieve('context', 'String', $this, TRUE);
-    $this->_cid =  CRM_Utils_Request::retrieve('cid', 'String', $this, TRUE);
+    $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, TRUE);
+    $this->_cid = CRM_Utils_Request::retrieve('cid', 'String', $this, TRUE);
 
     $this->assign('cid', $this->_cid);
     $this->assign('id', $this->_id);
index 11855ff884c4ecface0c36cdc0c7dd5d83c5da45..98bdd061807ac438f2755060ebce73457fdbed3d 100644 (file)
@@ -42,10 +42,10 @@ class CRM_Contribute_Page_SubscriptionStatus extends CRM_Core_Page {
    * return null
    */
   public function run() {
-    $task    = CRM_Utils_Request::retrieve('task', 'String',   CRM_Core_DAO::$_nullObject);
-    $result  = CRM_Utils_Request::retrieve('result', 'Integer',  CRM_Core_DAO::$_nullObject);
+    $task    = CRM_Utils_Request::retrieve('task', 'String', CRM_Core_DAO::$_nullObject);
+    $result  = CRM_Utils_Request::retrieve('result', 'Integer', CRM_Core_DAO::$_nullObject);
 
-    $this->assign('task',   $task);
+    $this->assign('task', $task);
     $this->assign('result', $result);
 
     if ( $task == 'billing' ) {
index 2f6b09402d28a80a4a96d032e0961894d5d729f1..657f09441bbaa9763e73934b7596273c1c5777c4 100644 (file)
@@ -89,7 +89,8 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
         self::$_links[CRM_Core_Action::DISABLE]['qs'] = "reset=1&crid=%%crid%%&cid=%%cid%%&context={$context}";
       }
       if (is_object( $paymentProcessorObj) && $paymentProcessorObj->isSupported('updateSubscriptionBillingInfo')) {
-        self::$_links[CRM_Core_Action::RENEW] = array('name' => ts('Change Billing Details'),
+        self::$_links[CRM_Core_Action::RENEW] = array(
+        'name' => ts('Change Billing Details'),
           'title' => ts('Change Billing Details'),
           'url' => 'civicrm/contribute/updatebilling',
           'qs' => "reset=1&crid=%%crid%%&cid=%%cid%%&context={$context}",
index ffcd0969a0faac33237b171e29517e74adf93159..e83fd6dc669ebc1c69e2d560bf41eeeaf6e6b949 100644 (file)
@@ -65,7 +65,6 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo
       $this->assign('honor', TRUE);
     }
 
-
     $recur             = new CRM_Contribute_DAO_ContributionRecur();
     $recur->contact_id = $this->_contactId;
     $recur->is_test    = 0;
@@ -150,7 +149,7 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo
    * return null
    */
   public function run() {
-    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings');
+    $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
     $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
     $this->assign('invoicing', $invoicing);
     parent::preProcess();
index d75461b9286dc58d1f04b8e5caf3f5076867a55f..3e6420392205246066597d45d036a31c7cf13f8e 100644 (file)
@@ -61,11 +61,11 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
    */
   private static $financialAccount;
 
-    /**
-   * Contribution pages
-   * @var array
-   * @static
-   */
+  /**
+     * Contribution pages
+     * @var array
+     * @static
+     */
   private static $contributionPageActive = NULL;
 
   /**
@@ -158,7 +158,7 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
    * @static
    */
   public static function &financialAccount($id = NULL, $financialAccountTypeId = NULL, $retrieveColumn = 'name', $key = 'id') {
-    $condition = NUll;
+    $condition = NULL;
     if ($financialAccountTypeId) {
       $condition = " financial_account_type_id = ". $financialAccountTypeId;
     }
@@ -192,9 +192,9 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
    * @param bool|string $name pseudoconstant to be flushed
    */
   public static function flush($name = 'cache') {
-   if (isset(self::$$name)) {
+    if (isset(self::$$name)) {
       self::$$name = NULL;
-    }
+   }
   }
 
   /**
@@ -407,7 +407,7 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
       CRM_Core_PseudoConstant::populate(
         self::$financialTypeAccount[$financialTypeId],
         'CRM_Financial_DAO_EntityFinancialAccount',
-        $all = true,
+        $all = TRUE,
         $retrieve = 'financial_account_id',
         $filter = NULL,
         $condition,
index 28728157d13df19b8c144b9cc327048447cea8ff..7ed80e6d57b73c8028e28b1052693bd0fa7e3e94 100644 (file)
@@ -168,12 +168,12 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
   @access public
    */
   function __construct(&$queryParams,
-    $action             = CRM_Core_Action::NONE,
+    $action = CRM_Core_Action::NONE,
     $contributionClause = NULL,
-    $single             = FALSE,
-    $limit              = NULL,
-    $context            = 'search',
-    $compContext        = NULL
+    $single = FALSE,
+    $limit = NULL,
+    $context = 'search',
+    $compContext = NULL
   ) {
 
     // submitted form values
@@ -359,7 +359,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
     //get all campaigns.
     $allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE);
 
-    While ($result->fetch()) {
+    while ($result->fetch()) {
       $row = array();
       // the columns we are interested in
       foreach (self::$_properties as $property) {
@@ -410,8 +410,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C
         $result->contribution_id
       );
 
-      $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ?
-          $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id
+      $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id
       );
 
       if (!empty($row['amount_level'])) {
index d48f91d45c3b9ccaba86d2064881033457f1c8c4..6f997a815e750064fd0e5470c1d49d676718ae79 100644 (file)
@@ -126,7 +126,7 @@ class CRM_Contribute_Task {
       }
       //CRM-12920 - check for edit permission
       if( !CRM_Core_Permission::check('edit contributions') ){
-        unset(self::$_tasks[4],self::$_tasks[6]);
+        unset(self::$_tasks[4], self::$_tasks[6]);
       }
 
       // remove action "Print or Email Contribution Invoices"