CRM-16737 spport either payment_status_id OR contribution_status_id as processor...
[civicrm-core.git] / CRM / Event / Info.php
index 9399c0a63ca86ad8313d29a6670b6d3f1c2ec6cc..398e3fc72ad08db98e5cc3a7ad159dcb7de923a6 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  * This class introduces component to the system and provides all the
  * abstract class.
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
 class CRM_Event_Info extends CRM_Core_Component_Info {
 
-  // docs inherited from interface
+  /**
+   * @inheritDoc
+   */
   protected $keyword = 'event';
 
   /**
-   * docs inherited from interface
+   * @inheritDoc
    * @return array
    */
   public function getInfo() {
@@ -55,21 +57,51 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
   }
 
   /**
-   * docs inherited from interface
+   * @inheritDoc
    * @param bool $getAllUnconditionally
+   * @param bool $descriptions
+   *   Whether to return permission descriptions
    *
    * @return array
    */
-  public function getPermissions($getAllUnconditionally = FALSE) {
-    return array(
-      'access CiviEvent',
-      'edit event participants',
-      'edit all events',
-      'register for events',
-      'view event info',
-      'view event participants',
-      'delete in CiviEvent',
+  public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
+    $permissions = array(
+      'access CiviEvent' => array(
+        ts('access CiviEvent'),
+        ts('Create events, view all events, and view participant records (for visible contacts)'),
+      ),
+      'edit event participants' => array(
+        ts('edit event participants'),
+        ts('Record and update backend event registrations'),
+      ),
+      'edit all events' => array(
+        ts('edit all events'),
+        ts('Edit events even without specific ACL granted'),
+      ),
+      'register for events' => array(
+        ts('register for events'),
+        ts('Register for events online'),
+      ),
+      'view event info' => array(
+        ts('view event info'),
+        ts('View online event information pages'),
+      ),
+      'view event participants' => array(
+        ts('view event participants'),
+      ),
+      'delete in CiviEvent' => array(
+        ts('delete in CiviEvent'),
+        ts('Delete participants and events that you can edit'),
+      ),
     );
+
+    if (!$descriptions) {
+      foreach ($permissions as $name => $attr) {
+        $permissions[$name] = array_shift($attr);
+      }
+    }
+
+    return $permissions;
   }
 
   /**
@@ -82,7 +114,7 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
   }
 
   /**
-   * docs inherited from interface
+   * @inheritDoc
    * @return array
    */
   public function getUserDashboardElement() {
@@ -95,7 +127,7 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
   }
 
   /**
-   * docs inherited from interface
+   * @inheritDoc
    * @return array
    */
   public function registerTab() {
@@ -108,7 +140,7 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
   }
 
   /**
-   * docs inherited from interface
+   * @inheritDoc
    * @return array
    */
   public function registerAdvancedSearchPane() {
@@ -119,7 +151,7 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
   }
 
   /**
-   * docs inherited from interface
+   * @inheritDoc
    * @return array
    */
   public function getActivityTypes() {
@@ -132,7 +164,7 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
   }
 
   /**
-   * add shortcut to Create New
+   * add shortcut to Create New.
    * @param $shortCuts
    * @param $newCredit
    */
@@ -158,4 +190,5 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
       $shortCuts = array_merge($shortCuts, $shortCut);
     }
   }
+
 }