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
3cf2f2b0
Unverified
Commit
3cf2f2b0
authored
2 years ago
by
Seamus Lee
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #23904 from eileenmcnaughton/grant
#3503
,
#3492
Fix grant exports and relative dates
parents
45aade24
fe822a6a
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/Contact/BAO/Query/Hook.php
+17
-0
17 additions, 0 deletions
CRM/Contact/BAO/Query/Hook.php
CRM/Core/BAO/Mapping.php
+4
-1
4 additions, 1 deletion
CRM/Core/BAO/Mapping.php
ext/civigrant/CRM/Grant/BAO/Query.php
+14
-5
14 additions, 5 deletions
ext/civigrant/CRM/Grant/BAO/Query.php
with
35 additions
and
6 deletions
CRM/Contact/BAO/Query/Hook.php
+
17
−
0
View file @
3cf2f2b0
...
...
@@ -65,6 +65,23 @@ class CRM_Contact_BAO_Query_Hook {
return
$extFields
;
}
/**
* Get the fields that are available in the 'contact context'.
*
* For example exporting contacts should not include fields for grants etc.
*
* @return array
*/
public
function
getContactFields
():
array
{
$extFields
=
[];
foreach
(
$this
->
getSearchQueryObjects
()
as
$obj
)
{
// Get Fields is ambiguous about the
$fields
=
method_exists
(
$obj
,
'getContactFields'
)
?
$obj
->
getContactFields
()
:
$obj
->
getFields
();
$extFields
=
array_merge
(
$extFields
,
$fields
);
}
return
$extFields
;
}
/**
* @param $apiEntities
* @param $fieldOptions
...
...
This diff is collapsed.
Click to expand it.
CRM/Core/BAO/Mapping.php
+
4
−
1
View file @
3cf2f2b0
...
...
@@ -611,7 +611,10 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping implements \Civi\Core\Ho
else
{
$contactFields
=
CRM_Contact_BAO_Contact
::
exportableFields
(
$contactType
,
FALSE
,
TRUE
);
}
$contactFields
=
array_merge
(
$contactFields
,
CRM_Contact_BAO_Query_Hook
::
singleton
()
->
getFields
());
// It's unclear when we would want this but.... see
// https://lab.civicrm.org/dev/core/-/issues/3069 for when we don't....
$contactFields
=
array_merge
(
$contactFields
,
CRM_Contact_BAO_Query_Hook
::
singleton
()
->
getContactFields
());
// Exclude the address options disabled in the Address Settings
$fields
[
$contactType
]
=
CRM_Core_BAO_Address
::
validateAddressOptions
(
$contactFields
);
...
...
This diff is collapsed.
Click to expand it.
ext/civigrant/CRM/Grant/BAO/Query.php
+
14
−
5
View file @
3cf2f2b0
...
...
@@ -17,16 +17,25 @@ use CRM_Grant_ExtensionUtil as E;
class
CRM_Grant_BAO_Query
extends
CRM_Contact_BAO_Query_Interface
{
/**
*
Unused
.
*
Get available fields
.
*
*
This function is meant to return extra contact fields, but grants are not contact
s.
*
Important for exports & relative date filter
s.
*
* @return array
*/
public
function
&
getFields
()
{
$fields
=
[];
return
$fields
;
// return CRM_Grant_BAO_Grant::exportableFields();
return
CRM_Grant_BAO_Grant
::
exportableFields
();
}
/**
* Get the fields that are available in the 'contact context'.
*
* For example exporting contacts should not include fields for grants etc.
*
* @return array
*/
public
function
getContactFields
():
array
{
return
[];
}
/**
...
...
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