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
4e3d3cfc
Commit
4e3d3cfc
authored
11 years ago
by
yashodha
Browse files
Options
Downloads
Patches
Plain Diff
CRM-12274
parent
ab18bf18
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/Case/BAO/Case.php
+12
-6
12 additions, 6 deletions
CRM/Case/BAO/Case.php
CRM/Report/Form/Campaign/SurveyDetails.php
+4
-4
4 additions, 4 deletions
CRM/Report/Form/Campaign/SurveyDetails.php
CRM/Report/Form/Contact/Detail.php
+30
-28
30 additions, 28 deletions
CRM/Report/Form/Contact/Detail.php
with
46 additions
and
38 deletions
CRM/Case/BAO/Case.php
+
12
−
6
View file @
4e3d3cfc
...
...
@@ -2399,11 +2399,13 @@ SELECT id
$mainCaseActivity
->
free
();
//migrate target activities.
$otherTargetActivity
=
new
CRM_Activity_DAO_Activity
Targe
t
();
$otherTargetActivity
=
new
CRM_Activity_DAO_Activity
Contac
t
();
$otherTargetActivity
->
activity_id
=
$otherActivityId
;
$otherTargetActivity
->
record_type
=
'Target'
;
$otherTargetActivity
->
find
();
while
(
$otherTargetActivity
->
fetch
())
{
$mainActivityTarget
=
new
CRM_Activity_DAO_ActivityTarget
();
$mainActivityTarget
=
new
CRM_Activity_DAO_ActivityContact
();
$mainActivityTarget
->
record_type
=
'Target'
;
$mainActivityTarget
->
activity_id
=
$mainActivityId
;
$mainActivityTarget
->
target_contact_id
=
$otherTargetActivity
->
target_contact_id
;
if
(
$mainActivityTarget
->
target_contact_id
==
$otherContactId
)
{
...
...
@@ -2418,12 +2420,14 @@ SELECT id
$otherTargetActivity
->
free
();
//migrate assignee activities.
$otherAssigneeActivity
=
new
CRM_Activity_DAO_Activity
Assignmen
t
();
$otherAssigneeActivity
=
new
CRM_Activity_DAO_Activity
Contac
t
();
$otherAssigneeActivity
->
activity_id
=
$otherActivityId
;
$otherAssigneeActivity
->
record_type
=
'Assignee'
;
$otherAssigneeActivity
->
find
();
while
(
$otherAssigneeActivity
->
fetch
())
{
$mainAssigneeActivity
=
new
CRM_Activity_DAO_Activity
Assignmen
t
();
$mainAssigneeActivity
=
new
CRM_Activity_DAO_Activity
Contac
t
();
$mainAssigneeActivity
->
activity_id
=
$mainActivityId
;
$mainAssigneeActivity
->
record_type
=
'Assignee'
;
$mainAssigneeActivity
->
assignee_contact_id
=
$otherAssigneeActivity
->
assignee_contact_id
;
if
(
$mainAssigneeActivity
->
assignee_contact_id
==
$otherContactId
)
{
$mainAssigneeActivity
->
assignee_contact_id
=
$mainContactId
;
...
...
@@ -2720,15 +2724,17 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')';
//view - contact must be source/assignee/target
$isTarget
=
$isAssignee
=
$isSource
=
FALSE
;
$target
=
new
CRM_Activity_DAO_ActivityTarget
();
$target
=
new
CRM_Activity_DAO_ActivityContact
();
$target
->
record_type
=
'Target'
;
$target
->
activity_id
=
$activityId
;
$target
->
target_contact_id
=
$contactId
;
if
(
$target
->
find
(
TRUE
))
{
$isTarget
=
TRUE
;
}
$assignee
=
new
CRM_Activity_DAO_Activity
Assignmen
t
();
$assignee
=
new
CRM_Activity_DAO_Activity
Contac
t
();
$assignee
->
activity_id
=
$activityId
;
$assignee
->
record_type
=
'Assignee'
;
$assignee
->
assignee_contact_id
=
$contactId
;
if
(
$assignee
->
find
(
TRUE
))
{
$isAssignee
=
TRUE
;
...
...
This diff is collapsed.
Click to expand it.
CRM/Report/Form/Campaign/SurveyDetails.php
+
4
−
4
View file @
4e3d3cfc
...
...
@@ -80,12 +80,12 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form {
$allSurveyInterviewers
=
CRM_Campaign_BAO_Survey
::
getInterviewers
();
$this
->
_columns
=
array
(
'civicrm_activity_
assignmen
t'
=>
'civicrm_activity_
contac
t'
=>
array
(
'dao'
=>
'CRM_Activity_DAO_Activity
Assignmen
t'
,
'fields'
=>
array
(
'
assignee_
contact_id'
=>
array
(
'title'
=>
ts
(
'Interviewer Name'
))),
'dao'
=>
'CRM_Activity_DAO_Activity
Contac
t'
,
'fields'
=>
array
(
'contact_id'
=>
array
(
'title'
=>
ts
(
'Interviewer Name'
))),
'filters'
=>
array
(
'
assignee_
contact_id'
=>
array
(
'name'
=>
'
assignee_
contact_id'
,
'contact_id'
=>
array
(
'name'
=>
'contact_id'
,
'title'
=>
ts
(
'Interviewer Name'
),
'type'
=>
CRM_Utils_Type
::
T_INT
,
'operatorType'
=>
...
...
This diff is collapsed.
Click to expand it.
CRM/Report/Form/Contact/Detail.php
+
30
−
28
View file @
4e3d3cfc
...
...
@@ -299,10 +299,10 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
),
'civicrm_activity_target'
=>
array
(
'dao'
=>
'CRM_Activity_DAO_Activity
Targe
t'
,
'dao'
=>
'CRM_Activity_DAO_Activity
Contac
t'
,
'fields'
=>
array
(
'
target_
contact_id'
=>
'contact_id'
=>
array
(
'title'
=>
ts
(
'With Contact'
),
'default'
=>
TRUE
,
),
...
...
@@ -311,10 +311,10 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
),
'civicrm_activity_assignment'
=>
array
(
'dao'
=>
'CRM_Activity_DAO_Activity
Assignmen
t'
,
'dao'
=>
'CRM_Activity_DAO_Activity
Contac
t'
,
'fields'
=>
array
(
'
assignee_
contact_id'
=>
'contact_id'
=>
array
(
'title'
=>
ts
(
'Assigned To'
),
'default'
=>
TRUE
,
),
...
...
@@ -375,13 +375,14 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
$table
[
'alias'
]
==
$this
->
_aliases
[
'civicrm_activity_assignment'
]
)
{
if
(
$table
[
'alias'
]
==
$this
->
_aliases
[
'civicrm_activity_target'
])
{
$addCotactId
=
'target
_
contact_id'
;
$addCo
n
tactId
=
'
civicrm_activity_
target
.
contact_id'
;
}
else
{
$addCotactId
=
'assign
ee_
contact_id'
;
$addCo
n
tactId
=
'
civicrm_activity_
assign
ment.
contact_id'
;
}
$tableName
=
$table
[
'alias'
];
$select
[
'activity_civireport'
][]
=
"
$tableName
.display_name as
{
$tableName
}
_
{
$fieldName
}
,
$addCotactId
"
;
$select
[
'activity_civireport'
][]
=
"
$tableName
.display_name as
{
$tableName
}
_
{
$fieldName
}
,
$addCo
n
tactId
"
;
$this
->
_columnHeadersComponent
[
'activity_civireport'
][
"
{
$tableName
}
_
{
$fieldName
}
"
][
'type'
]
=
CRM_Utils_Array
::
value
(
'type'
,
$field
);
$this
->
_columnHeadersComponent
[
'activity_civireport'
][
"
{
$tableName
}
_
{
$fieldName
}
"
][
'title'
]
=
CRM_Utils_Array
::
value
(
'title'
,
$field
);
}
...
...
@@ -472,17 +473,18 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
if
(
CRM_Utils_Array
::
value
(
'activity_civireport'
,
$this
->
_selectComponent
))
{
$this
->
_formComponent
[
'activity_civireport'
]
=
"FROM
civicrm_activity
{
$this
->
_aliases
[
'civicrm_activity'
]
}
LEFT JOIN civicrm_activity_target ON
{
$this
->
_aliases
[
'civicrm_activity'
]
}
.id = civicrm_activity_target.activity_id
LEFT JOIN civicrm_activity_assignment ON
{
$this
->
_aliases
[
'civicrm_activity'
]
}
.id = civicrm_activity_assignment.activity_id
LEFT JOIN civicrm_activity_contact civicrm_activity_target ON
{
$this
->
_aliases
[
'civicrm_activity'
]
}
.id = civicrm_activity_target.activity_id AND
civicrm_activity_target.record_type = 'Target'
LEFT JOIN civicrm_activity_contact civicrm_activity_assignment ON
{
$this
->
_aliases
[
'civicrm_activity'
]
}
.id = civicrm_activity_assignment.activity_id AND civicrm_activity_assignment.record_type = 'Assignee'
LEFT JOIN civicrm_contact sourceContact ON
{
$this
->
_aliases
[
'civicrm_activity'
]
}
.source_contact_id = sourceContact.id
LEFT JOIN civicrm_contact
{
$this
->
_aliases
[
'civicrm_activity_target'
]
}
ON
target
_
contact_id =
{
$this
->
_aliases
[
'civicrm_activity_target'
]
}
.id
LEFT JOIN civicrm_contact
{
$this
->
_aliases
[
'civicrm_activity_target'
]
}
ON
civicrm_activity_
target
.
contact_id =
{
$this
->
_aliases
[
'civicrm_activity_target'
]
}
.id
LEFT JOIN civicrm_contact
{
$this
->
_aliases
[
'civicrm_activity_assignment'
]
}
ON
assign
ee_
contact_id =
{
$this
->
_aliases
[
'civicrm_activity_assignment'
]
}
.id
civicrm_activity_
assign
ment.
contact_id =
{
$this
->
_aliases
[
'civicrm_activity_assignment'
]
}
.id
LEFT JOIN civicrm_option_value ON
(
{
$this
->
_aliases
[
'civicrm_activity'
]
}
.activity_type_id = civicrm_option_value.value )
LEFT JOIN civicrm_option_group ON
...
...
@@ -558,7 +560,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
while
(
$dao
->
fetch
())
{
$countRecord
=
0
;
$eligibleResult
[
$val
]
=
$val
;
$CC
=
"
civicrm_
"
.
substr_replace
(
$val
,
''
,
-
11
,
11
)
.
"
_contact_id
"
;
$CC
=
'
civicrm_
'
.
substr_replace
(
$val
,
''
,
-
11
,
11
)
.
'
_contact_id
'
;
$row
=
array
();
foreach
(
$this
->
_columnHeadersComponent
[
$val
]
as
$key
=>
$value
)
{
$countRecord
++
;
...
...
@@ -601,13 +603,13 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
$row
[
$key
]
=
$dao
->
$key
;
}
$relTitle
=
""
.
$dao
->
civicrm_relationship_relationship_type_id
.
"
_a_b
"
;
$relTitle
=
""
.
$dao
->
civicrm_relationship_relationship_type_id
.
'
_a_b
'
;
$row
[
'civicrm_relationship_relationship_type_id'
]
=
$relTypes
[
$relTitle
];
$rows
[
$dao
->
contact_a_id
][
$val
][]
=
$row
;
$row
[
'civicrm_relationship_contact_id_b'
]
=
$dao
->
contact_a_name
;
$relTitle
=
""
.
$dao
->
civicrm_relationship_relationship_type_id
.
"
_b_a
"
;
$relTitle
=
""
.
$dao
->
civicrm_relationship_relationship_type_id
.
'
_b_a
'
;
if
(
isset
(
$relTypes
[
$relTitle
]))
{
$row
[
'civicrm_relationship_relationship_type_id'
]
=
$relTypes
[
$relTitle
];
}
...
...
@@ -636,12 +638,12 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
sourceContact.display_name as added_by
{
$this
->
_formComponent
[
$val
]
}
WHERE (
{
$this
->
_aliases
[
'civicrm_activity'
]
}
.source_contact_id IN (
$selectedContacts
) OR
target
_
contact_id IN (
$selectedContacts
) OR
assign
ee_
contact_id IN (
$selectedContacts
) OR
civicrm_activity_
target
.
contact_id IN (
$selectedContacts
) OR
civicrm_activity_
assign
ment.
contact_id IN (
$selectedContacts
) OR
civicrm_case_contact.contact_id IN (
$selectedContacts
) ) AND
civicrm_option_group.name = 'activity_type' AND
{
$this
->
_aliases
[
'civicrm_activity'
]
}
.is_test = 0 AND
(
$componentClause
)
civicrm_option_group.name = 'activity_type' AND
{
$this
->
_aliases
[
'civicrm_activity'
]
}
.is_test = 0 AND
(
$componentClause
)
GROUP BY
{
$this
->
_aliases
[
'civicrm_activity'
]
}
.id
...
...
@@ -728,10 +730,10 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
//unset Conmponent id and contact id from display
foreach
(
$this
->
_columnHeadersComponent
as
$componentTitle
=>
$headers
)
{
$id_header
=
"
civicrm_
"
.
substr_replace
(
$componentTitle
,
''
,
-
11
,
11
)
.
"_"
.
substr_replace
(
$componentTitle
,
''
,
-
11
,
11
)
.
"
_id
"
;
$contact_header
=
"
civicrm_
"
.
substr_replace
(
$componentTitle
,
''
,
-
11
,
11
)
.
"
_contact_id
"
;
$id_header
=
'
civicrm_
'
.
substr_replace
(
$componentTitle
,
''
,
-
11
,
11
)
.
'_'
.
substr_replace
(
$componentTitle
,
''
,
-
11
,
11
)
.
'
_id
'
;
$contact_header
=
'
civicrm_
'
.
substr_replace
(
$componentTitle
,
''
,
-
11
,
11
)
.
'
_contact_id
'
;
if
(
$componentTitle
==
'activity_civireport'
)
{
$id_header
=
"
civicrm_
"
.
substr_replace
(
$componentTitle
,
''
,
-
11
,
11
)
.
"
_id
"
;
$id_header
=
'
civicrm_
'
.
substr_replace
(
$componentTitle
,
''
,
-
11
,
11
)
.
'
_id
'
;
}
unset
(
$this
->
_columnHeadersComponent
[
$componentTitle
][
$id_header
]);
...
...
@@ -759,12 +761,12 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
array_key_exists
(
'civicrm_contact_id'
,
$row
)
)
{
$url
=
CRM_Utils_System
::
url
(
"
civicrm/contact/view
"
,
$url
=
CRM_Utils_System
::
url
(
'
civicrm/contact/view
'
,
'reset=1&cid='
.
$row
[
'civicrm_contact_id'
],
$this
->
_absoluteUrl
);
$rows
[
$rowNum
][
'civicrm_contact_sort_name_link'
]
=
$url
;
$rows
[
$rowNum
][
'civicrm_contact_sort_name_hover'
]
=
ts
(
"
View Contact Summary for this Contact
"
);
$rows
[
$rowNum
][
'civicrm_contact_sort_name_hover'
]
=
ts
(
'
View Contact Summary for this Contact
'
);
$entryFound
=
TRUE
;
}
...
...
@@ -825,7 +827,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
$this
->
_absoluteUrl
,
$this
->
_id
);
$componentRows
[
$contactID
][
$component
][
$rowNum
][
'civicrm_participant_event_id_link'
]
=
$url
;
$componentRows
[
$contactID
][
$component
][
$rowNum
][
'civicrm_participant_event_id_hover'
]
=
ts
(
"
View Event Income details for this Event.
"
);
$componentRows
[
$contactID
][
$component
][
$rowNum
][
'civicrm_participant_event_id_hover'
]
=
ts
(
'
View Event Income details for this Event.
'
);
$entryFound
=
TRUE
;
}
...
...
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