}
}
- if ($customDataSubType && !is_array($customDataSubType)) {
- $customDataSubType = explode(CRM_Core_DAO::VALUE_SEPARATOR,
- trim($customDataSubType, CRM_Core_DAO::VALUE_SEPARATOR)
- );
- }
+ $customDataSubType = CRM_Utils_Array::explodePadded($customDataSubType);
if (is_array($customDataType)) {
$cacheKey = implode('_', $customDataType);
);
}
}
- return $all ? array(
- NULL, NULL) : NULL;
+ return $all ? array(NULL, NULL) : NULL;
}
/**
$widget = 'Text';
}
- if ($widget == 'Select State/Province' || $widget == 'Select Country') {
- $qf->_stateCountryMap[$widget == 'Select Country' ? 'country' : 'state_province'][] = $elementName;
- }
-
$placeholder = $search ? ts('- any -') : ($useRequired ? ts('- select -') : ts('- none -'));
// FIXME: Why are select state/country separate widget types?
*
* @return array
*/
- static function getFileURL($contactID, $cfID, $fileID = NULL, $absolute = FALSE) {
+ static function getFileURL($contactID, $cfID, $fileID = NULL, $absolute = FALSE, $multiRecordWhereClause = NULL) {
if ($contactID) {
if (!$fileID) {
$params = array('id' => $cfID);
);
//query to fetch id from civicrm_file
- $query = "SELECT {$columnName} FROM {$tableName} where entity_id = {$contactID}";
+ if ($multiRecordWhereClause) {
+ $query = "SELECT {$columnName} FROM {$tableName} where entity_id = {$contactID} AND {$multiRecordWhereClause}";
+ }
+ else {
+ $query = "SELECT {$columnName} FROM {$tableName} where entity_id = {$contactID}";
+ }
$fileID = CRM_Core_DAO::singleValueQuery($query);
}
* @param int $entityId entity id (contribution, membership...)
* @param boolean $inline consider inline custom groups only
* @param boolean $checkPermission if false, do not include permissioning clause
+ * @param boolean $includeViewOnly if true, fields marked 'View Only' are included. Required for APIv3.
*
* @return array $customFormatted formatted custom field array
* @static
$customFieldExtend, $customValueId = NULL,
$entityId = NULL,
$inline = FALSE,
- $checkPermission = TRUE
+ $checkPermission = TRUE,
+ $includeViewOnly = false
) {
//get the custom fields for the entity
//subtype and basic type
}
// return if field is a 'code' field
- if (!empty($customFields[$customFieldId]['is_view'])) {
+ if (!$includeViewOnly && !empty($customFields[$customFieldId]['is_view'])) {
return;
}