Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
extensions
cc.tadpole.petitionemail
Commits
41e3e39c
Commit
41e3e39c
authored
Oct 31, 2014
by
Jamie McClelland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable matching on empty values.
parent
38254409
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
petitionemail.php
petitionemail.php
+10
-4
No files found.
petitionemail.php
View file @
41e3e39c
...
...
@@ -638,10 +638,17 @@ function petitionemail_get_recipients($contact_id, $petition_vars) {
$custom_field_id
=
str_replace
(
'custom_'
,
''
,
$matching_field
);
$dao
=
CRM_Core_DAO
::
executeQuery
(
$sql
,
array
(
0
=>
array
(
$custom_field_id
,
'Integer'
)));
$dao
->
fetch
();
$from
[]
=
"JOIN "
.
$dao
->
table_name
.
" ON "
.
$dao
->
table_name
.
".entity_id =
$from
[]
=
"
LEFT
JOIN "
.
$dao
->
table_name
.
" ON "
.
$dao
->
table_name
.
".entity_id =
c.id"
;
$where
[]
=
$dao
->
column_name
.
' = %'
.
$id
;
// Fixme - we should use the proper data type for each custom field
if
(
!
empty
(
$value
))
{
$where
[]
=
$dao
->
column_name
.
' = %'
.
$id
;
// Fixme - we should use the proper data type for each custom field
}
else
{
// Handle empty or NULL
$where
[]
=
'('
.
$dao
->
column_name
.
' = %'
.
$id
.
' OR '
.
$dao
->
column_name
.
' IS NULL)'
;
}
$params
[
$id
]
=
array
(
$value
,
'String'
);
$id
++
;
}
...
...
@@ -655,7 +662,6 @@ function petitionemail_get_recipients($contact_id, $petition_vars) {
$sql
=
"SELECT c.id, c.display_name, e.email FROM "
;
$sql
.
=
implode
(
"
\n
"
,
$from
);
$sql
.
=
" WHERE "
.
implode
(
" AND
\n
"
,
$where
);
$dao
=
CRM_Core_DAO
::
executeQuery
(
$sql
,
$params
);
while
(
$dao
->
fetch
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment