Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
action-provider
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
JoeMurray
action-provider
Commits
904ca519
Commit
904ca519
authored
4 years ago
by
jaapjansma
Browse files
Options
Downloads
Patches
Plain Diff
Fixed issue with action get activity and the retrieval of the target and assignee contact ids.
parent
1edd77df
No related branches found
Branches containing commit
Tags
1.24.1
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+3
-1
3 additions, 1 deletion
CHANGELOG.md
Civi/ActionProvider/Action/Activity/GetActivity.php
+37
-0
37 additions, 0 deletions
Civi/ActionProvider/Action/Activity/GetActivity.php
info.xml
+2
-2
2 additions, 2 deletions
info.xml
with
42 additions
and
3 deletions
CHANGELOG.md
+
3
−
1
View file @
904ca519
Version 1.48
(not yet released)
Version 1.48
------------
*
Fixed issue with action get activity and the retrieval of the target and assignee contact ids.
Version 1.47
------------
...
...
This diff is collapsed.
Click to expand it.
Civi/ActionProvider/Action/Activity/GetActivity.php
+
37
−
0
View file @
904ca519
...
...
@@ -47,6 +47,43 @@ class GetActivity extends AbstractGetSingleAction {
return
$bag
;
}
/**
* Returns the specification of the output parameters of this action.
*
* This function could be overriden by child classes.
*
* @return SpecificationBag
*/
public
function
getOutputSpecification
()
{
$bag
=
parent
::
getOutputSpecification
();
$target_contact_id
=
$bag
->
getSpecificationByName
(
'target_contact_id'
);
if
(
$target_contact_id
instanceof
Specification
)
{
$target_contact_id
->
setMultiple
(
TRUE
);
}
return
$bag
;
}
protected
function
setOutputFromEntity
(
$entity
,
ParameterBagInterface
$output
)
{
parent
::
setOutputFromEntity
(
$entity
,
$output
);
$sql
=
"SELECT DISTINCT contact_id, record_type_id FROM civicrm_activity_contact WHERE activity_id = %1 AND record_type_id IN (1,3)"
;
$sqlParams
[
1
]
=
array
(
$entity
[
'id'
],
'Integer'
);
$dao
=
\CRM_Core_DAO
::
executeQuery
(
$sql
,
$sqlParams
);
$target_contact_ids
=
array
();
$assignee_contact_id
=
null
;
while
(
$dao
->
fetch
())
{
if
(
$dao
->
record_type_id
==
1
)
{
$assignee_contact_id
=
$dao
->
contact_id
;
}
elseif
(
$dao
->
record_type_id
==
3
)
{
$target_contact_ids
[]
=
$dao
->
contact_id
;
}
}
$output
->
setParameter
(
'target_contact_id'
,
$target_contact_ids
);
if
(
$assignee_contact_id
)
{
$output
->
setParameter
(
'assignee_contact_id'
,
$assignee_contact_id
);
}
}
}
This diff is collapsed.
Click to expand it.
info.xml
+
2
−
2
View file @
904ca519
...
...
@@ -13,8 +13,8 @@
<url
desc=
"Documentation"
>
https://lab.civicrm.org/jaapjansma/action-provider/wikis/home
</url>
<url
desc=
"Licensing"
>
http://www.gnu.org/licenses/agpl-3.0.html
</url>
</urls>
<releaseDate>
2021-01-2
1
</releaseDate>
<version>
1.48
-dev
</version>
<releaseDate>
2021-01-2
8
</releaseDate>
<version>
1.48
</version>
<develStage>
stable
</develStage>
<compatibility>
<ver>
4.7
</ver>
...
...
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