Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dataprocessor
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
Extensions
dataprocessor
Commits
c725c98c
Commit
c725c98c
authored
1 year ago
by
jaapjansma
Browse files
Options
Downloads
Patches
Plain Diff
Fix for permission to view contact filter.
parent
beb42d01
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
Civi/DataProcessor/FilterHandler/PermissionToViewContactFilter.php
+10
-20
10 additions, 20 deletions
...Processor/FilterHandler/PermissionToViewContactFilter.php
with
10 additions
and
20 deletions
Civi/DataProcessor/FilterHandler/PermissionToViewContactFilter.php
+
10
−
20
View file @
c725c98c
...
...
@@ -26,15 +26,6 @@ class PermissionToViewContactFilter extends AbstractFieldFilterHandler {
$this
->
initializeField
(
$this
->
configuration
[
'datasource'
],
$this
->
configuration
[
'field'
]);
}
/**
* Sets the default filter.
*
* @throws \Exception
*/
public
function
setDefaultFilterValues
()
{
$this
->
setFilter
([]);
}
/**
* @param array $filter
* The filter settings
...
...
@@ -43,7 +34,7 @@ class PermissionToViewContactFilter extends AbstractFieldFilterHandler {
public
function
setFilter
(
$filter
)
{
$this
->
resetFilter
();
$dataFlow
=
$this
->
dataSource
->
ensureField
(
$this
->
inputFieldSpecification
);
$where
=
$this
->
getAclWhereClause
();
$where
=
$this
->
getAclWhereClause
(
$filter
[
'value'
]
);
$contactTableAlias
=
'civicrm_contact_'
.
$this
->
inputFieldSpecification
->
alias
;
$where
=
str_replace
([
"`contact_a`."
,
"contact_a."
],
"`
{
$contactTableAlias
}
`."
,
$where
);
if
(
$where
)
{
...
...
@@ -65,10 +56,10 @@ class PermissionToViewContactFilter extends AbstractFieldFilterHandler {
}
}
protected
function
getAclWhereClause
()
{
protected
function
getAclWhereClause
(
$contactId
=
null
)
{
$tables
=
array
();
$whereTables
=
array
();
$where
=
\CRM_ACL_API
::
whereClause
(
\CRM_ACL_API
::
VIEW
,
$tables
,
$whereTables
,
NULL
,
FALSE
,
TRUE
,
FALSE
);
$where
=
\CRM_ACL_API
::
whereClause
(
\CRM_ACL_API
::
VIEW
,
$tables
,
$whereTables
,
$contactId
,
FALSE
,
TRUE
,
FALSE
);
return
$where
;
}
...
...
@@ -131,17 +122,16 @@ class PermissionToViewContactFilter extends AbstractFieldFilterHandler {
}
/**
* Add the elements to the filter form.
* Get a list of possible operator options.
*
* @param \Civi\DataProcessor\DataSpecification\FieldSpecification $fieldSpec
*
* @param \CRM_Core_Form $form
* @param array $defaultFilterValue
* @param string $size
* Possible values: full or compact
* @return array
* Return variables belonging to this filter.
*/
public
function
addToFilterForm
(
\CRM_Core_Form
$form
,
$defaultFilterValue
,
$size
=
'full'
)
{
return
null
;
// This filter has no additional options to select.
protected
function
getOperatorOptions
(
\Civi\DataProcessor\DataSpecification\FieldSpecification
$fieldSpec
)
{
return
[
'='
=>
E
::
ts
(
'Is equal'
),
];
}
...
...
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