From d7e297be5b034e2156b9788b1da2831c7895491f Mon Sep 17 00:00:00 2001 From: Debarshi Bhaumik Date: Wed, 16 Jan 2019 14:52:50 +0530 Subject: [PATCH] C51-384: Added case tokens on Email Modal --- CRM/Contact/Form/Task/Email.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CRM/Contact/Form/Task/Email.php b/CRM/Contact/Form/Task/Email.php index 08556492b2..a76d241964 100644 --- a/CRM/Contact/Form/Task/Email.php +++ b/CRM/Contact/Form/Task/Email.php @@ -164,6 +164,13 @@ class CRM_Contact_Form_Task_Email extends CRM_Contact_Form_Task { */ public function listTokens() { $tokens = CRM_Core_SelectValues::contactTokens(); + + if (isset($this->_caseId) || isset($this->_caseIds)) { + // For a single case, list tokens relevant for only that case type + $caseTypeId = isset($this->_caseId) ? CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case', $this->_caseId, 'case_type_id') : NULL; + $tokens += CRM_Core_SelectValues::caseTokens($caseTypeId); + } + return $tokens; } -- 2.25.1