Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
justinfreeman (Agileware)
Core
Commits
2d5eed48
Commit
2d5eed48
authored
12 years ago
by
Kurund Jalmi
Browse files
Options
Downloads
Plain Diff
Merge pull request #48 from dlobo/CRM-11435
fix CRM-11435
parents
6b79f0fa
49f68a22
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Event/BAO/Event.php
+21
-0
21 additions, 0 deletions
CRM/Event/BAO/Event.php
CRM/Event/Form/ManageEvent.php
+18
-0
18 additions, 0 deletions
CRM/Event/Form/ManageEvent.php
with
39 additions
and
0 deletions
CRM/Event/BAO/Event.php
+
21
−
0
View file @
2d5eed48
...
...
@@ -2006,5 +2006,26 @@ LEFT JOIN civicrm_price_field_value value ON ( value.id = lineItem.price_field
$defaults
=
array
();
return
CRM_Event_BAO_Event
::
retrieve
(
$params
,
$defaults
);
}
/*
* Update the Campaign Id of all the participants of the given event
*
* @params int $eventID event id.
* @params int $eventCampaignID campaign id of that event
*
*/
static
function
updateParticipantCampaignID
(
$eventID
,
$eventCampaignID
)
{
$params
=
array
();
$params
[
1
]
=
array
(
$eventID
,
'Integer'
);
if
(
empty
(
$eventCampaignID
))
{
$query
=
"UPDATE civicrm_participant SET campaign_id = NULL WHERE event_id = %1"
;
}
else
{
$query
=
"UPDATE civicrm_participant SET campaign_id = %2 WHERE event_id = %1"
;
$params
[
2
]
=
array
(
$eventCampaignID
,
'Integer'
);
}
CRM_Core_DAO
::
executeQuery
(
$query
,
$params
);
}
}
This diff is collapsed.
Click to expand it.
CRM/Event/Form/ManageEvent.php
+
18
−
0
View file @
2d5eed48
...
...
@@ -79,6 +79,12 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
protected
$_cancelURL
=
NULL
;
/**
* The campaign id of the existing event, we use this to know if we need to update
* the participant records
*/
protected
$_campaignID
=
NULL
;
/**
* Function to set variables up before form is built
*
...
...
@@ -214,6 +220,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
if
(
isset
(
$this
->
_id
))
{
$params
=
array
(
'id'
=>
$this
->
_id
);
CRM_Event_BAO_Event
::
retrieve
(
$params
,
$defaults
);
$this
->
_campaignID
=
CRM_Utils_Array
::
value
(
'campaign_id'
,
$defaults
);
}
elseif
(
$this
->
_templateId
)
{
$params
=
array
(
'id'
=>
$this
->
_templateId
);
...
...
@@ -333,6 +341,16 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
array
(
1
=>
(
$subPage
==
'friend'
)
?
'Friend'
:
$className
)
),
ts
(
'Saved'
),
'success'
);
$config
=
CRM_Core_Config
::
singleton
();
if
(
in_array
(
'CiviCampaign'
,
$config
->
enableComponents
))
{
$values
=
$this
->
controller
->
exportValues
(
$this
->
_name
);
$newCampaignID
=
CRM_Utils_Array
::
value
(
'campaign_id'
,
$values
);
$eventID
=
CRM_Utils_Array
::
value
(
'id'
,
$values
);
if
(
$eventID
&&
$this
->
_campaignID
!=
$newCampaignID
)
{
CRM_Event_BAO_Event
::
updateParticipantCampaignID
(
$eventID
,
$newCampaignID
);
}
}
$this
->
postProcessHook
();
if
(
$this
->
controller
->
getButtonName
(
'submit'
)
==
"_qf_
{
$className
}
_upload_done"
)
{
...
...
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