From 972a604273f6bbdcaae8dc60b131b9be307d0fb9 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 27 Apr 2017 11:37:45 +1200 Subject: [PATCH] CRM-20424 remove call to deprecated function. This is the one covering the UI with errors. The fact it did not cause any test fails means it is not covered by unit tests :-(. As long as the Open Case link is still present for CiviCase users this is working --- CRM/Case/BAO/Case.php | 2 +- CRM/Case/Info.php | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index 3d099d009473..09cc395e5bd7 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -579,7 +579,7 @@ public static function getCases($allCases = TRUE, $userID = NULL, $type = 'upcom $condition .= " AND case_relationship.contact_id_b = {$userID} "; } if ($type == 'upcoming' || $type == 'any') { - $closedId = CRM_Core_OptionGroup::getValue('case_status', 'Closed', 'name'); + $closedId = CRM_Core_PseudoConstant::getKey('CRM_Case_BAO_Case', 'case_status_id', 'Closed'); $condition .= " AND civicrm_case.status_id != $closedId"; } diff --git a/CRM/Case/Info.php b/CRM/Case/Info.php index a3702fe9f2b3..21ef6a32e620 100644 --- a/CRM/Case/Info.php +++ b/CRM/Case/Info.php @@ -212,15 +212,12 @@ public function creatNewShortcut(&$shortCuts) { if (CRM_Core_Permission::check('access all cases and activities') || CRM_Core_Permission::check('add cases') ) { - $atype = CRM_Core_OptionGroup::getValue('activity_type', - 'Open Case', - 'name' - ); - if ($atype) { + $activityType = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Open Case'); + if ($activityType) { $shortCuts = array_merge($shortCuts, array( array( 'path' => 'civicrm/case/add', - 'query' => "reset=1&action=add&atype=$atype&context=standalone", + 'query' => "reset=1&action=add&atype={$activityType}&context=standalone", 'ref' => 'new-case', 'title' => ts('Case'), ),