foreach ($grpId as $val) {
$error = CRM_Utils_Type::validate($val, 'Integer', FALSE);
if ($error != $val) {
foreach ($grpId as $val) {
$error = CRM_Utils_Type::validate($val, 'Integer', FALSE);
if ($error != $val) {
// Check Empty values for Integer Or Boolean Or Date type For operators other than IS NULL and IS NOT NULL.
if (!in_array($v[1],
array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) {
// Check Empty values for Integer Or Boolean Or Date type For operators other than IS NULL and IS NOT NULL.
if (!in_array($v[1],
array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) {
$errorMsg["value[$v[3]][$v[4]]"] = ts("Please enter a value.");
}
elseif ($type == 'Date' && !trim($v[2])) {
$errorMsg["value[$v[3]][$v[4]]"] = ts("Please enter a value.");
}
elseif ($type == 'Date' && !trim($v[2])) {
- $inVal = trim($v[2]);
- //checking for format to avoid db errors
- if ($type == 'Int') {
- if (!preg_match('/^[(]([A-Za-z0-9\,]+)[)]$/', $inVal)) {
- $errorMsg["value[$v[3]][$v[4]]"] = ts("Please enter correct Data (in valid format).");
+ if (!is_array($v[2])) {
+ $inVal = trim($v[2]);
+ //checking for format to avoid db errors
+ if ($type == 'Int') {
+ if (!preg_match('/^[(]([A-Za-z0-9\,]+)[)]$/', $inVal)) {
+ $errorMsg["value[$v[3]][$v[4]]"] = ts("Please enter correct Data (in valid format).");
+ }
- }
- else {
- if (!(substr($inVal, 0, 1) == '(' && substr($inVal, -1, 1) == ')') && !preg_match('/^[(]([A-Za-z0-9åäöÅÄÖüÜœŒæÆøØ\,\s]+)[)]$/', $inVal)) {
- $errorMsg["value[$v[3]][$v[4]]"] = ts("Please enter correct Data (in valid format).");
+ else {
+ if (!(substr($inVal, 0, 1) == '(' && substr($inVal, -1, 1) == ')') && !preg_match('/^[(]([A-Za-z0-9åäöÅÄÖüÜœŒæÆøØ\,\s]+)[)]$/', $inVal)) {
+ $errorMsg["value[$v[3]][$v[4]]"] = ts("Please enter correct Data (in valid format).");
+ }
- $parenValues = explode(',', trim($inVal, "(..)"));
+ $parenValues = is_array($v[2]) ? $v[2] : explode(',', trim($inVal, "(..)"));
'member_is_pay_later' => 'yesno',
'is_override' => 'yesno',
);
'member_is_pay_later' => 'yesno',
'is_override' => 'yesno',
);
- $entities = array('contact', 'address', 'activity', 'participant', 'pledge', 'member', 'contribution');
+ $entities = array('contact', 'address', 'activity', 'participant', 'pledge', 'member', 'contribution', 'case', 'grant');
CRM_Contact_BAO_Query_Hook::singleton()->alterSearchBuilderOptions($entities, $options);
foreach ($entities as $entity) {
$fields = civicrm_api3($entity, 'getfields');
foreach ($fields['values'] as $field => $info) {
if (!empty($info['options']) || !empty($info['pseudoconstant']) || !empty($info['option_group_id'])) {
$options[$field] = $entity;
CRM_Contact_BAO_Query_Hook::singleton()->alterSearchBuilderOptions($entities, $options);
foreach ($entities as $entity) {
$fields = civicrm_api3($entity, 'getfields');
foreach ($fields['values'] as $field => $info) {
if (!empty($info['options']) || !empty($info['pseudoconstant']) || !empty($info['option_group_id'])) {
$options[$field] = $entity;
if (substr($field, -3) == '_id') {
$options[substr($field, 0, -3)] = $entity;
}
}
if (substr($field, -3) == '_id') {
$options[substr($field, 0, -3)] = $entity;
}
}
elseif (in_array(substr($field, 0, 3), array('is_', 'do_')) || CRM_Utils_Array::value('data_type', $info) == 'Boolean') {
$options[$field] = 'yesno';
if ($entity != 'contact') {
elseif (in_array(substr($field, 0, 3), array('is_', 'do_')) || CRM_Utils_Array::value('data_type', $info) == 'Boolean') {
$options[$field] = 'yesno';
if ($entity != 'contact') {