From 8867b911734050261d9325c528315f370707f8c9 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 7 Jun 2018 14:39:08 -0400 Subject: [PATCH] dev/core#165 - Fix case activity breadcrumb When opening a case activity (without popups) this will correctly set the breadcrumb. --- CRM/Case/Form/ActivityView.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CRM/Case/Form/ActivityView.php b/CRM/Case/Form/ActivityView.php index e18b086d19..16247cda22 100644 --- a/CRM/Case/Form/ActivityView.php +++ b/CRM/Case/Form/ActivityView.php @@ -172,6 +172,38 @@ class CRM_Case_Form_ActivityView extends CRM_Core_Form { $recentContactDisplay, $recentOther ); + + // Set breadcrumb to take the user back to the case being viewed + $caseTypeId = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case', $caseID, 'case_type_id'); + $caseType = CRM_Core_PseudoConstant::getLabel('CRM_Case_BAO_Case', 'case_type_id', $caseTypeId); + $caseContact = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseContact', $caseID, 'contact_id', 'case_id'); + + CRM_Utils_System::resetBreadCrumb(); + $breadcrumb = [ + [ + 'title' => ts('Home'), + 'url' => CRM_Utils_System::url(), + ], + [ + 'title' => ts('CiviCRM'), + 'url' => CRM_Utils_System::url('civicrm', 'reset=1'), + ], + [ + 'title' => ts('CiviCase Dashboard'), + 'url' => CRM_Utils_System::url('civicrm/case', 'reset=1'), + ], + [ + 'title' => $caseType, + 'url' => CRM_Utils_System::url('civicrm/contact/view/case', [ + 'reset' => 1, + 'id' => $caseID, + 'context' => 'case', + 'action' => 'view', + 'cid' => $caseContact, + ]), + ], + ]; + CRM_Utils_System::appendBreadCrumb($breadcrumb); } } -- 2.25.1