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 3d099d0094..09cc395e5b 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -579,7 +579,7 @@ LEFT JOIN civicrm_option_group aog ON aog.name='activity_type' $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 a3702fe9f2..21ef6a32e6 100644 --- a/CRM/Case/Info.php +++ b/CRM/Case/Info.php @@ -212,15 +212,12 @@ class CRM_Case_Info extends CRM_Core_Component_Info { 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'), ), -- 2.25.1