Commit 9b873358 authored by totten's avatar totten
Browse files

INFRA-132 - Add space before "{"

parent 22e263ad
......@@ -163,7 +163,7 @@ WHERE modified_date IS NULL
// CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache"); // No, force-commits transaction
// CRM_Core_DAO::singleValueQuery("DELETE FROM civicrm_acl_contact_cache"); // Transaction-safe
if (CRM_Core_Transaction::isActive()) {
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, function(){
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, function() {
CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache");
});
}
......
......@@ -116,7 +116,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form {
$roleObj = $wp_roles->get_role($role);
//Remove all civicrm capabilities for the role, as there may be some capabilities checkbox unticked
foreach ($permissionsArray as $key => $capability){
foreach ($permissionsArray as $key => $capability) {
$roleObj->remove_cap($key);
}
......@@ -172,7 +172,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form {
*
* @return array civicrm permissions
*/
public static function getPermissionArray(){
public static function getPermissionArray() {
global $civicrm_root;
$permissions = CRM_Core_Permission::basicPermissions();
......
......@@ -84,7 +84,7 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task {
);
$readOnlyFields['assignee_display_name'] = ts('Assigned to');
if (!empty($contactDetails)) {
foreach ($contactDetails as $key => $value){
foreach ($contactDetails as $key => $value) {
$assignee = CRM_Activity_BAO_ActivityAssignment::retrieveAssigneeIdsByActivityId($key);
foreach ($assignee as $keys => $values) {
$assigneeContact[] = CRM_Contact_BAO_Contact::displayname($values);
......
......@@ -94,7 +94,7 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
'1' => 1) + $cRSearchFields;
// we can handle all the ones defined in the metadata here. Others to be converted
foreach ($this->_settings as $setting => $group){
foreach ($this->_settings as $setting => $group) {
$settingMetaData = civicrm_api('setting', 'getfields', array('version' => 3, 'name' => $setting));
$this->_defaults[$setting] = civicrm_api('setting', 'getvalue', array(
'version' => 3,
......@@ -135,12 +135,12 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
)
);
foreach ($this->_settings as $setting => $group){
foreach ($this->_settings as $setting => $group) {
$settingMetaData = civicrm_api('setting', 'getfields', array('version' => 3, 'name' => $setting));
$props = $settingMetaData['values'][$setting];
if (isset($props['quick_form_type'])){
if (isset($props['quick_form_type'])) {
$add = 'add' . $props['quick_form_type'];
if ($add == 'addElement'){
if ($add == 'addElement') {
$this->$add(
$props['html_type'],
$setting,
......@@ -153,11 +153,11 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
$this->$add($setting, ts($props['title']));
}
$this->assign("{$setting}_description", ts($props['description']));
if ($setting == 'max_attachments'){
if ($setting == 'max_attachments') {
//temp hack @todo fix to get from metadata
$this->addRule('max_attachments', ts('Value should be a positive number'), 'positiveInteger');
}
if ($setting == 'maxFileSize'){
if ($setting == 'maxFileSize') {
//temp hack
$this->addRule('maxFileSize', ts('Value should be a positive number'), 'positiveInteger');
}
......@@ -261,7 +261,7 @@ AND time_format <> ''
}
$settings = array_intersect_key($params, $this->_settings);
$result = civicrm_api('setting', 'create', $settings + array('version' => 3));
foreach ($settings as $setting => $settingGroup){
foreach ($settings as $setting => $settingGroup) {
//@todo array_diff this
unset($params[$setting]);
}
......
......@@ -409,7 +409,7 @@ SELECT survey.id as id,
return NULL;
}
$reportId = CRM_Campaign_BAO_Survey::getReportID($id);
if ($reportId){
if ($reportId) {
CRM_Report_BAO_ReportInstance::del($reportId);
}
$dao = new CRM_Campaign_DAO_Survey();
......
......@@ -307,7 +307,7 @@ WHERE {$clause}
foreach ($this->_contactIds as $contactId) {
//build the profile fields.
foreach ($this->_surveyFields as $name => $field) {
if ($field){
if ($field) {
CRM_Core_BAO_UFGroup::buildProfile($this, $field, NULL, $contactId);
}
}
......
......@@ -851,7 +851,7 @@ Group By componentId";
// make sure you preserve specific form values like location type, is_primary_ is_billing, master_id
// CRM-10336: Also empty any fields from the existing address block if they don't exist in master (otherwise they will persist)
foreach ($values as $field => $submittedValue) {
if (!in_array($field, $skipFields)){
if (!in_array($field, $skipFields)) {
if (isset($masterAddress->$field)) {
$values[$field] = $masterAddress->$field;
}
......
......@@ -585,7 +585,7 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
elseif ($groupType == 'Access') {
$value = CRM_Core_DAO::VALUE_SEPARATOR . '1' . CRM_Core_DAO::VALUE_SEPARATOR;
}
elseif (!empty($groupType)){
elseif (!empty($groupType)) {
// ie we have been given the group key
$value = CRM_Core_DAO::VALUE_SEPARATOR . $groupType . CRM_Core_DAO::VALUE_SEPARATOR;
}
......
......@@ -89,7 +89,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
$relationshipId = CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params));
//CRM-9015 - the hooks are called here & in add (since add doesn't call create)
// but in future should be tidied per ticket
if (empty($relationshipId)){
if (empty($relationshipId)) {
$hook = 'create';
$action = CRM_Core_Action::ADD;
}
......@@ -232,11 +232,11 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
$dateFields = array('end_date', 'start_date');
foreach (self::getdefaults() as $defaultField => $defaultValue){
if (isset($params[$defaultField])){
if (in_array($defaultField, $dateFields)){
foreach (self::getdefaults() as $defaultField => $defaultValue) {
if (isset($params[$defaultField])) {
if (in_array($defaultField, $dateFields)) {
$relationship->$defaultField = CRM_Utils_Date::format(CRM_Utils_Array::value($defaultField, $params));
if (!$relationship->$defaultField){
if (!$relationship->$defaultField) {
$relationship->$defaultField = 'NULL';
}
}
......@@ -244,7 +244,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
$relationship->$defaultField = $params[$defaultField];
}
}
elseif(!$relationshipId){
elseif(!$relationshipId) {
$relationship->$defaultField = $defaultValue;
}
}
......@@ -766,9 +766,9 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer');
*/
$dateFields = array('end_date', 'start_date');
foreach ($dateFields as $dateField){
foreach ($dateFields as $dateField) {
if (array_key_exists($dateField, $params)) {
if (empty($params[$dateField]) || $params[$dateField] == 'null'){
if (empty($params[$dateField]) || $params[$dateField] == 'null') {
//this is most likely coming from an api call & probably loaded
// from the DB to deal with some of the
// other myriad of excessive checks still in place both in
......@@ -776,7 +776,7 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer');
$queryString .= " AND $dateField IS NULL";
continue;
}
elseif (is_array($params[$dateField])){
elseif (is_array($params[$dateField])) {
$queryString .= " AND $dateField = " .
CRM_Utils_Type::escape(CRM_Utils_Date::format($params[$dateField]), 'Date');
}
......
......@@ -189,12 +189,12 @@ class CRM_Contribute_Form_ContributionPage_AddProduct extends CRM_Contribute_For
'account_relationship = 7'
);
$productFinancialType = array_intersect($costFinancialType, $premiumFinancialType);
foreach ($financialType as $key => $financialTypeName ){
foreach ($financialType as $key => $financialTypeName ) {
if (!in_array( $key, $productFinancialType)) {
unset( $financialType[$key] );
}
}
if (count( $financialType ) ){
if (count( $financialType ) ) {
$this->assign( 'financialType', $financialType );
}
$this->add(
......
......@@ -167,12 +167,12 @@ class CRM_Contribute_Form_ManagePremiums extends CRM_Contribute_Form {
'account_relationship = 7'
);
$productFinancialType = array_intersect($costFinancialType, $premiumFinancialType);
foreach ($financialType as $key => $financialTypeName ){
foreach ($financialType as $key => $financialTypeName ) {
if (!in_array( $key, $productFinancialType)) {
unset( $financialType[$key] );
}
}
if (count( $financialType ) ){
if (count( $financialType ) ) {
$this->assign( 'financialType', $financialType );
}
$this->add(
......
......@@ -451,7 +451,7 @@ abstract class CRM_Contribute_Import_Parser extends CRM_Import_Parser {
$params[$this->_activeFields[$i]->_name] = array();
}
$params[$this->_activeFields[$i]->_name][$i][$this->_activeFields[$i]->_softCreditField] = $this->_activeFields[$i]->_value;
if (isset($this->_activeFields[$i]->_softCreditType)){
if (isset($this->_activeFields[$i]->_softCreditType)) {
$params[$this->_activeFields[$i]->_name][$i]['soft_credit_type_id'] = $this->_activeFields[$i]->_softCreditType;
}
}
......
......@@ -399,8 +399,8 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Contribute_Import_Pa
//Delete all existing soft Contribution from contribution_soft table for pcp_id is_null
$existingSoftCredit = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($dupeSoftCredit['contribution_id']);
if (isset($existingSoftCredit['soft_credit']) && !empty($existingSoftCredit['soft_credit'])){
foreach ($existingSoftCredit['soft_credit'] as $key => $existingSoftCreditValues){
if (isset($existingSoftCredit['soft_credit']) && !empty($existingSoftCredit['soft_credit'])) {
foreach ($existingSoftCredit['soft_credit'] as $key => $existingSoftCreditValues) {
if (!empty($existingSoftCreditValues['soft_credit_id'])) {
$deleteParams = array(
'id' => $existingSoftCreditValues['soft_credit_id'],
......
......@@ -170,7 +170,7 @@ class CRM_Contribute_Page_ManagePremiums extends CRM_Core_Page_Basic {
$dao->id
);
//Financial Type
if (!empty( $dao->financial_type_id ) ){
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' );
}
......
......@@ -125,7 +125,7 @@ class CRM_Contribute_Task {
unset(self::$_tasks[1]);
}
//CRM-12920 - check for edit permission
if (!CRM_Core_Permission::check('edit contributions') ){
if (!CRM_Core_Permission::check('edit contributions') ) {
unset(self::$_tasks[4], self::$_tasks[6]);
}
......
......@@ -1025,7 +1025,7 @@ SELECT is_primary,
if ($count > 2) {
break;
}
if (count($first_names) == 1){
if (count($first_names) == 1) {
$family = $first_names[current(array_keys($first_names))]['addressee_display'];
}
else {
......
......@@ -468,7 +468,7 @@ class CRM_Core_BAO_Block {
$sql = "UPDATE $table SET is_primary = 0 WHERE contact_id = %1";
$sqlParams = array(1 => array($contactId, 'Integer'));
// we don't want to create unecessary entries in the log_ tables so exclude the one we are working on
if (!empty($params['id'])){
if (!empty($params['id'])) {
$sql .= " AND id <> %2";
$sqlParams[2] = array($params['id'], 'Integer');
}
......@@ -513,7 +513,7 @@ class CRM_Core_BAO_Block {
* @param array $locations
*
*/
public static function sortPrimaryFirst(&$locations){
public static function sortPrimaryFirst(&$locations) {
uasort($locations, 'self::primaryComparison');
}
......@@ -524,7 +524,7 @@ class CRM_Core_BAO_Block {
* @param array $location2
* @return number
*/
public static function primaryComparison($location1, $location2){
public static function primaryComparison($location1, $location2) {
$l1 = CRM_Utils_Array::value('is_primary', $location1);
$l2 = CRM_Utils_Array::value('is_primary', $location2);
if ($l1 == $l2) {
......
......@@ -90,7 +90,7 @@ UPDATE civicrm_email
SET is_bulkmail = 0
WHERE contact_id = {$params['contact_id']}
";
if ($hook == 'edit'){
if ($hook == 'edit') {
$sql .= " AND id <> {$params['id']}";
}
CRM_Core_DAO::executeQuery($sql);
......
......@@ -281,7 +281,7 @@ WHERE lt.entity_id = %1 ";
$sqlParams = array(1 => array($entity_id, 'Integer'), 2 => array($entity_table, 'String'));
$dao = CRM_Core_DAO::executeQuery($query, $sqlParams);
while ($dao->fetch()){
while ($dao->fetch()) {
$result[$dao->financial_trxn_id][$dao->id] = $dao->amount;
}
if (!empty($result)) {
......
......@@ -90,7 +90,7 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup {
* @return object
*/
public static function add(&$params, $ids = array()) {
if (empty($params['id'])){
if (empty($params['id'])) {
$params['id'] = CRM_Utils_Array::value('optionGroup', $ids);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment