From 665e5ec75651db749dee5a7a95f7657c67297761 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 3 Jun 2013 15:10:03 +1200 Subject: [PATCH] preliminary whitespace cleanup --- CRM/Contribute/BAO/Premium.php | 4 +-- CRM/Contribute/Form/Contribution/Main.php | 6 ++-- .../Form/ContributionPage/AddProduct.php | 32 +++++++++---------- .../Form/ContributionPage/Amount.php | 18 +++++------ .../Form/ContributionPage/Custom.php | 2 +- CRM/Contribute/Form/ManagePremiums.php | 30 ++++++++--------- CRM/Contribute/Form/Task.php | 2 +- CRM/Contribute/Form/Task/Batch.php | 2 +- CRM/Contribute/Form/Task/Delete.php | 2 +- CRM/Contribute/Form/Task/PDF.php | 2 +- CRM/Contribute/Form/Task/PDFLetterCommon.php | 2 +- CRM/Contribute/Form/Task/PickProfile.php | 2 +- .../Form/Task/SearchTaskHookSample.php | 8 ++--- CRM/Contribute/Form/Task/Status.php | 2 +- CRM/Contribute/Info.php | 2 +- CRM/Contribute/Page/ContributionPage.php | 2 +- 16 files changed, 59 insertions(+), 59 deletions(-) diff --git a/CRM/Contribute/BAO/Premium.php b/CRM/Contribute/BAO/Premium.php index 522fe93fbf..bf888b5c28 100644 --- a/CRM/Contribute/BAO/Premium.php +++ b/CRM/Contribute/BAO/Premium.php @@ -43,7 +43,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { /** * class constructor - */ + */ function __construct() { parent::__construct(); } @@ -86,7 +86,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { } /** - * Function to delete financial Types + * Function to delete financial Types * * @param int $contributionTypeId * @static diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 35d53b77f7..1c7b1bcbdc 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -789,7 +789,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu } // CRM-12233 - if ($membershipIsActive && !$self->_membershipBlock['is_required'] + if ($membershipIsActive && !$self->_membershipBlock['is_required'] && $self->_values['amount_block_is_active']) { $membershipFieldId = $contributionFieldId = $errorKey = $otherFieldId = NULL; foreach ($self->_values['fee'] as $fieldKey => $fieldValue) { @@ -804,7 +804,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu elseif ($fieldValue['name'] == 'contribution_amount') { $contributionFieldId = $fieldKey; } - + if (!$errorKey || CRM_Utils_Array::value('price_' . $contributionFieldId, $fields) == '0') { $errorKey = $fieldKey; } @@ -889,7 +889,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu CRM_Price_BAO_Set::processAmount($self->_values['fee'], $fields, $lineItem ); - + if ($fields['amount'] < 0) { $errors['_qf_default'] = ts('Contribution can not be less than zero. Please select the options accordingly'); } diff --git a/CRM/Contribute/Form/ContributionPage/AddProduct.php b/CRM/Contribute/Form/ContributionPage/AddProduct.php index 3a9761e848..138c5a20a9 100644 --- a/CRM/Contribute/Form/ContributionPage/AddProduct.php +++ b/CRM/Contribute/Form/ContributionPage/AddProduct.php @@ -167,28 +167,28 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For $session->pushUserContext($url); $this->add('select', 'product_id', ts('Select the Product') . ' ', $this->_products, TRUE); - + $this->addElement('text', 'weight', ts('Weight'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_PremiumsProduct', 'weight')); - + $financialType = CRM_Contribute_PseudoConstant::financialType( ); $premiumFinancialType = array(); CRM_Core_PseudoConstant::populate( $premiumFinancialType, 'CRM_Financial_DAO_EntityFinancialAccount', - $all = True, - $retrieve = 'entity_id', - $filter = null, - 'account_relationship = 8' + $all = True, + $retrieve = 'entity_id', + $filter = null, + 'account_relationship = 8' ); - + $costFinancialType = array(); CRM_Core_PseudoConstant::populate( $costFinancialType, 'CRM_Financial_DAO_EntityFinancialAccount', - $all = True, - $retrieve = 'entity_id', - $filter = null, - 'account_relationship = 7' + $all = True, + $retrieve = 'entity_id', + $filter = null, + 'account_relationship = 7' ); $productFinancialType = array_intersect($costFinancialType, $premiumFinancialType); foreach( $financialType as $key => $financialTypeName ){ @@ -197,11 +197,11 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For } if( count( $financialType ) ){ $this->assign( 'financialType', $financialType ); - } + } $this->add( - 'select', - 'financial_type_id', - ts( 'Financial Type' ), + 'select', + 'financial_type_id', + ts( 'Financial Type' ), array(''=>ts('- select -')) + $financialType ); $this->addRule('weight', ts('Please enter integer value for weight'), 'integer'); @@ -272,7 +272,7 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For if ($this->_pid) { $oldWeight = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_PremiumsProduct', $this->_pid, 'weight', 'id'); } - + // updateOtherWeights needs to filter on premiums_id $filter = array('premiums_id' => $params['premiums_id']); $params['weight'] = CRM_Utils_Weight::updateOtherWeights('CRM_Contribute_DAO_PremiumsProduct', $oldWeight, $params['weight'], $filter); diff --git a/CRM/Contribute/Form/ContributionPage/Amount.php b/CRM/Contribute/Form/ContributionPage/Amount.php index 0ed67cf757..6a4638f11e 100644 --- a/CRM/Contribute/Form/ContributionPage/Amount.php +++ b/CRM/Contribute/Form/ContributionPage/Amount.php @@ -138,7 +138,7 @@ SELECT id FALSE ); $this->addWysiwyg('pay_later_receipt', ts('Pay Later Instructions'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'pay_later_receipt')); - + //add partial payment options // add price set fields @@ -305,7 +305,7 @@ SELECT id $errors['min_amount'] = ts('Minimum Amount should be less than Maximum Amount'); } } - + if (isset($fields['is_pay_later'])) { if (empty($fields['pay_later_text'])) { $errors['pay_later_text'] = ts('Please enter the text for the \'pay later\' checkbox displayed on the contribution form.'); @@ -314,7 +314,7 @@ SELECT id $errors['pay_later_receipt'] = ts('Please enter the instructions to be sent to the contributor when they choose to \'pay later\'.'); } } - + // don't allow price set w/ membership signup, CRM-5095 if ($priceSetId = CRM_Utils_Array::value('price_set_id', $fields)) { // don't allow price set w/ membership. @@ -375,7 +375,7 @@ SELECT id } } } - + return $errors; } @@ -517,7 +517,7 @@ SELECT id $setParams['title'] = $this->_values['title']; if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $pageTitle, 'id', 'name')) { $setParams['name'] = $pageTitle; - } + } elseif (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $pageTitle . '_' . $this->_id, 'id', 'name')) { $setParams['name'] = $pageTitle . '_' . $this->_id; } @@ -600,7 +600,7 @@ SELECT id CRM_Price_BAO_Field::retrieve($editedFieldParams, $editedResults); if (!$priceFieldID = CRM_Utils_Array::value('id', $editedResults)) { - $fieldParams = array( + $fieldParams = array( 'name' => 'other_amount', 'label' => 'Other Amount', 'price_set_id' => $priceSetId, @@ -613,7 +613,7 @@ SELECT id $fieldParams['option_amount'][1] = 1; if (!$noContriAmount) { $fieldParams['is_required'] = 1; - $fieldParams['option_label'][1] = 'Contribution Amount'; + $fieldParams['option_label'][1] = 'Contribution Amount'; } else { $fieldParams['is_required'] = 0; $fieldParams['option_label'][1] = 'Other Amount'; @@ -690,8 +690,8 @@ SELECT id if ($deletePriceSet) { CRM_Price_BAO_Set::removeFrom('civicrm_contribution_page', $contributionPageID); } - - if ($deleteAmountBlk ) { + + if ($deleteAmountBlk ) { $priceField = CRM_Utils_Array::value('price_field_id', $params)?$params['price_field_id']:CRM_Utils_Array::value('price_field_other', $params); if ($priceField) { $priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Field', $priceField, 'price_set_id'); diff --git a/CRM/Contribute/Form/ContributionPage/Custom.php b/CRM/Contribute/Form/ContributionPage/Custom.php index 709a7782be..aed4ba271f 100644 --- a/CRM/Contribute/Form/ContributionPage/Custom.php +++ b/CRM/Contribute/Form/ContributionPage/Custom.php @@ -196,7 +196,7 @@ class CRM_Contribute_Form_ContributionPage_Custom extends CRM_Contribute_Form_Co if (($postProfileType == 'Membership') && !$membershipEnable) { $errors['custom_post_id'] = $errorMsg; } - + $behalf = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $contributionPageId, 'is_for_organization'); if ($fields['custom_pre_id']) { $errorMsg = ts('You should move the membership related fields in the "On Behalf" profile for this Contribution Page'); diff --git a/CRM/Contribute/Form/ManagePremiums.php b/CRM/Contribute/Form/ManagePremiums.php index a68eadbfc8..dd45fbb752 100644 --- a/CRM/Contribute/Form/ManagePremiums.php +++ b/CRM/Contribute/Form/ManagePremiums.php @@ -172,27 +172,27 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { $this->add('Select', 'frequency_unit', ts('Frequency Unit'), array('' => '- select period -', 'day' => 'Day', 'week' => 'Week', 'month' => 'Month', 'year' => 'Year')); $this->add('text', 'frequency_interval', ts('Frequency'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Product', 'frequency_interval')); - + //Financial Type CRM-11106 $financialType = CRM_Contribute_PseudoConstant::financialType( ); $premiumFinancialType = array(); CRM_Core_PseudoConstant::populate( $premiumFinancialType, 'CRM_Financial_DAO_EntityFinancialAccount', - $all = True, - $retrieve = 'entity_id', - $filter = null, - 'account_relationship = 8' + $all = True, + $retrieve = 'entity_id', + $filter = null, + 'account_relationship = 8' ); - + $costFinancialType = array(); CRM_Core_PseudoConstant::populate( $costFinancialType, 'CRM_Financial_DAO_EntityFinancialAccount', - $all = True, - $retrieve = 'entity_id', - $filter = null, - 'account_relationship = 7' + $all = True, + $retrieve = 'entity_id', + $filter = null, + 'account_relationship = 7' ); $productFinancialType = array_intersect($costFinancialType, $premiumFinancialType); foreach( $financialType as $key => $financialTypeName ){ @@ -201,14 +201,14 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form { } if( count( $financialType ) ){ $this->assign( 'financialType', $financialType ); - } + } $this->add( - 'select', - 'financial_type_id', - ts( 'Financial Type' ), + 'select', + 'financial_type_id', + ts( 'Financial Type' ), array(''=>ts('- select -')) + $financialType ); - + $this->add('checkbox', 'is_active', ts('Enabled?')); $this->addFormRule(array('CRM_Contribute_Form_ManagePremiums', 'formRule')); diff --git a/CRM/Contribute/Form/Task.php b/CRM/Contribute/Form/Task.php index 41256e4839..39d7c563dd 100644 --- a/CRM/Contribute/Form/Task.php +++ b/CRM/Contribute/Form/Task.php @@ -109,7 +109,7 @@ class CRM_Contribute_Form_Task extends CRM_Core_Form { if ( $form->get( CRM_Utils_Sort::SORT_ORDER ) ) { $sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER ); } - + $query = new CRM_Contact_BAO_Query($queryParams, NULL, NULL, FALSE, FALSE, CRM_Contact_BAO_Query::MODE_CONTRIBUTE ); diff --git a/CRM/Contribute/Form/Task/Batch.php b/CRM/Contribute/Form/Task/Batch.php index 92c90bb9de..20d4faf5c5 100644 --- a/CRM/Contribute/Form/Task/Batch.php +++ b/CRM/Contribute/Form/Task/Batch.php @@ -156,7 +156,7 @@ class CRM_Contribute_Form_Task_Batch extends CRM_Contribute_Form_Task { //fix for CRM-2752 $customFields = CRM_Core_BAO_CustomField::getFields('Contribution'); foreach ($this->_contributionIds as $contributionId) { - $typeId = CRM_Core_DAO::getFieldValue( "CRM_Contribute_DAO_Contribution", $contributionId, 'financial_type_id' ); + $typeId = CRM_Core_DAO::getFieldValue( "CRM_Contribute_DAO_Contribution", $contributionId, 'financial_type_id' ); foreach ($this->_fields as $name => $field) { if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($name)) { $customValue = CRM_Utils_Array::value($customFieldID, $customFields); diff --git a/CRM/Contribute/Form/Task/Delete.php b/CRM/Contribute/Form/Task/Delete.php index fc11524515..372c6b8913 100644 --- a/CRM/Contribute/Form/Task/Delete.php +++ b/CRM/Contribute/Form/Task/Delete.php @@ -86,7 +86,7 @@ class CRM_Contribute_Form_Task_Delete extends CRM_Contribute_Form_Task { $deletedContributions++; } } - + CRM_Core_Session::setStatus(ts('Deleted Contribution(s): %1', array(1 => $deletedContributions)), '', 'info'); CRM_Core_Session::setStatus(ts('Total Selected Contribution(s): %1', array(1 => count($this->_contributionIds))), '', 'info'); } diff --git a/CRM/Contribute/Form/Task/PDF.php b/CRM/Contribute/Form/Task/PDF.php index 56fe36533b..fdbb8e5d22 100644 --- a/CRM/Contribute/Form/Task/PDF.php +++ b/CRM/Contribute/Form/Task/PDF.php @@ -223,7 +223,7 @@ AND {$this->_componentClause}"; $input['trxn_id'] = $contribution->trxn_id; $input['trxn_date'] = isset($contribution->trxn_date) ? $contribution->trxn_date : NULL; - // CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date + // CRM_Contribute_BAO_Contribution::composeMessageArray expects mysql formatted date $objects['contribution']->receive_date = CRM_Utils_Date::isoToMysql($objects['contribution']->receive_date); // CRM_Core_Error::debug('input',$input); diff --git a/CRM/Contribute/Form/Task/PDFLetterCommon.php b/CRM/Contribute/Form/Task/PDFLetterCommon.php index 6daa42386f..28ee4f2111 100644 --- a/CRM/Contribute/Form/Task/PDFLetterCommon.php +++ b/CRM/Contribute/Form/Task/PDFLetterCommon.php @@ -107,7 +107,7 @@ class CRM_Contribute_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDF if ($updateStatus) { CRM_Core_Session::setStatus($updateStatus); } - + CRM_Utils_System::civiExit(1); } //end of function diff --git a/CRM/Contribute/Form/Task/PickProfile.php b/CRM/Contribute/Form/Task/PickProfile.php index b3ff90608b..e6c1b490f3 100644 --- a/CRM/Contribute/Form/Task/PickProfile.php +++ b/CRM/Contribute/Form/Task/PickProfile.php @@ -76,7 +76,7 @@ class CRM_Contribute_Form_Task_PickProfile extends CRM_Contribute_Form_Task { $validate = FALSE; //validations if (count($this->_contributionIds) > $this->_maxContributions) { - CRM_Core_Session::setStatus(ts("The maximum number of contributions you can select for Batch Update is %1. You have selected %2. Please select fewer contributions from your search results and try again.", array(1 => $this->_maxContributions, 2 => count($this->_contributionIds))), ts('Batch Update Error'), 'error'); + CRM_Core_Session::setStatus(ts("The maximum number of contributions you can select for Batch Update is %1. You have selected %2. Please select fewer contributions from your search results and try again.", array(1 => $this->_maxContributions, 2 => count($this->_contributionIds))), ts('Batch Update Error'), 'error'); $validate = TRUE; } diff --git a/CRM/Contribute/Form/Task/SearchTaskHookSample.php b/CRM/Contribute/Form/Task/SearchTaskHookSample.php index 98567f3d66..88515565e3 100644 --- a/CRM/Contribute/Form/Task/SearchTaskHookSample.php +++ b/CRM/Contribute/Form/Task/SearchTaskHookSample.php @@ -53,10 +53,10 @@ class CRM_Contribute_Form_Task_SearchTaskHookSample extends CRM_Contribute_Form_ $query = " SELECT co.total_amount as amount, co.receive_date as receive_date, - co.source as source, - ct.display_name as display_name - FROM civicrm_contribution co -INNER JOIN civicrm_contact ct ON ( co.contact_id = ct.id ) + co.source as source, + ct.display_name as display_name + FROM civicrm_contribution co +INNER JOIN civicrm_contact ct ON ( co.contact_id = ct.id ) WHERE co.id IN ( $contribIDs )"; $dao = CRM_Core_DAO::executeQuery($query, diff --git a/CRM/Contribute/Form/Task/Status.php b/CRM/Contribute/Form/Task/Status.php index 541ac15694..d617fa1f15 100644 --- a/CRM/Contribute/Form/Task/Status.php +++ b/CRM/Contribute/Form/Task/Status.php @@ -53,7 +53,7 @@ class CRM_Contribute_Form_Task_Status extends CRM_Contribute_Form_Task { * * @return void * @access public - */ + */ function preProcess() { $id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE diff --git a/CRM/Contribute/Info.php b/CRM/Contribute/Info.php index f1e46478c3..1cfa510826 100644 --- a/CRM/Contribute/Info.php +++ b/CRM/Contribute/Info.php @@ -110,7 +110,7 @@ class CRM_Contribute_Info extends CRM_Core_Component_Info { 'query' => "reset=1&action=add&context=standalone&mode=live", 'ref' => 'new-contribution-cc', 'title' => $title, - ))); + ))); } } } diff --git a/CRM/Contribute/Page/ContributionPage.php b/CRM/Contribute/Page/ContributionPage.php index 18f4b70eb0..8cb90d664f 100644 --- a/CRM/Contribute/Page/ContributionPage.php +++ b/CRM/Contribute/Page/ContributionPage.php @@ -339,7 +339,7 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page { ); $query = " SELECT ccp.title -FROM civicrm_contribution_page ccp +FROM civicrm_contribution_page ccp JOIN civicrm_pcp cp ON ccp.id = cp.page_id WHERE cp.page_id = {$id} AND cp.page_type = 'contribute' -- 2.25.1