INFRA-132 - Add space before "{"
[civicrm-core.git] / CRM / Event / Task.php
index 6e51c3342bd362c3e8ba40e1328014b29b088f87..fa9b877582a0e75ef3e9893409f4e6eb9c197395 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  */
 class CRM_Event_Task {
   // Value for SAVE_SEARCH is set to 13 in accordance with CRM_Contact_Task::SAVE_SEARCH
-  CONST DELETE_EVENTS = 1, PRINT_EVENTS = 2, EXPORT_EVENTS = 3, BATCH_EVENTS = 4, CANCEL_REGISTRATION = 5, EMAIL_CONTACTS = 6,
+  const DELETE_EVENTS = 1, PRINT_EVENTS = 2, EXPORT_EVENTS = 3, BATCH_EVENTS = 4, CANCEL_REGISTRATION = 5, EMAIL_CONTACTS = 6,
   // Value for LABEL_CONTACTS is set to 16 in accordance with CRM_Contact_Task::LABEL_CONTACTS
   SAVE_SEARCH = 13, SAVE_SEARCH_UPDATE = 14, PARTICIPANT_STATUS = 15,
-  LABEL_CONTACTS = 16;
+  LABEL_CONTACTS = 16, GROUP_CONTACTS = 20;
 
   /**
-   * the task array
+   * The task array
    *
    * @var array
    * @static
@@ -54,7 +54,7 @@ class CRM_Event_Task {
   static $_tasks = NULL;
 
   /**
-   * the optional task array
+   * The optional task array
    *
    * @var array
    * @static
@@ -67,11 +67,11 @@ class CRM_Event_Task {
    *
    * @return array the set of tasks for a group of contacts
    * @static
-   * @access public
    */
-  static function &tasks() {
+  public static function &tasks() {
     if (!(self::$_tasks)) {
-      self::$_tasks = array(1 => array(
+      self::$_tasks = array(
+      1 => array(
         'title' => ts('Delete Participants'),
           'class' => 'CRM_Event_Form_Task_Delete',
           'result' => FALSE,
@@ -127,6 +127,11 @@ class CRM_Event_Task {
           'class' => 'CRM_Event_Form_Task_Badge',
           'result' => FALSE,
         ),
+        20 => array(
+          'title' => ts('Add Contacts to Group'),
+          'class' => 'CRM_Event_Form_Task_AddToGroup',
+          'result' => FALSE,
+        ),
       );
 
       //CRM-4418, check for delete
@@ -134,8 +139,8 @@ class CRM_Event_Task {
         unset(self::$_tasks[1]);
       }
       //CRM-12920 - check for edit permission
-      if( !CRM_Core_Permission::check('edit event participants') ){
-        unset(self::$_tasks[4],self::$_tasks[5],self::$_tasks[15]);
+      if (!CRM_Core_Permission::check('edit event participants') ) {
+        unset(self::$_tasks[4], self::$_tasks[5], self::$_tasks[15]);
       }
     }
 
@@ -150,9 +155,8 @@ class CRM_Event_Task {
    *
    * @return array the set of task titles
    * @static
-   * @access public
    */
-  static function &taskTitles() {
+  public static function &taskTitles() {
     self::tasks();
     $titles = array();
     foreach (self::$_tasks as $id => $value) {
@@ -169,9 +173,8 @@ class CRM_Event_Task {
    *
    * @return array the set of optional tasks for a group of contacts
    * @static
-   * @access public
    */
-  static function &optionalTaskTitle() {
+  public static function &optionalTaskTitle() {
     $tasks = array(
       14 => self::$_tasks[14]['title'],
     );
@@ -179,15 +182,14 @@ class CRM_Event_Task {
   }
 
   /**
-   * show tasks selectively based on the permission level
+   * Show tasks selectively based on the permission level
    * of the user
    *
    * @param int $permission
    *
    * @return array set of tasks that are valid for the user
-   * @access public
    */
-  static function &permissionedTaskTitles($permission) {
+  public static function &permissionedTaskTitles($permission) {
     $tasks = array();
     if (($permission == CRM_Core_Permission::EDIT)
       || CRM_Core_Permission::check('edit event participants')
@@ -216,9 +218,8 @@ class CRM_Event_Task {
    *
    * @return array the set of tasks for a group of participants
    * @static
-   * @access public
    */
-  static function getTask($value) {
+  public static function getTask($value) {
     self::tasks();
     if (!$value || !CRM_Utils_Array::value($value, self::$_tasks)) {
       // make the print task by default
@@ -230,4 +231,3 @@ class CRM_Event_Task {
     );
   }
 }
-