Skip to content
Snippets Groups Projects
Commit cbb7c7e0 authored by eileen's avatar eileen
Browse files

preliminary whitespace cleanup

parent f55dc004
Branches
Tags
No related merge requests found
......@@ -129,7 +129,7 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn {
$condition = " AND ((ceft1.entity_table IS NOT NULL) OR (cft.payment_instrument_id IS NOT NULL AND ceft1.entity_table IS NULL)) ";
}
$query = "SELECT ceft.id, ceft.financial_trxn_id FROM `civicrm_financial_trxn` cft
LEFT JOIN civicrm_entity_financial_trxn ceft
LEFT JOIN civicrm_entity_financial_trxn ceft
ON ceft.financial_trxn_id = cft.id AND ceft.entity_table = 'civicrm_contribution'
LEFT JOIN civicrm_entity_financial_trxn ceft1
ON ceft1.financial_trxn_id = cft.id AND ceft1.entity_table = 'civicrm_financial_item'
......@@ -137,8 +137,8 @@ LEFT JOIN civicrm_financial_item cfi ON ceft1.entity_table = 'civicrm_financial_
WHERE ceft.entity_id = %1 AND (cfi.entity_table <> 'civicrm_financial_trxn' or cfi.entity_table is NULL)
{$condition}
ORDER BY cft.id {$orderBy}
LIMIT 1;";
LIMIT 1;";
$params = array(1 => array($entity_id, 'Integer'));
$dao = CRM_Core_DAO::executeQuery($query, $params);
if ($dao->fetch()) {
......@@ -163,7 +163,7 @@ LIMIT 1;";
static function getFinancialTrxnTotal($entity_id) {
$query = "
SELECT (ft.amount+SUM(ceft.amount)) AS total FROM civicrm_entity_financial_trxn AS ft
LEFT JOIN civicrm_entity_financial_trxn AS ceft ON ft.financial_trxn_id = ceft.entity_id
LEFT JOIN civicrm_entity_financial_trxn AS ceft ON ft.financial_trxn_id = ceft.entity_id
WHERE ft.entity_table = 'civicrm_contribution' AND ft.entity_id = %1
";
......@@ -236,7 +236,7 @@ WHERE ef2.financial_trxn_id =%1
static function getFinancialTrxnLineTotal($entity_id, $entity_table = 'civicrm_contribution') {
$query = "SELECT lt.price_field_value_id AS id, ft.financial_trxn_id,ft.amount AS amount FROM civicrm_entity_financial_trxn AS ft
LEFT JOIN civicrm_financial_item AS fi ON fi.id = ft.entity_id AND fi.entity_table = 'civicrm_line_item' AND ft.entity_table = 'civicrm_financial_item'
LEFT JOIN civicrm_line_item AS lt ON lt.id = fi.entity_id AND lt.entity_table = %2
LEFT JOIN civicrm_line_item AS lt ON lt.id = fi.entity_id AND lt.entity_table = %2
WHERE lt.entity_id = %1 ";
$sqlParams = array(1 => array($entity_id, 'Integer'), 2 => array($entity_table, 'String'));
......@@ -261,11 +261,11 @@ WHERE lt.entity_id = %1 ";
*/
static function deleteFinancialTrxn($entity_id) {
$query = "DELETE ceft1, cfi, ceft, cft FROM `civicrm_financial_trxn` cft
LEFT JOIN civicrm_entity_financial_trxn ceft
LEFT JOIN civicrm_entity_financial_trxn ceft
ON ceft.financial_trxn_id = cft.id AND ceft.entity_table = 'civicrm_contribution'
LEFT JOIN civicrm_entity_financial_trxn ceft1
ON ceft1.financial_trxn_id = cft.id AND ceft1.entity_table = 'civicrm_financial_item'
LEFT JOIN civicrm_financial_item cfi
LEFT JOIN civicrm_financial_item cfi
ON ceft1.entity_table = 'civicrm_financial_item' and cfi.id = ceft1.entity_id
WHERE ceft.entity_id = %1";
CRM_Core_DAO::executeQuery($query, array(1 => array($entity_id, 'Integer')));
......@@ -282,7 +282,7 @@ WHERE ceft.entity_id = %1";
if ((!CRM_Utils_Array::value('financial_type_id', $params) || !CRM_Utils_Array::value('contributionId', $params)) && !CRM_Utils_Array::value('oldPremium', $params)) {
return;
}
if (CRM_Utils_Array::value('cost', $params)) {
$contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
$financialAccountType = CRM_Contribute_PseudoConstant::financialAccountType($params['financial_type_id']);
......@@ -340,7 +340,7 @@ WHERE ceft.entity_id = %1";
$params['trxnParams']['from_financial_account_id'] = $params['to_financial_account_id'];
$params['trxnParams']['to_financial_account_id'] = $financialAccount;
$params['trxnParams']['total_amount'] = $amount;
$params['trxnParams']['fee_amount'] =
$params['trxnParams']['fee_amount'] =
$params['trxnParams']['net_amount'] = 0;
$params['trxnParams']['status_id'] = CRM_Core_OptionGroup::getValue('contribution_status','Completed','name');
$params['trxnParams']['contribution_id'] = isset($params['contribution']->id) ? $params['contribution']->id : $params['contribution_id'];
......@@ -349,7 +349,7 @@ WHERE ceft.entity_id = %1";
$financialTrxnID = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($params['trxnParams']['contribution_id'], 'DESC');
$params['entity_id'] = $financialTrxnID['financialTrxnId'];
}
$fItemParams =
$fItemParams =
array(
'financial_account_id' => $financialAccount,
'contact_id' => CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', $domainId, 'contact_id'),
......
......@@ -106,8 +106,8 @@ class CRM_Core_BAO_OpenID extends CRM_Core_DAO_OpenID {
}
$query = "
SELECT civicrm_openid.openid, civicrm_location_type.name as locationType, civicrm_openid.is_primary as is_primary,
civicrm_openid.allowed_to_login as allowed_to_login, civicrm_openid.id as openid_id,
SELECT civicrm_openid.openid, civicrm_location_type.name as locationType, civicrm_openid.is_primary as is_primary,
civicrm_openid.allowed_to_login as allowed_to_login, civicrm_openid.id as openid_id,
civicrm_openid.location_type_id as locationTypeId
FROM civicrm_contact
LEFT JOIN civicrm_openid ON ( civicrm_openid.contact_id = civicrm_contact.id )
......
......@@ -176,7 +176,7 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField {
$queryString = "
SELECT cg.id as cgId
FROM civicrm_custom_group cg
INNER JOIN civicrm_custom_field cf
INNER JOIN civicrm_custom_field cf
ON cg.id = cf.custom_group_id
WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1";
......@@ -433,14 +433,14 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1";
return TRUE;
}
/* Function to find out whether given profile group uses $required
/* Function to find out whether given profile group uses $required
* and/or $optionalprofile types
*
*
* @param integer $ufGroupId profile id
* @param array $required array of types those are required
* @param array $optional array of types those are optional
*
* @return boolean $valid
* @return boolean $valid
* @static
*/
static function checkValidProfileType($ufGroupId, $required, $optional = NULL) {
......@@ -724,8 +724,8 @@ SELECT ufg.id as id
}
$query = "
SELECT id
From civicrm_uf_field
SELECT id
From civicrm_uf_field
WHERE (in_selector = 1 OR is_searchable = 1)
AND uf_group_id = {$profileID}";
......
......@@ -73,7 +73,7 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
if (empty($params)) {
return FALSE;
}
$ids = self::allWebsites($contactID);
foreach ($params as $key => $values) {
$websiteId = CRM_Utils_Array::value('id', $values);
......@@ -90,7 +90,7 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
is_array($ids) && !empty($ids)
) {
foreach ($ids as $id => $value) {
if (($value['website_type_id'] == $values['website_type_id'])
if (($value['website_type_id'] == $values['website_type_id'])
&& CRM_Utils_Array::value('url', $value)) {
$values['id'] = $id;
unset($ids[$id]);
......@@ -103,7 +103,7 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
self::add($values);
}
}
if ($skipDelete && !empty($ids)) {
self::del(array_keys($ids));
}
......
......@@ -38,49 +38,49 @@
abstract class CRM_Core_Component_Info {
/*
* Name of the class (minus component namespace path)
* of the component invocation class'es name.
* Name of the class (minus component namespace path)
* of the component invocation class'es name.
*/
CONST COMPONENT_INVOKE_CLASS = 'Invoke';
/*
* Name of the class (minus component namespace path)
* Name of the class (minus component namespace path)
* of the component configuration class'es name.
*/
CONST COMPONENT_CONFIG_CLASS = 'Config';
/*
* Name of the class (minus component namespace path)
* Name of the class (minus component namespace path)
* of the component BAO Query class'es name.
*/
CONST COMPONENT_BAO_QUERY_CLASS = 'BAO_Query';
/*
* Name of the class (minus component namespace path)
* Name of the class (minus component namespace path)
* of the component user dashboard plugin.
*/
CONST COMPONENT_USERDASHBOARD_CLASS = 'Page_UserDashboard';
/*
* Name of the class (minus component namespace path)
* Name of the class (minus component namespace path)
* of the component tab offered to contact record view.
*/
CONST COMPONENT_TAB_CLASS = 'Page_Tab';
/*
* Name of the class (minus component namespace path)
* Name of the class (minus component namespace path)
* of the component tab offered to contact record view.
*/
CONST COMPONENT_ADVSEARCHPANE_CLASS = 'Form_Search_AdvancedSearchPane';
/*
* Name of the directory (assumed in component directory)
* Name of the directory (assumed in component directory)
* where xml resources used by this component live.
*/
CONST COMPONENT_XML_RESOURCES = 'xml';
/*
* Name of the directory (assumed in xml resources path)
* Name of the directory (assumed in xml resources path)
* containing component menu definition XML file names.
*/
CONST COMPONENT_MENU_XML = 'Menu';
......@@ -101,11 +101,11 @@ abstract class CRM_Core_Component_Info {
* Class constructor, sets name and namespace (those are stored
* in the component registry (database) and no need to duplicate
* them here, as well as populates the info variable.
*
*
* @param string $name name of the component
* @param string $namespace namespace prefix for component's files
* @access public
*
*
*/
public function __construct($name, $namespace, $componentID) {
$this->name = $name;
......
......@@ -53,10 +53,10 @@ class CRM_Core_JobManager {
/*
* Class constructor
*
*
* @param void
* @access public
*
*
*/
public function __construct() {
$config = CRM_Core_Config::singleton();
......@@ -66,10 +66,10 @@ class CRM_Core_JobManager {
}
/*
*
*
* @param void
* @access private
*
*
*/
public function execute($auth = TRUE) {
......@@ -94,10 +94,10 @@ class CRM_Core_JobManager {
/*
* Class destructor
*
*
* @param void
* @access public
*
*
*/
public function __destruct() {}
......@@ -141,11 +141,11 @@ class CRM_Core_JobManager {
/*
* Retrieves the list of jobs from the database,
* populates class param.
*
*
* @param void
* @return array ($id => CRM_Core_ScheduledJob)
* @access private
*
*
*/
private function _getJobs() {
$jobs = array();
......@@ -163,10 +163,10 @@ class CRM_Core_JobManager {
/*
* Retrieves specific job from the database by id
* and creates ScheduledJob object.
*
*
* @param void
* @access private
*
*
*/
private function _getJob($id = NULL, $entity = NULL, $action = NULL) {
if (is_null($id) && is_null($action)) {
......@@ -190,7 +190,7 @@ class CRM_Core_JobManager {
$this->singleRunParams[$key] = $params;
$this->singleRunParams[$key]['version'] = 3;
}
/*
*
* @return array|null collection of permissions, null if none
......
......@@ -262,6 +262,6 @@ class CRM_Core_ManagedEntities {
'result' => $result,
));
throw new Exception('API error: ' . $result['error_message']);
}
}
}
......@@ -100,11 +100,11 @@ class CRM_Core_Page_AJAX {
if (CRM_Utils_Array::value('id', $_REQUEST)) {
$id = CRM_Utils_Type::escape($_REQUEST['id'], 'Integer');
}
if (CRM_Utils_Array::value('context', $_REQUEST)) {
$context = CRM_Utils_Type::escape($_REQUEST['context'], 'String');
}
// return false if $id is null and
// return false if $id is null and
// $context is not civicrm_event or civicrm_contribution_page
if (!$id || !in_array($context, array('civicrm_event', 'civicrm_contribution_page'))) {
return false;
......
......@@ -222,7 +222,7 @@ class CRM_Core_Selector_Controller {
$this->_sort = new CRM_Utils_Sort($this->_sortOrder, $this->_sortID);
/*
* if we are in transfer mode, do not goto database, use the
* if we are in transfer mode, do not goto database, use the
* session values instead
*/
......
......@@ -40,12 +40,12 @@
* Version: 0.1
* Date: 2006-16-02
* Author: Thorsten Albrecht <thor_REMOVE.THIS_@wolke7.net>
* Purpose: "substring" allows you to retrieve a small part (substring) of a string.
* Notes: The substring is specified by giving the start position and the length.
* Purpose: "substring" allows you to retrieve a small part (substring) of a string.
* Notes: The substring is specified by giving the start position and the length.
* Unlike the original function substr() in PHP the position of the characters
* in the string starts at 1 (not at 0 as usual in php).
* Example smarty code:
* {$my_string|substring:2:4}
* {$my_string|substring:2:4}
* returns substring from character 2 until character 6
* @link based on substr(): http://www.zend.com/manual/function.substr.php
* @param string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment