CRM-16737 spport either payment_status_id OR contribution_status_id as processor...
[civicrm-core.git] / CRM / Event / Info.php
index 1d6d2d0f05beb6cd139b990a7f3748d71efd9660..398e3fc72ad08db98e5cc3a7ad159dcb7de923a6 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | 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() {
@@ -54,22 +56,52 @@ 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;
   }
 
   /**
@@ -81,54 +113,58 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
     );
   }
 
-  // docs inherited from interface
   /**
+   * @inheritDoc
    * @return array
    */
   public function getUserDashboardElement() {
-    return array('name' => ts('Events'),
+    return array(
+      'name' => ts('Events'),
       'title' => ts('Your Event(s)'),
       'perm' => array('register for events'),
       'weight' => 20,
     );
   }
 
-  // docs inherited from interface
   /**
+   * @inheritDoc
    * @return array
    */
   public function registerTab() {
-    return array('title' => ts('Events'),
+    return array(
+      'title' => ts('Events'),
       'id' => 'participant',
       'url' => 'participant',
       'weight' => 40,
     );
   }
 
-  // docs inherited from interface
   /**
+   * @inheritDoc
    * @return array
    */
   public function registerAdvancedSearchPane() {
-    return array('title' => ts('Events'),
+    return array(
+      'title' => ts('Events'),
       'weight' => 40,
     );
   }
 
-  // docs inherited from interface
   /**
+   * @inheritDoc
    * @return array
    */
   public function getActivityTypes() {
     $types = array();
-    $types['Event'] = array('title' => ts('Event'),
+    $types['Event'] = array(
+      'title' => ts('Event'),
       'callback' => 'CRM_Event_Page_EventInfo::run()',
     );
     return $types;
   }
 
-  // add shortcut to Create New
   /**
+   * add shortcut to Create New.
    * @param $shortCuts
    * @param $newCredit
    */
@@ -154,5 +190,5 @@ class CRM_Event_Info extends CRM_Core_Component_Info {
       $shortCuts = array_merge($shortCuts, $shortCut);
     }
   }
-}
 
+}