$attributes = [];
foreach (explode(' ', $attrString) as $at) {
if (strpos($at, '=')) {
- list($k, $v) = explode('=', $at);
+ [$k, $v] = explode('=', $at);
$attributes[$k] = trim($v, ' "');
}
}
'entity_id',
'file_id'
);
- list($path) = CRM_Core_BAO_File::path($fileID, $entityId);
+ [$path] = CRM_Core_BAO_File::path($fileID, $entityId);
$fileHash = CRM_Core_BAO_File::generateFileHash($entityId, $fileID);
$url = CRM_Utils_System::url('civicrm/file',
"reset=1&id=$fileID&eid=$entityId&fcs=$fileHash",
return NULL;
}
- list($tableName, $columnName, $groupID) = self::getTableColumnGroup($customFieldId);
+ [$tableName, $columnName, $groupID] = self::getTableColumnGroup($customFieldId);
if (!$customValueId &&
// we always create new entites for is_multiple unless specified
}
if (empty($groupTree)) {
- list($multipleFieldGroups, $groupTree) = self::buildGroupTree($entityType, $toReturn, $subTypes, $queryString, $params, $subType);
+ [$multipleFieldGroups, $groupTree] = self::buildGroupTree($entityType, $toReturn, $subTypes, $queryString, $params, $subType);
$cache->set($cacheKey, $groupTree);
$cache->set($multipleFieldGroupCacheKey, $multipleFieldGroups);
);
$customValue['imageURL'] = str_replace('persist/contribute', 'custom', $config->imageUploadURL) .
$fileDAO->uri;
- list($path) = CRM_Core_BAO_File::path($fileDAO->id, $entityId);
+ [$path] = CRM_Core_BAO_File::path($fileDAO->id, $entityId);
if ($path && file_exists($path)) {
- list($imageWidth, $imageHeight) = getimagesize($path);
- list($imageThumbWidth, $imageThumbHeight) = CRM_Contact_BAO_Contact::getThumbSize($imageWidth, $imageHeight);
+ [$imageWidth, $imageHeight] = getimagesize($path);
+ [$imageThumbWidth, $imageThumbHeight] = CRM_Contact_BAO_Contact::getThumbSize($imageWidth, $imageHeight);
$customValue['imageThumbWidth'] = $imageThumbWidth;
$customValue['imageThumbHeight'] = $imageThumbHeight;
}
}
foreach ($values as $tuple) {
- list($name, $op, $value, $grouping, $wildcard) = $tuple;
+ [$name, $op, $value, $grouping, $wildcard] = $tuple;
$field = $this->_fields[$id];
&& substr($name, -5, 5) !== '_high') {
// Relative dates are handled in the buildRelativeDateQuery function.
$this->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fieldName, $op, $value, 'Date');
- list($qillOp, $qillVal) = CRM_Contact_BAO_Query::buildQillForFieldValue(NULL, $field['label'], $value, $op, [], CRM_Utils_Type::T_DATE);
+ [$qillOp, $qillVal] = CRM_Contact_BAO_Query::buildQillForFieldValue(NULL, $field['label'], $value, $op, [], CRM_Utils_Type::T_DATE);
$this->_qill[$grouping][] = "{$field['label']} $qillOp '$qillVal'";
}
break;
$joinTableAlias = $joinTable;
// Set location-specific query
if (isset($this->_locationSpecificCustomFields[$field['id']])) {
- list($locationType, $locationTypeId) = $this->_locationSpecificCustomFields[$field['id']];
+ [$locationType, $locationTypeId] = $this->_locationSpecificCustomFields[$field['id']];
$joinTableAlias = "$locationType-address";
$joinClause = "\nLEFT JOIN $joinTable `$locationType-address` ON (`$locationType-address`.contact_id = contact_a.id AND `$locationType-address`.location_type_id = $locationTypeId)";
}
// to get id's
if ($overwrite && $fileTypeID) {
- list($sql, $params) = self::sql($entityTable, $entityID, $fileTypeID);
+ [$sql, $params] = self::sql($entityTable, $entityID, $fileTypeID);
}
else {
- list($sql, $params) = self::sql($entityTable, $entityID, 0);
+ [$sql, $params] = self::sql($entityTable, $entityID, 0);
}
$dao = CRM_Core_DAO::executeQuery($sql, $params);
CRM_Utils_Hook::pre('delete', 'File', $fileID, $fileDAO);
// get the table and column name
- list($tableName, $columnName, $groupID) = CRM_Core_BAO_CustomField::getTableColumnGroup($fieldID);
+ [$tableName, $columnName, $groupID] = CRM_Core_BAO_CustomField::getTableColumnGroup($fieldID);
$entityFileDAO = new CRM_Core_DAO_EntityFile();
$entityFileDAO->file_id = $fileID;
* The $useWhere is used so that the signature matches the parent class
*
* public function delete($useWhere = FALSE) {
- * list($fileID, $entityID, $fieldID) = func_get_args();
+ * [$fileID, $entityID, $fieldID] = func_get_args();
*
* self::deleteFileReferences($fileID, $entityID, $fieldID);
* } */
$config = CRM_Core_Config::singleton();
- list($sql, $params) = self::sql($entityTable, $entityID, $fileTypeID, $fileID);
+ [$sql, $params] = self::sql($entityTable, $entityID, $fileTypeID, $fileID);
$dao = CRM_Core_DAO::executeQuery($sql, $params);
$cfIDs = [];
$config = CRM_Core_Config::singleton();
- list($sql, $params) = self::sql($entityTable, $entityID, NULL);
+ [$sql, $params] = self::sql($entityTable, $entityID, NULL);
$dao = CRM_Core_DAO::executeQuery($sql, $params);
$results = [];
while ($dao->fetch()) {
$displayName = $result = $contactImage = NULL;
if ($log->find(TRUE)) {
if ($log->modified_id) {
- list($displayName, $contactImage) = CRM_Contact_BAO_Contact::getDisplayAndImage($log->modified_id);
+ [$displayName, $contactImage] = CRM_Contact_BAO_Contact::getDisplayAndImage($log->modified_id);
}
$result = [
'id' => $log->modified_id,
asort($relationshipTypes);
foreach ($relationshipTypes as $key => $var) {
- list($type) = explode('_', $key);
+ [$type] = explode('_', $key);
$relationships[$key]['title'] = $var;
$relationships[$key]['headerPattern'] = '/' . preg_quote($var, '/') . '/';
foreach ($subTypeRelationshipTypes as $key => $var) {
if (!array_key_exists($key, $fields[$info['parent']])) {
- list($type) = explode('_', $key);
+ [$type] = explode('_', $key);
$csRelationships[$key]['title'] = $var;
$csRelationships[$key]['headerPattern'] = '/' . preg_quote($var, '/') . '/';
// Handle mapping for 'related contact' fields
if (count(explode('_', CRM_Utils_Array::value('1', $v))) > 2) {
- list($id, $first, $second) = explode('_', CRM_Utils_Array::value('1', $v));
+ [$id, $first, $second] = explode('_', CRM_Utils_Array::value('1', $v));
if (($first == 'a' && $second == 'b') || ($first == 'b' && $second == 'a')) {
if (!empty($v['2'])) {
*/
public static function getPositions($cacheKey, $id1, $id2, &$mergeId = NULL, $join = NULL, $where = NULL, $flip = FALSE) {
if ($flip) {
- list($id1, $id2) = [$id2, $id1];
+ [$id1, $id2] = [$id2, $id1];
}
if ($mergeId == NULL) {
*/
public static function assignAddressField($key, &$profileAddressFields, $profileFilter, $paymentProcessorBillingFields = NULL) {
$billing_id = CRM_Core_BAO_LocationType::getBilling();
- list($prefixName, $index) = CRM_Utils_System::explode('-', $key, 2);
+ [$prefixName, $index] = CRM_Utils_System::explode('-', $key, 2);
$profileFields = civicrm_api3('uf_field', 'get', array_merge($profileFilter,
[
$field = CRM_Core_DAO::executeQuery($query);
$importableFields = self::getProfileFieldMetadata($showAll);
- list($customFields, $addressCustomFields) = self::getCustomFields($ctype, $skipPermission ? FALSE : $permissionType);
+ [$customFields, $addressCustomFields] = self::getCustomFields($ctype, $skipPermission ? FALSE : $permissionType);
while ($field->fetch()) {
- list($name, $formattedField) = self::formatUFField($group, $field, $customFields, $addressCustomFields, $importableFields, $permissionType);
+ [$name, $formattedField] = self::formatUFField($group, $field, $customFields, $addressCustomFields, $importableFields, $permissionType);
if ($formattedField !== NULL) {
$fields[$name] = $formattedField;
}
$profileType = CRM_Core_BAO_UFField::calculateProfileType(implode(',', $ufGroupType));
$contactActivityProfile = CRM_Core_BAO_UFField::checkContactActivityProfileTypeByGroupType(implode(',', $ufGroupType));
$importableFields = self::getImportableFields($showAll, $profileType, $contactActivityProfile);
- list($customFields, $addressCustomFields) = self::getCustomFields($ctype, $permissionType);
+ [$customFields, $addressCustomFields] = self::getCustomFields($ctype, $permissionType);
$formattedFields = [];
foreach ($fieldArrs as $fieldArr) {
continue;
}
- list($name, $formattedField) = self::formatUFField($group, $field, $customFields, $addressCustomFields, $importableFields, $permissionType);
+ [$name, $formattedField] = self::formatUFField($group, $field, $customFields, $addressCustomFields, $importableFields, $permissionType);
if ($formattedField !== NULL) {
$formattedFields[$name] = $formattedField;
}
}
}
elseif ($name == 'image_URL') {
- list($width, $height) = getimagesize(CRM_Utils_String::unstupifyUrl($details->$name));
- list($thumbWidth, $thumbHeight) = CRM_Contact_BAO_Contact::getThumbSize($width, $height);
+ [$width, $height] = getimagesize(CRM_Utils_String::unstupifyUrl($details->$name));
+ [$thumbWidth, $thumbHeight] = CRM_Contact_BAO_Contact::getThumbSize($width, $height);
$image_URL = '<img src="' . $details->$name . '" height= ' . $thumbHeight . ' width= ' . $thumbWidth . ' />';
$values[$index] = "<a href='#' onclick='contactImagePopUp(\"{$details->$name}\", {$width}, {$height});'>{$image_URL}</a>";
}
}
elseif (strpos($name, '-') !== FALSE) {
- list($fieldName, $id, $type) = CRM_Utils_System::explode('-', $name, 3);
+ [$fieldName, $id, $type] = CRM_Utils_System::explode('-', $name, 3);
if (!in_array($fieldName, $multipleFields)) {
if ($id == 'Primary') {
}
}
elseif (CRM_Utils_Array::value('name', $field) == 'membership_type') {
- list($orgInfo, $types) = CRM_Member_BAO_MembershipType::getMembershipTypeInfo();
+ [$orgInfo, $types] = CRM_Member_BAO_MembershipType::getMembershipTypeInfo();
$sel = &$form->addElement('hierselect', $name, $title);
$select = ['' => ts('- select membership type -')];
if (count($orgInfo) == 1 && $field['is_required']) {
}
}
elseif (substr($fieldName, 0, 14) === 'address_custom') {
- list($fName, $locTypeId) = CRM_Utils_System::explode('-', $fieldName, 2);
+ [$fName, $locTypeId] = CRM_Utils_System::explode('-', $fieldName, 2);
$customFieldID = CRM_Core_BAO_CustomField::getKeyID(substr($fName, 8));
if ($customFieldID) {
CRM_Core_BAO_CustomField::addQuickFormElement($form, $name, $customFieldID, $required, $search, $title);
$form->addMoney("soft_credit_amount[{$rowNumber}]", ts('Amount'), FALSE, NULL, FALSE);
}
elseif ($fieldName === 'product_name') {
- list($products, $options) = CRM_Contribute_BAO_Premium::getPremiumProductInfo();
+ [$products, $options] = CRM_Contribute_BAO_Premium::getPremiumProductInfo();
$sel = &$form->addElement('hierselect', $name, $title);
$products = ['0' => ts('- select %1 -', [1 => $title])] + $products;
$sel->setOptions([$products, $options]);
}
else {
$blocks = ['email', 'phone', 'im', 'openid'];
- list($fieldName, $locTypeId, $phoneTypeId) = CRM_Utils_System::explode('-', $name, 3);
+ [$fieldName, $locTypeId, $phoneTypeId] = CRM_Utils_System::explode('-', $name, 3);
if (!in_array($fieldName, $multipleFields)) {
if (is_array($details)) {
foreach ($details as $key => $value) {
);
//get the default domain email address.
- list($domainEmailName, $domainEmailAddress) = CRM_Core_BAO_Domain::getNameAndEmail();
+ [$domainEmailName, $domainEmailAddress] = CRM_Core_BAO_Domain::getNameAndEmail();
if (!$domainEmailAddress || $domainEmailAddress == 'info@EXAMPLE.ORG') {
$fixUrl = CRM_Utils_System::url('civicrm/admin/domain', 'action=update&reset=1');
public static function formatFields($params, $contactId = NULL) {
if ($contactId) {
// get the primary location type id and email
- list($name, $primaryEmail, $primaryLocationType) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactId);
+ [$name, $primaryEmail, $primaryLocationType] = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactId);
}
else {
$defaultLocationType = CRM_Core_BAO_LocationType::getDefault();
$count = 1;
$primaryLocation = 0;
foreach ($params as $key => $value) {
- list($fieldName, $locTypeId, $phoneTypeId) = explode('-', $key);
+ [$fieldName, $locTypeId, $phoneTypeId] = explode('-', $key);
if ($locTypeId == 'Primary') {
$locTypeId = $primaryLocationType;
// add current contact to recently viewed
if ($ufmatch->contact_id) {
- list($displayName, $contactImage, $contactType, $contactSubtype, $contactImageUrl)
+ [$displayName, $contactImage, $contactType, $contactSubtype, $contactImageUrl]
= CRM_Contact_BAO_Contact::getDisplayAndImage($ufmatch->contact_id, TRUE, TRUE);
$otherRecent = [