From: yashodha Date: Thu, 11 Apr 2013 17:29:43 +0000 (+0530) Subject: CRM-12274 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ca4567836e9ee713cd8a698490656f6f1b345777;p=civicrm-core.git CRM-12274 --- diff --git a/CRM/Campaign/BAO/Survey.php b/CRM/Campaign/BAO/Survey.php index e94fbbeb31..7e9911d9fd 100644 --- a/CRM/Campaign/BAO/Survey.php +++ b/CRM/Campaign/BAO/Survey.php @@ -1005,7 +1005,7 @@ INNER JOIN civicrm_contact contact_a ON ( activityTarget.contact_id = contact_a SELECT contact.id as id, contact.sort_name as sort_name FROM civicrm_contact contact -INNER JOIN civicrm_activity_assignment assignment ON ( assignment.assignee_contact_id = contact.id ) +INNER JOIN civicrm_activity_contact assignment ON ( assignment.contact_id = contact.id AND record_type = 'Assignee' ) INNER JOIN civicrm_activity activity ON ( activity.id = assignment.activity_id ) INNER JOIN civicrm_survey survey ON ( activity.source_record_id = survey.id ) {$whereClause}"; diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index 71ec1cac94..833279d413 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -1004,9 +1004,9 @@ SELECT case_status.label AS case_status, status_id, case_type.label AS case_type LEFT JOIN civicrm_entity_file ef on ef.entity_table = "civicrm_activity" AND ef.entity_id = ca.id LEFT OUTER JOIN civicrm_option_group og ON og.name="activity_status" LEFT OUTER JOIN civicrm_option_value ov ON ov.option_group_id=og.id AND ov.name="Scheduled" - LEFT JOIN civicrm_activity_assignment caa - ON caa.activity_id = ca.id - LEFT JOIN civicrm_contact acc ON acc.id = caa.assignee_contact_id '; + LEFT JOIN civicrm_activity_contact caa + ON caa.activity_id = ca.id AND caa.record_type = "Assignee" + LEFT JOIN civicrm_contact acc ON acc.id = caa.contact_id '; $where = 'WHERE cca.case_id= %1 AND ca.is_current_revision = 1';