Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
civirules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
ayduns
civirules
Commits
89596af3
Commit
89596af3
authored
10 years ago
by
jaapjansma
Browse files
Options
Downloads
Patches
Plain Diff
update add primary email changed condition
parent
53abeaf8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Civirules/BAO/Condition.php
+1
-1
1 addition, 1 deletion
CRM/Civirules/BAO/Condition.php
CRM/Civirules/BAO/Rule.php
+2
-1
2 additions, 1 deletion
CRM/Civirules/BAO/Rule.php
CRM/CivirulesConditions/PrimaryEmailChanged.php
+35
-0
35 additions, 0 deletions
CRM/CivirulesConditions/PrimaryEmailChanged.php
with
38 additions
and
2 deletions
CRM/Civirules/BAO/Condition.php
+
1
−
1
View file @
89596af3
...
@@ -150,7 +150,7 @@ class CRM_Civirules_BAO_Condition extends CRM_Civirules_DAO_Condition {
...
@@ -150,7 +150,7 @@ class CRM_Civirules_BAO_Condition extends CRM_Civirules_DAO_Condition {
return
false
;
return
false
;
}
}
$className
=
$condition
->
class
N
ame
;
$className
=
$condition
->
class
_n
ame
;
if
(
!
class_exists
(
$className
))
{
if
(
!
class_exists
(
$className
))
{
if
(
$abort
)
{
if
(
$abort
)
{
...
...
This diff is collapsed.
Click to expand it.
CRM/Civirules/BAO/Rule.php
+
2
−
1
View file @
89596af3
...
@@ -164,9 +164,10 @@ class CRM_Civirules_BAO_Rule extends CRM_Civirules_DAO_Rule {
...
@@ -164,9 +164,10 @@ class CRM_Civirules_BAO_Rule extends CRM_Civirules_DAO_Rule {
$sql
=
"SELECT r.id AS rule_id, e.id AS event_id
$sql
=
"SELECT r.id AS rule_id, e.id AS event_id
FROM `civirule_rule` r
FROM `civirule_rule` r
INNER JOIN `civirule_event` e ON r.event_id = e.id AND e.is_active = 1
INNER JOIN `civirule_event` e ON r.event_id = e.id AND e.is_active = 1
WHERE r.`is_active` = 1 AND e.class_name IS NULL AND e.entity = %1 AND e.action = %2"
;
WHERE r.`is_active` = 1 AND
(
e.class_name IS NULL
OR e.class_name = '')
AND e.entity = %1 AND e.action = %2"
;
$params
[
1
]
=
array
(
$entity
,
'String'
);
$params
[
1
]
=
array
(
$entity
,
'String'
);
$params
[
2
]
=
array
(
$action
,
'String'
);
$params
[
2
]
=
array
(
$action
,
'String'
);
$dao
=
CRM_Core_DAO
::
executeQuery
(
$sql
,
$params
);
$dao
=
CRM_Core_DAO
::
executeQuery
(
$sql
,
$params
);
while
(
$dao
->
fetch
())
{
while
(
$dao
->
fetch
())
{
$rule_data
=
array
(
$rule_data
=
array
(
...
...
This diff is collapsed.
Click to expand it.
CRM/CivirulesConditions/PrimaryEmailChanged.php
0 → 100644
+
35
−
0
View file @
89596af3
<?php
class
CRM_CivirulesConditions_PrimaryEmailChanged
extends
CRM_CivirulesConditions_Generic_FieldChanged
{
/**
* Returns name of entity
*
* @return string
*/
protected
function
getEntity
()
{
return
'Email'
;
}
/**
* Returns name of the field
* @return string
*/
protected
function
getField
()
{
return
'email'
;
}
public
function
isConditionValid
(
CRM_Civirules_EventData_EventData
$eventData
)
{
$isValid
=
parent
::
isConditionValid
(
$eventData
);
if
(
$isValid
)
{
$data
=
$eventData
->
getEntityData
(
$this
->
getEntity
());
if
(
!
empty
(
$data
[
'is_primary'
]))
{
$isValid
=
true
;
}
else
{
$isValid
=
false
;
}
}
return
$isValid
;
}
}
\ No newline at end of file
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