Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
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
Development
CiviCRM Core
Commits
8d4fd06d
Unverified
Commit
8d4fd06d
authored
2 years ago
by
colemanw
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #24270 from eileenmcnaughton/pseudos
Fix use of legacy pseudoConstant methods
parents
bb4e0db7
b9e1e20d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Contribute/PseudoConstant.php
+6
-0
6 additions, 0 deletions
CRM/Contribute/PseudoConstant.php
CRM/Member/Page/RecurringContributions.php
+1
-2
1 addition, 2 deletions
CRM/Member/Page/RecurringContributions.php
CRM/Report/Form/Member/Detail.php
+12
-16
12 additions, 16 deletions
CRM/Report/Form/Member/Detail.php
with
19 additions
and
18 deletions
CRM/Contribute/PseudoConstant.php
+
6
−
0
View file @
8d4fd06d
...
...
@@ -289,6 +289,12 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
*
* @param int $id
* @param string $columnName
* @deprecated use standard methods like
* CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contributionStatusID);
* CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contributionStatusID);
* CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $contributionStatusID);
* & don't specify 'CRM_Contribute_BAO_Contribution' if you mean 'CRM_Contribute_BAO_ContributionRecur' ...
*
* @return array
* array reference of all contribution statuses
*/
...
...
This diff is collapsed.
Click to expand it.
CRM/Member/Page/RecurringContributions.php
+
1
−
2
View file @
8d4fd06d
...
...
@@ -76,7 +76,6 @@ class CRM_Member_Page_RecurringContributions extends CRM_Core_Page {
'membership_id'
=>
$membershipID
,
]);
$recurringContributions
=
[];
$contributionStatuses
=
CRM_Contribute_PseudoConstant
::
contributionStatus
(
NULL
,
'label'
);
foreach
(
$result
[
'values'
]
as
$payment
)
{
$recurringContributionID
=
(
int
)
$payment
[
'contribution_id.contribution_recur_id.id'
];
...
...
@@ -96,7 +95,7 @@ class CRM_Member_Page_RecurringContributions extends CRM_Core_Page {
$recurringContributions
[
$recurringContributionID
][
'id'
]
=
$recurringContributionID
;
$recurringContributions
[
$recurringContributionID
][
'contactId'
]
=
$contactID
;
$recurringContributions
[
$recurringContributionID
][
'contribution_status'
]
=
$
contribution
S
tatus
es
[
$contributionStatusID
]
??
NULL
;
$recurringContributions
[
$recurringContributionID
][
'contribution_status'
]
=
CRM_Core_PseudoConstant
::
getLabel
(
'CRM_Contribute_BAO_ContributionRecur'
,
'
contribution
_s
tatus
_id'
,
$contributionStatusID
)
;
$this
->
setActionsForRecurringContribution
(
$recurringContributionID
,
$recurringContributions
[
$recurringContributionID
]);
}
...
...
This diff is collapsed.
Click to expand it.
CRM/Report/Form/Member/Detail.php
+
12
−
16
View file @
8d4fd06d
...
...
@@ -277,7 +277,7 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form {
}
}
public
function
from
()
{
public
function
from
()
:
void
{
$this
->
setFromBase
(
'civicrm_contact'
);
$this
->
_from
.
=
"
{
$this
->
_aclFrom
}
...
...
@@ -312,7 +312,7 @@ HERESQL;
* Override to add handling for autorenew status.
*/
public
function
whereClause
(
&
$field
,
$op
,
$value
,
$min
,
$max
)
{
if
(
$field
[
'dbAlias'
]
==
"
{
$this
->
_aliases
[
'civicrm_contribution_recur'
]
}
.contribution_status_id"
)
{
if
(
$field
[
'dbAlias'
]
==
=
"
{
$this
->
_aliases
[
'civicrm_contribution_recur'
]
}
.contribution_status_id"
)
{
$clauseParts
=
[];
switch
(
$op
)
{
case
'in'
:
...
...
@@ -378,7 +378,7 @@ HERESQL;
public
function
getOperationPair
(
$type
=
"string"
,
$fieldName
=
NULL
)
{
//re-name IS NULL/IS NOT NULL for clarity
if
(
$fieldName
==
'owner_membership_id'
)
{
if
(
$fieldName
==
=
'owner_membership_id'
)
{
$result
=
[];
$result
[
'nll'
]
=
ts
(
'Primary members only'
);
$result
[
'nnll'
]
=
ts
(
'Non-primary members only'
);
...
...
@@ -404,14 +404,10 @@ HERESQL;
* @param array $rows
* Rows generated by SQL, with an array for each row.
*/
public
function
alterDisplay
(
&
$rows
)
{
public
function
alterDisplay
(
&
$rows
)
:
void
{
$entryFound
=
FALSE
;
$checkList
=
[];
$contributionTypes
=
CRM_Contribute_PseudoConstant
::
financialType
();
$contributionStatus
=
CRM_Contribute_PseudoConstant
::
contributionStatus
(
NULL
,
'label'
);
$paymentInstruments
=
CRM_Contribute_PseudoConstant
::
paymentInstrument
();
$repeatFound
=
FALSE
;
foreach
(
$rows
as
$rowNum
=>
$row
)
{
if
(
$repeatFound
==
FALSE
||
...
...
@@ -420,7 +416,7 @@ HERESQL;
unset
(
$checkList
);
$checkList
=
[];
}
if
(
!
empty
(
$this
->
_noRepeats
)
&&
$this
->
_outputMode
!=
'csv'
)
{
if
(
!
empty
(
$this
->
_noRepeats
)
&&
$this
->
_outputMode
!=
=
'csv'
)
{
// not repeat contact display names if it matches with the one
// in previous row
foreach
(
$row
as
$colName
=>
$colVal
)
{
...
...
@@ -431,10 +427,10 @@ HERESQL;
(
!
empty
(
$checkList
[
$colName
])
&&
in_array
(
$colVal
,
$checkList
[
$colName
]))
)
{
$rows
[
$rowNum
][
$colName
]
=
""
;
$rows
[
$rowNum
][
$colName
]
=
''
;
// CRM-15917: Don't blank the name if it's a different contact
if
(
$colName
==
'civicrm_contact_exposed_id'
)
{
$rows
[
$rowNum
][
'civicrm_contact_sort_name'
]
=
""
;
if
(
$colName
==
=
'civicrm_contact_exposed_id'
)
{
$rows
[
$rowNum
][
'civicrm_contact_sort_name'
]
=
''
;
}
$repeatFound
=
$rowNum
;
}
...
...
@@ -466,19 +462,19 @@ HERESQL;
}
if
(
$value
=
CRM_Utils_Array
::
value
(
'civicrm_contribution_financial_type_id'
,
$row
))
{
$rows
[
$rowNum
][
'civicrm_contribution_financial_type_id'
]
=
$contributionTypes
[
$value
]
;
$rows
[
$rowNum
][
'civicrm_contribution_financial_type_id'
]
=
CRM_Core_PseudoConstant
::
getLabel
(
'CRM_Contribute_BAO_Contribution'
,
'financial_type_id'
,
$value
)
;
$entryFound
=
TRUE
;
}
if
(
$value
=
CRM_Utils_Array
::
value
(
'civicrm_contribution_contribution_status_id'
,
$row
))
{
$rows
[
$rowNum
][
'civicrm_contribution_contribution_status_id'
]
=
$
contribution
S
tatus
[
$value
]
;
$rows
[
$rowNum
][
'civicrm_contribution_contribution_status_id'
]
=
CRM_Core_PseudoConstant
::
getLabel
(
'CRM_Contribute_BAO_Contribution'
,
'
contribution
_s
tatus
_id'
,
$value
)
;
$entryFound
=
TRUE
;
}
if
(
$value
=
CRM_Utils_Array
::
value
(
'civicrm_contribution_payment_instrument_id'
,
$row
))
{
$rows
[
$rowNum
][
'civicrm_contribution_payment_instrument_id'
]
=
$
payment
I
nstrument
s
[
$value
]
;
$rows
[
$rowNum
][
'civicrm_contribution_payment_instrument_id'
]
=
CRM_Core_PseudoConstant
::
getLabel
(
'CRM_Contribute_BAO_Contribution'
,
'
payment
_i
nstrument
_id'
,
$value
)
;
$entryFound
=
TRUE
;
}
if
(
$value
=
$row
[
'civicrm_contribution_recur_autorenew_status_id'
]
??
NULL
)
{
$rows
[
$rowNum
][
'civicrm_contribution_recur_autorenew_status_id'
]
=
$
contribution
S
tatus
[
$value
]
;
$rows
[
$rowNum
][
'civicrm_contribution_recur_autorenew_status_id'
]
=
CRM_Core_PseudoConstant
::
getLabel
(
'CRM_Contribute_BAO_ContributionRecur'
,
'
contribution
_s
tatus
_id'
,
$value
)
;
if
(
!
empty
(
$row
[
'civicrm_contribution_recur_end_date'
])
&&
strtotime
(
$row
[
'civicrm_contribution_recur_end_date'
])
<
time
())
{
$ended
=
ts
(
'ended'
);
...
...
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