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
139be6ab
Unverified
Commit
139be6ab
authored
4 years ago
by
Seamus Lee
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #18445 from eileenmcnaughton/activity
[Ref] Code simplification - remove conditional chunk
parents
d6155023
fba045e1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Activity/BAO/Activity.php
+5
-11
5 additions, 11 deletions
CRM/Activity/BAO/Activity.php
with
5 additions
and
11 deletions
CRM/Activity/BAO/Activity.php
+
5
−
11
View file @
139be6ab
...
...
@@ -1699,16 +1699,10 @@ WHERE activity.id IN ($activityIds)";
$params
=
[]
)
{
$date
=
date
(
'YmdHis'
);
if
(
$activity
->
__table
==
'civicrm_
membership
'
)
{
$
component
=
'Membership
'
;
if
(
$activity
->
__table
==
=
'civicrm_
participant'
&&
$activityType
!==
'Email
'
)
{
$
activityType
=
'Event Registration
'
;
}
elseif
(
$activity
->
__table
==
'civicrm_participant'
)
{
if
(
$activityType
!=
'Email'
)
{
$activityType
=
'Event Registration'
;
}
$component
=
'Event'
;
}
elseif
(
$activity
->
__table
==
'civicrm_contribution'
)
{
if
(
$activity
->
__table
==
'civicrm_contribution'
)
{
// create activity record only for Completed Contributions
$contributionCompletedStatusId
=
CRM_Core_PseudoConstant
::
getKey
(
'CRM_Contribute_BAO_Contribution'
,
'contribution_status_id'
,
'Completed'
);
if
(
$activity
->
contribution_status_id
!=
$contributionCompletedStatusId
)
{
...
...
@@ -1718,7 +1712,7 @@ WHERE activity.id IN ($activityIds)";
}
$params
[
'status_id'
]
=
CRM_Core_PseudoConstant
::
getKey
(
'CRM_Activity_BAO_Activity'
,
'activity_status_id'
,
'Scheduled'
);
}
$activityType
=
$component
=
'Contribution'
;
$activityType
=
'Contribution'
;
// retrieve existing activity based on source_record_id and activity_type
if
(
empty
(
$params
[
'id'
]))
{
...
...
@@ -1772,7 +1766,7 @@ WHERE activity.id IN ($activityIds)";
// @todo - use api - remove lots of wrangling above. Remove deprecated fatal & let form layer
// deal with any exceptions.
if
(
is_a
(
self
::
create
(
$activityParams
),
'CRM_Core_Error'
))
{
throw
new
CRM_Core_Exception
(
"Failed creating Activity
for
$component
of
id
{
$activity
->
id
}
"
);
throw
new
CRM_Core_Exception
(
"Failed creating Activity
of type
$activityType
for entity
id
{
$activity
->
id
}
"
);
}
}
...
...
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