ICM-13 Added group by contribution ID only
[civicrm-core.git] / CRM / Report / Info.php
index d79d779f0e2a9b2c2c6f321e57c8a508e1bf5b3f..c5c80f0bd3ef851f4c2152de1d310f7b97aecf7f 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
@@ -75,17 +75,39 @@ class CRM_Report_Info extends CRM_Core_Component_Info {
    * implementation of $getAllUnconditionally is required.
    *
    * @param bool $getAllUnconditionally
+   * @param bool $descriptions
+   *   Whether to return permission descriptions
    *
    * @return array|null
    *   collection of permissions, null if none
    */
-  /**
-   * @param bool $getAllUnconditionally
-   *
-   * @return array|null
-   */
-  public function getPermissions($getAllUnconditionally = FALSE) {
-    return array('access CiviReport', 'access Report Criteria', 'administer reserved reports', 'administer Reports');
+  public function getPermissions($getAllUnconditionally = FALSE, $descriptions = FALSE) {
+    $permissions = array(
+      'access CiviReport' => array(
+        ts('access CiviReport'),
+        ts('View reports'),
+      ),
+      'access Report Criteria' => array(
+        ts('access Report Criteria'),
+        ts('Change report search criteria'),
+      ),
+      'administer reserved reports' => array(
+        ts('administer reserved reports'),
+        ts('Edit all reports that have been marked as reserved'),
+      ),
+      'administer Reports' => array(
+        ts('administer Reports'),
+        ts('Manage report templates'),
+      ),
+    );
+
+    if (!$descriptions) {
+      foreach ($permissions as $name => $attr) {
+        $permissions[$name] = array_shift($attr);
+      }
+    }
+
+    return $permissions;
   }