Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
justinfreeman (Agileware)
Core
Commits
4b20f7df
Commit
4b20f7df
authored
11 years ago
by
pratik.joshi
Browse files
Options
Downloads
Patches
Plain Diff
CRM-14010 fix : some operators handling was missing for prefered method where clause logic
parent
bc86ffa9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Contact/BAO/Query.php
+13
-4
13 additions, 4 deletions
CRM/Contact/BAO/Query.php
with
13 additions
and
4 deletions
CRM/Contact/BAO/Query.php
+
13
−
4
View file @
4b20f7df
...
@@ -3744,7 +3744,10 @@ WHERE id IN ( $groupIDs )
...
@@ -3744,7 +3744,10 @@ WHERE id IN ( $groupIDs )
list
(
$name
,
$op
,
$value
,
$grouping
,
$wildcard
)
=
$values
;
list
(
$name
,
$op
,
$value
,
$grouping
,
$wildcard
)
=
$values
;
$pref
=
array
();
$pref
=
array
();
if
(
!
is_array
(
$value
))
{
if
(
in_array
(
$op
,
array
(
'IS NULL'
,
'IS NOT NULL'
,
'IS EMPTY'
,
'IS NOT EMPTY'
)))
{
$value
=
NULL
;
}
elseif
(
!
is_array
(
$value
))
{
$v
=
array
();
$v
=
array
();
$value
=
trim
(
$value
,
' ()'
);
$value
=
trim
(
$value
,
' ()'
);
if
(
strpos
(
$value
,
CRM_Core_DAO
::
VALUE_SEPARATOR
)
!==
FALSE
)
{
if
(
strpos
(
$value
,
CRM_Core_DAO
::
VALUE_SEPARATOR
)
!==
FALSE
)
{
...
@@ -3771,10 +3774,16 @@ WHERE id IN ( $groupIDs )
...
@@ -3771,10 +3774,16 @@ WHERE id IN ( $groupIDs )
$commPref
=
CRM_Core_PseudoConstant
::
get
(
'CRM_Contact_DAO_Contact'
,
'preferred_communication_method'
);
$commPref
=
CRM_Core_PseudoConstant
::
get
(
'CRM_Contact_DAO_Contact'
,
'preferred_communication_method'
);
$sqlValue
=
array
();
$sqlValue
=
array
();
$showValue
=
array
();
$sql
=
"contact_a.preferred_communication_method"
;
$sql
=
"contact_a.preferred_communication_method"
;
foreach
(
$pref
as
$val
)
{
if
(
in_array
(
$op
,
array
(
'IS NULL'
,
'IS NOT NULL'
,
'IS EMPTY'
,
'IS NOT EMPTY'
)))
{
$sqlValue
[]
=
"(
$sql
like '%"
.
CRM_Core_DAO
::
VALUE_SEPARATOR
.
$val
.
CRM_Core_DAO
::
VALUE_SEPARATOR
.
"%' ) "
;
$sqlValue
[]
=
"
{
$sql
}
{
$op
}
"
;
$showValue
[]
=
$commPref
[
$val
];
}
else
{
foreach
(
$pref
as
$val
)
{
$sqlValue
[]
=
"(
$sql
like '%"
.
CRM_Core_DAO
::
VALUE_SEPARATOR
.
$val
.
CRM_Core_DAO
::
VALUE_SEPARATOR
.
"%' ) "
;
$showValue
[]
=
$commPref
[
$val
];
}
}
}
$this
->
_where
[
$grouping
][]
=
"( "
.
implode
(
' OR '
,
$sqlValue
)
.
" )"
;
$this
->
_where
[
$grouping
][]
=
"( "
.
implode
(
' OR '
,
$sqlValue
)
.
" )"
;
$this
->
_qill
[
$grouping
][]
=
ts
(
'Preferred Communication Method'
)
.
"
$op
"
.
implode
(
' '
.
ts
(
'or'
)
.
' '
,
$showValue
);
$this
->
_qill
[
$grouping
][]
=
ts
(
'Preferred Communication Method'
)
.
"
$op
"
.
implode
(
' '
.
ts
(
'or'
)
.
' '
,
$showValue
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment