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
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
98446605
Commit
98446605
authored
8 years ago
by
Erik Hommel
Browse files
Options
Downloads
Patches
Plain Diff
fix #77 add user friendly text for count type in count specific amount
parent
ffb08477
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/CivirulesConditions/Contribution/SpecificAmount.php
+28
-6
28 additions, 6 deletions
CRM/CivirulesConditions/Contribution/SpecificAmount.php
with
28 additions
and
6 deletions
CRM/CivirulesConditions/Contribution/SpecificAmount.php
+
28
−
6
View file @
98446605
...
...
@@ -86,7 +86,7 @@ class CRM_CivirulesConditions_Contribution_SpecificAmount extends CRM_Civirules_
* @param array $contribution
* @access protected
*/
pr
otec
te
d
function
buildWhereClauses
(
$contribution
)
{
pr
iva
te
function
buildWhereClauses
(
$contribution
)
{
$this
->
whereClauses
[]
=
'contribution_status_id = %1'
;
$this
->
whereParams
[
1
]
=
array
(
CRM_Civirules_Utils
::
getContributionStatusIdWithName
(
'Completed'
),
'Integer'
);
$this
->
whereClauses
[]
=
'is_test = %2'
;
...
...
@@ -121,12 +121,11 @@ class CRM_CivirulesConditions_Contribution_SpecificAmount extends CRM_Civirules_
/**
* Method to get the operator
*
* @param int $operatorId
* @return string
* @access protected
*/
pr
otec
te
d
function
setOperator
(
$operatorId
)
{
switch
(
$operator
Id
)
{
pr
iva
te
function
setOperator
()
{
switch
(
$
this
->
conditionParams
[
'count_
operator
'
]
)
{
case
1
:
return
"!="
;
break
;
...
...
@@ -148,6 +147,28 @@ class CRM_CivirulesConditions_Contribution_SpecificAmount extends CRM_Civirules_
}
}
/**
* Method to set a text for the count type condition param
*
* @return string
* @access private
*/
private
function
setCountType
()
{
$result
=
""
;
switch
(
$this
->
conditionParams
[
'count_type'
])
{
case
0
:
$result
=
"contributions that are not part of a recurring contribution"
;
break
;
case
1
:
$result
=
"contributions that are part of a recurring contribution"
;
break
;
case
2
:
$result
=
"all contributions (one-off and recurring)"
;
break
;
}
return
$result
;
}
/**
* Returns a redirect url to extra data input from the user after adding a condition
*
...
...
@@ -171,8 +192,9 @@ class CRM_CivirulesConditions_Contribution_SpecificAmount extends CRM_Civirules_
*/
public
function
userFriendlyConditionParams
()
{
$operator
=
null
;
$countOperator
=
$this
->
setOperator
(
$this
->
conditionParams
[
'count_operator'
]);
$formattedString
=
'Number of contributions '
.
$countOperator
.
' '
.
$this
->
conditionParams
[
'no_of_contributions'
];
$countOperator
=
$this
->
setOperator
();
$countType
=
$this
->
setCountType
();
$formattedString
=
'Number of '
.
$countType
.
' '
.
$countOperator
.
' '
.
$this
->
conditionParams
[
'no_of_contributions'
];
if
(
!
empty
(
$this
->
conditionParams
[
'financial_type'
]))
{
$financialType
=
new
CRM_Financial_BAO_FinancialType
();
$financialType
->
id
=
$this
->
conditionParams
[
'financial_type'
];
...
...
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