Merge pull request #10781 from eileenmcnaughton/postal
[civicrm-core.git] / CRM / Activity / Task.php
index 48f99a52b5787b1f0ff7313c17a5a9741870ce0a..dbb2e6307d3f7b01c100ce493bcb6442ee9de6fa 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -26,9 +26,8 @@
  */
 
 /**
- *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2017
  */
 
 /**
@@ -58,8 +57,8 @@ class CRM_Activity_Task {
   static $_optionalTasks = NULL;
 
   /**
-   * These tasks are the core set of tasks that the user can perform.
-   * on a contact / group of contacts
+   * These tasks are the core set of tasks that the user can perform
+   * on a contact / group of contacts.
    *
    * @return array
    *   the set of tasks for a group of contacts
@@ -131,19 +130,20 @@ class CRM_Activity_Task {
         }
       }
 
-      //CRM-4418, check for delete
+      // CRM-4418, check for delete
       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;
   }
 
   /**
-   * These tasks are the core set of task titles.
-   * on activity
+   * These tasks are the core set of task titles on activity.
    *
    * @return array
    *   the set of task titles
@@ -158,8 +158,7 @@ class CRM_Activity_Task {
   }
 
   /**
-   * Show tasks selectively based on the permission level.
-   * of the user
+   * Show tasks selectively based on the permission level of the user.
    *
    * @param int $permission
    *
@@ -185,8 +184,7 @@ class CRM_Activity_Task {
   }
 
   /**
-   * These tasks are the core set of tasks that the user can perform.
-   * on activity
+   * These tasks are the core set of tasks that the user can perform on activity.
    *
    * @param int $value
    *