From: omar abu hussein Date: Thu, 5 Jan 2017 10:03:03 +0000 (+0000) Subject: CRM-19832: Backporting #9637 to 4.6 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=24a9d9c70723ee0dff94439d1b3aa73100e16629;p=civicrm-core.git CRM-19832: Backporting #9637 to 4.6 --- diff --git a/CRM/Activity/Task.php b/CRM/Activity/Task.php index 1a07d53b15..1a4e20ffc7 100644 --- a/CRM/Activity/Task.php +++ b/CRM/Activity/Task.php @@ -137,9 +137,11 @@ class CRM_Activity_Task { if (!CRM_Core_Permission::check('delete activities')) { unset(self::$_tasks[1]); } + + CRM_Utils_Hook::searchTasks('activity', self::$_tasks); + asort(self::$_tasks); } - CRM_Utils_Hook::searchTasks('activity', self::$_tasks); - asort(self::$_tasks); + return self::$_tasks; } diff --git a/CRM/Campaign/Task.php b/CRM/Campaign/Task.php index 033772253c..642577c609 100755 --- a/CRM/Campaign/Task.php +++ b/CRM/Campaign/Task.php @@ -94,11 +94,10 @@ class CRM_Campaign_Task { 'result' => FALSE, ), ); - } - - CRM_Utils_Hook::searchTasks('campaign', self::$_tasks); - asort(self::$_tasks); + CRM_Utils_Hook::searchTasks('campaign', self::$_tasks); + asort(self::$_tasks); + } return self::$_tasks; } diff --git a/CRM/Case/Task.php b/CRM/Case/Task.php index 0b6205fd43..7cd4726483 100644 --- a/CRM/Case/Task.php +++ b/CRM/Case/Task.php @@ -93,10 +93,11 @@ class CRM_Case_Task { if (!CRM_Core_Permission::check('delete in CiviCase')) { unset(self::$_tasks[1]); } + + CRM_Utils_Hook::searchTasks('case', self::$_tasks); + asort(self::$_tasks); } - CRM_Utils_Hook::searchTasks('case', self::$_tasks); - asort(self::$_tasks); return self::$_tasks; } diff --git a/CRM/Contribute/Task.php b/CRM/Contribute/Task.php index d4d095a46d..b4c6a5dcdf 100644 --- a/CRM/Contribute/Task.php +++ b/CRM/Contribute/Task.php @@ -133,6 +133,7 @@ class CRM_Contribute_Task { if (!$invoicing) { unset(self::$_tasks[9]); } + CRM_Utils_Hook::searchTasks('contribution', self::$_tasks); asort(self::$_tasks); } diff --git a/CRM/Event/Task.php b/CRM/Event/Task.php index fcf13dd917..8df11e500d 100644 --- a/CRM/Event/Task.php +++ b/CRM/Event/Task.php @@ -140,10 +140,11 @@ class CRM_Event_Task { if (!CRM_Core_Permission::check('edit event participants')) { unset(self::$_tasks[4], self::$_tasks[5], self::$_tasks[15]); } + + CRM_Utils_Hook::searchTasks('event', self::$_tasks); + asort(self::$_tasks); } - CRM_Utils_Hook::searchTasks('event', self::$_tasks); - asort(self::$_tasks); return self::$_tasks; } diff --git a/CRM/Grant/Task.php b/CRM/Grant/Task.php index c08bc27714..8b3d726604 100644 --- a/CRM/Grant/Task.php +++ b/CRM/Grant/Task.php @@ -89,12 +89,15 @@ class CRM_Grant_Task { 'result' => FALSE, ), ); + + if (!CRM_Core_Permission::check('delete in CiviGrant')) { + unset(self::$_tasks[1]); + } + + CRM_Utils_Hook::searchTasks('grant', self::$_tasks); + asort(self::$_tasks); } - if (!CRM_Core_Permission::check('delete in CiviGrant')) { - unset(self::$_tasks[1]); - } - CRM_Utils_Hook::searchTasks('grant', self::$_tasks); - asort(self::$_tasks); + return self::$_tasks; } diff --git a/CRM/Member/Task.php b/CRM/Member/Task.php index 19bc954e98..f9321ddf77 100644 --- a/CRM/Member/Task.php +++ b/CRM/Member/Task.php @@ -119,9 +119,11 @@ class CRM_Member_Task { if (!CRM_Core_Permission::check('edit memberships')) { unset(self::$_tasks[5]); } + + CRM_Utils_Hook::searchTasks('membership', self::$_tasks); + asort(self::$_tasks); } - CRM_Utils_Hook::searchTasks('membership', self::$_tasks); - asort(self::$_tasks); + return self::$_tasks; } diff --git a/CRM/Pledge/Task.php b/CRM/Pledge/Task.php index 4d16621689..75330fd0cf 100644 --- a/CRM/Pledge/Task.php +++ b/CRM/Pledge/Task.php @@ -89,9 +89,11 @@ class CRM_Pledge_Task { if (!CRM_Core_Permission::check('delete in CiviPledge')) { unset(self::$_tasks[1]); } + + CRM_Utils_Hook::searchTasks('pledge', self::$_tasks); + asort(self::$_tasks); } - CRM_Utils_Hook::searchTasks('pledge', self::$_tasks); - asort(self::$_tasks); + return self::$_tasks; }