);
if ($parseStreetAddress && !empty($params['street_address'])) {
- foreach ([
- 'street_number',
- 'street_name',
- 'street_unit',
- 'street_number_suffix',
- ] as $fld) {
+ foreach (['street_number', 'street_name', 'street_unit', 'street_number_suffix'] as $fld) {
unset($params[$fld]);
}
// main parse string.
while ($address->fetch()) {
// deprecate reference.
if ($count > 1) {
- foreach ([
- 'state',
- 'state_name',
- 'country',
- 'world_region',
- ] as $fld) {
+ foreach (['state', 'state_name', 'country', 'world_region'] as $fld) {
if (isset($address->$fld)) {
unset($address->$fld);
}
$streetAddress = trim($streetAddress);
$matches = [];
- if (in_array($locale, [
- 'en_CA',
- 'fr_CA',
- ]) && preg_match('/^([A-Za-z0-9]+)[ ]*\-[ ]*/', $streetAddress, $matches)
+ if (in_array($locale, ['en_CA', 'fr_CA'])
+ && preg_match('/^([A-Za-z0-9]+)[ ]*\-[ ]*/', $streetAddress, $matches)
) {
$parseFields['street_unit'] = $matches[1];
// unset from rest of street address
}
// now check that the cms db does not have the user name and/or email
- if ($isDrupal OR $isJoomla OR $isWordPress) {
+ if ($isDrupal or $isJoomla or $isWordPress) {
$params = [
'name' => $fields['cms_name'],
'mail' => $fields[$emailName],
*
* @var int, number of second
*/
- const DEFAULT_SESSION_TTL = 172800; // Two days: 2*24*60*60
+ // Two days: 2*24*60*60
+ const DEFAULT_SESSION_TTL = 172800;
/**
* @var array ($cacheKey => $cacheValue)
$table = self::getTableName();
$where = self::whereCache($group, $path, $componentID);
$dataExists = CRM_Core_DAO::singleValueQuery("SELECT COUNT(*) FROM $table WHERE {$where}");
- $now = date('Y-m-d H:i:s'); // FIXME - Use SQL NOW() or CRM_Utils_Time?
+ // FIXME - Use SQL NOW() or CRM_Utils_Time?
+ $now = date('Y-m-d H:i:s');
$dataSerialized = self::encode($data);
// This table has a wonky index, so we cannot use REPLACE or
'custom data',
// Universe
- 'dashboard', // be.chiro.civi.atomfeeds
- 'lineitem-editor', // biz.jmaconsulting.lineitemedit
- 'HRCore_Info', // civihr/uk.co.compucorp.civicrm.hrcore
- 'CiviCRM setting Spec', // nz.co.fuzion.entitysetting
- 'descendant groups for an org', // org.civicrm.multisite
+
+ // be.chiro.civi.atomfeeds
+ 'dashboard',
+
+ // biz.jmaconsulting.lineitemedit
+ 'lineitem-editor',
+
+ // civihr/uk.co.compucorp.civicrm.hrcore
+ 'HRCore_Info',
+
+ // nz.co.fuzion.entitysetting
+ 'CiviCRM setting Spec',
+
+ // org.civicrm.multisite
+ 'descendant groups for an org',
];
}
if (self::hasCustomGroup('Activity', NULL, $activityTypeId)) {
return TRUE;
}
- $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE, FALSE); // everything
+ // everything
+ $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE, FALSE);
$params = [
'version' => 3,
'extends' => 'Activity',
foreach ($subTypes as $key => $subType) {
$subTypeClauses[] = self::whereListHas("civicrm_custom_group.extends_entity_column_value", self::validateSubTypeByEntity($entityType, $subType));
}
- $subTypeClause = '(' . implode(' OR ', $subTypeClauses) . ')';
+ $subTypeClause = '(' . implode(' OR ', $subTypeClauses) . ')';
if (!$onlySubType) {
$subTypeClause = '(' . $subTypeClause . ' OR civicrm_custom_group.extends_entity_column_value IS NULL )';
}
* SQL condition.
*/
static private function whereListHas($column, $value, $delimiter = CRM_Core_DAO::VALUE_SEPARATOR) {
- $bareValue = trim($value, $delimiter); // ?
+ // ?
+ $bareValue = trim($value, $delimiter);
$escapedValue = CRM_Utils_Type::escape("%{$delimiter}{$bareValue}{$delimiter}%", 'String', FALSE);
return "($column LIKE \"$escapedValue\")";
}
public static function initializeDashlets() {
$dashlets = [];
$getDashlets = civicrm_api3("Dashboard", "get", [
- 'domain_id' => CRM_Core_Config::domainID(),
- 'option.limit' => 0,
- ]);
+ 'domain_id' => CRM_Core_Config::domainID(),
+ 'option.limit' => 0,
+ ]);
$contactID = CRM_Core_Session::getLoggedInContactID();
$allDashlets = CRM_Utils_Array::index(['name'], $getDashlets['values']);
$defaultDashlets = [];
}
// hack to handle case permissions
- if (!$componentName && in_array($key, [
- 'access my cases and activities',
- 'access all cases and activities',
- ])
+ if (!$componentName
+ && in_array($key, ['access my cases and activities', 'access all cases and activities'])
) {
$componentName = 'CiviCase';
}