From eea16664e61dfae50aeeb5a61cd99cee42776341 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 3 Jun 2013 15:28:50 +1200 Subject: [PATCH] preliminary whitespace cleanup --- CRM/Admin/Form/OptionValue.php | 6 +++--- CRM/Contribute/Form/AbstractEditPayment.php | 4 ++-- CRM/Contribute/Form/Contribution.php | 4 ++-- CRM/Contribute/Form/Contribution/ThankYou.php | 2 +- CRM/Contribute/Form/ContributionView.php | 8 ++++---- CRM/Contribute/Form/UpdateBilling.php | 10 +++++----- CRM/Custom/Page/Field.php | 2 +- CRM/Custom/Page/Group.php | 2 +- CRM/Event/BAO/Event.php | 2 +- CRM/Financial/Form/FinancialType.php | 4 ++-- CRM/Logging/ReportSummary.php | 14 +++++++------- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/CRM/Admin/Form/OptionValue.php b/CRM/Admin/Form/OptionValue.php index 9cd7e54a4f..aaa9818b80 100644 --- a/CRM/Admin/Form/OptionValue.php +++ b/CRM/Admin/Form/OptionValue.php @@ -95,7 +95,7 @@ class CRM_Admin_Form_OptionValue extends CRM_Admin_Form { $dao->fetch(); $defaults['weight'] = ($dao->weight + 1); } - + // CRM-11516 if ($this->_gName == 'payment_instrument' && $this->_id) { $defaults['financial_account_id'] = CRM_Financial_BAO_FinancialTypeAccount::getFinancialAccount($this->_id, 'civicrm_option_value', 'financial_account_id'); @@ -164,8 +164,8 @@ class CRM_Admin_Form_OptionValue extends CRM_Admin_Form { if ($this->_gName == 'payment_instrument') { $accountType = CRM_Core_PseudoConstant::accountOptionValues('financial_account_type', NULL, " AND v.name = 'Asset' "); $financialAccount = CRM_Contribute_PseudoConstant::financialAccount(NULL, key($accountType)); - - $this->add('select', 'financial_account_id', ts('Financial Account'), + + $this->add('select', 'financial_account_id', ts('Financial Account'), array('' => ts('- select -')) + $financialAccount ); } diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index c7aa8954d0..7cf82585f5 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -167,12 +167,12 @@ class CRM_Contribute_Form_AbstractEditPayment extends CRM_Core_Form { if (CRM_Utils_Array::value('financialTrxnId', $fids)) { $this->_online = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $fids['financialTrxnId'], 'payment_processor_id'); } - + // Also don't allow user to update some fields for recurring contributions. if (!$this->_online) { $this->_online = CRM_Utils_Array::value('contribution_recur_id', $values); } - + $this->assign('isOnline', $this->_online ? TRUE : FALSE); //unset the honor type id:when delete the honor_contact_id diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 38152e65f3..fa60badbba 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -1379,12 +1379,12 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP unset($submittedValues[$key]); } } - + // CRM-12680 set $_lineItem if its not set if (empty($this->_lineItem) && !empty($lineItem)) { $this->_lineItem = $lineItem; } - + //Get the rquire fields value only. $params = $this->_params = $submittedValues; diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index ae70d52a4c..d1483a6c5a 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -254,7 +254,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont $this->_submitValues = array_merge($this->_submitValues, $defaults); $this->setDefaults($defaults); - + $values['entity_id'] = $this->_id; $values['entity_table'] = 'civicrm_contribution_page'; diff --git a/CRM/Contribute/Form/ContributionView.php b/CRM/Contribute/Form/ContributionView.php index f1fb3d2340..9f0209e6b3 100644 --- a/CRM/Contribute/Form/ContributionView.php +++ b/CRM/Contribute/Form/ContributionView.php @@ -64,12 +64,12 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form { $financialTrxnId = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($values['contribution_id'], 'DESC'); $values['to_financial_account'] = ''; if (CRM_Utils_Array::value('financialTrxnId', $financialTrxnId)) { - $values['to_financial_account_id'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $financialTrxnId['financialTrxnId'], 'to_financial_account_id'); + $values['to_financial_account_id'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $financialTrxnId['financialTrxnId'], 'to_financial_account_id'); if ($values['to_financial_account_id']) { - $values['to_financial_account'] = CRM_Contribute_PseudoConstant::financialAccount($values['to_financial_account_id']); + $values['to_financial_account'] = CRM_Contribute_PseudoConstant::financialAccount($values['to_financial_account_id']); } } - + if (CRM_Utils_Array::value('honor_contact_id', $values)) { $sql = "SELECT display_name FROM civicrm_contact WHERE id = %1"; $params = array(1 => array($values['honor_contact_id'], 'Integer')); @@ -150,7 +150,7 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form { $displayName = CRM_Contact_BAO_Contact::displayName($values['contact_id']); $this->assign('displayName', $displayName); - + // Check if this is default domain contact CRM-10482 if (CRM_Contact_BAO_Contact::checkDomainContact($values['contact_id'])) { $displayName .= ' (' . ts('default organization') . ')'; diff --git a/CRM/Contribute/Form/UpdateBilling.php b/CRM/Contribute/Form/UpdateBilling.php index 25c2bb1ec4..1aca07991a 100644 --- a/CRM/Contribute/Form/UpdateBilling.php +++ b/CRM/Contribute/Form/UpdateBilling.php @@ -64,7 +64,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form { $this->_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; @@ -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, @@ -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}")); } } diff --git a/CRM/Custom/Page/Field.php b/CRM/Custom/Page/Field.php index 34f58948a9..72d0e05baf 100644 --- a/CRM/Custom/Page/Field.php +++ b/CRM/Custom/Page/Field.php @@ -66,7 +66,7 @@ class CRM_Custom_Page_Field extends CRM_Core_Page { * * @return array array of action links that we need to display for the browse screen * @access public - */ + */ function &actionLinks() { if (!isset(self::$_actionLinks)) { $deleteExtra = ts('Are you sure you want to delete this custom data field?'); diff --git a/CRM/Custom/Page/Group.php b/CRM/Custom/Page/Group.php index 069c0b5c38..6c5c7712e4 100644 --- a/CRM/Custom/Page/Group.php +++ b/CRM/Custom/Page/Group.php @@ -57,7 +57,7 @@ class CRM_Custom_Page_Group extends CRM_Core_Page { * * @return array array of action links that we need to display for the browse screen * @access public - */ + */ function &actionLinks() { // check if variable _actionsLinks is populated if (!isset(self::$_actionLinks)) { diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index c3df182990..151f3b1dc9 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -495,7 +495,7 @@ LIMIT 0, 10 $eventSummary['events'][$dao->id]['is_subevent'] = $dao->slot_label_id; $eventSummary['events'][$dao->id]['is_pcp_enabled'] = $dao->is_pcp_enabled; $eventSummary['events'][$dao->id]['reminder'] = CRM_Core_BAO_ActionSchedule::isConfigured($dao->id, $mappingID); - + $statusTypes = CRM_Event_PseudoConstant::participantStatus(); foreach ($statusValues as $statusId => $statusValue) { if (!array_key_exists($statusId, $statusTypes)) { diff --git a/CRM/Financial/Form/FinancialType.php b/CRM/Financial/Form/FinancialType.php index 35cb50ed93..c22ae76ba3 100644 --- a/CRM/Financial/Form/FinancialType.php +++ b/CRM/Financial/Form/FinancialType.php @@ -90,7 +90,7 @@ class CRM_Financial_Form_FinancialType extends CRM_Contribute_Form { return CRM_Utils_System::redirect(CRM_Utils_System::url( 'civicrm/admin/financial/financialType', "reset=1&action=browse")); } CRM_Core_Session::setStatus(ts('Selected financial type has been deleted.')); - } + } else { $params = $ids = array( ); // store the submitted values in an array @@ -104,7 +104,7 @@ class CRM_Financial_Form_FinancialType extends CRM_Contribute_Form { if ($this->_action & CRM_Core_Action::UPDATE) { $url = CRM_Utils_System::url('civicrm/admin/financial/financialType', 'reset=1&action=browse'); CRM_Core_Session::setStatus(ts('The financial type \'%1\' has been saved.', array( 1 => $financialType->name))); - } + } else { $url = CRM_Utils_System::url('civicrm/admin/financial/financialType/accounts', 'reset=1&action=browse&aid=' . $financialType->id); $statusArray = array( diff --git a/CRM/Logging/ReportSummary.php b/CRM/Logging/ReportSummary.php index 6ab08cca6c..679e7a4ce4 100644 --- a/CRM/Logging/ReportSummary.php +++ b/CRM/Logging/ReportSummary.php @@ -65,7 +65,7 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form { 'log_civicrm_note_comment' => array( 'fk' => 'entity_id', 'table_name' => 'log_civicrm_note', - 'joins' => array('table' => 'log_civicrm_note', + 'joins' => array('table' => 'log_civicrm_note', 'join' => "entity_log_civireport.entity_id = fk_table.id AND entity_log_civireport.entity_table = 'civicrm_note'"), 'entity_table' => true, 'bracket_info' => array('table' => 'log_civicrm_note', 'column' => 'subject'), @@ -160,7 +160,7 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form { function postProcess() { $this->beginPostProcess(); $rows = array(); - + $tempColumns = "id int(10)"; if (CRM_Utils_Array::value('log_action', $this->_params['fields'])) { $tempColumns .= ", log_action varchar(64)"; @@ -241,8 +241,8 @@ ORDER BY entity_log_civireport.log_date DESC {$this->_limit}"; if (CRM_Utils_Array::value('entity_column', $this->_logTables[$entity]['bracket_info'])) { $logTable = CRM_Utils_Array::value('table_name', $this->_logTables[$entity]) ? $this->_logTables[$entity]['table_name'] : $entity; $sql = " -SELECT {$this->_logTables[$entity]['bracket_info']['entity_column']} - FROM `{$this->loggingDB}`.{$logTable} +SELECT {$this->_logTables[$entity]['bracket_info']['entity_column']} + FROM `{$this->loggingDB}`.{$logTable} WHERE log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1"; $entityID = CRM_Core_DAO::singleValueQuery($sql, array(1 => array(CRM_Utils_Date::isoToMysql($logDate), 'Timestamp'), 2 => array ($id, 'Integer'))); } else { @@ -250,15 +250,15 @@ SELECT {$this->_logTables[$entity]['bracket_info']['entity_column']} } // since case_type_id is a varchar field with separator - if ($entity == 'log_civicrm_case') { + if ($entity == 'log_civicrm_case') { $entityID = explode(CRM_Case_BAO_Case::VALUE_SEPARATOR,$entityID); $entityID = CRM_Utils_Array::value(1, $entityID); } if ($entityID && $logDate && array_key_exists('table', $this->_logTables[$entity]['bracket_info'])) { $sql = " -SELECT {$this->_logTables[$entity]['bracket_info']['column']} -FROM `{$this->loggingDB}`.{$this->_logTables[$entity]['bracket_info']['table']} +SELECT {$this->_logTables[$entity]['bracket_info']['column']} +FROM `{$this->loggingDB}`.{$this->_logTables[$entity]['bracket_info']['table']} WHERE log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1"; return CRM_Core_DAO::singleValueQuery($sql, array(1 => array(CRM_Utils_Date::isoToMysql($logDate), 'Timestamp'), 2 => array ($entityID, 'Integer'))); } else if (array_key_exists('options', $this->_logTables[$entity]['bracket_info']) && $entityID) { -- 2.25.1