From 620d09f0032d129b4401fdc8c2b1b188a1c477f9 Mon Sep 17 00:00:00 2001 From: "Matthew Wire (MJW Consulting)" Date: Sun, 26 May 2019 13:01:34 +0100 Subject: [PATCH] Add function to get 'view only' activity types --- CRM/Activity/BAO/Activity.php | 15 +++++++++++++++ CRM/Case/Selector/Search.php | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 2a999323cd..a18061ae96 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -2482,6 +2482,21 @@ INNER JOIN civicrm_option_group grp ON (grp.id = option_group_id AND grp.name = return FALSE; } + /** + * Get the list of view only activities + * + * @return array + */ + public static function getViewOnlyActivityTypeIDs() { + $viewOnlyActivities = [ + 'Email' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Email'), + ]; + if (self::checkEditInboundEmailsPermissions()) { + $viewOnlyActivities['Inbound Email'] = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Inbound Email'); + } + return $viewOnlyActivities; + } + /** * Wrapper for ajax activity selector. * diff --git a/CRM/Case/Selector/Search.php b/CRM/Case/Selector/Search.php index c1a4e68536..e34a3cc5fe 100644 --- a/CRM/Case/Selector/Search.php +++ b/CRM/Case/Selector/Search.php @@ -43,6 +43,13 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base { */ public static $_links = NULL; + /** + * The action links that we need to display for the browse screen. + * + * @var array + */ + private static $_actionLinks; + /** * We use desc to remind us what that column is, name is used in the tpl * -- 2.25.1