Merge pull request #15382 from totten/5.18-note-event
[civicrm-core.git] / CRM / Price / Page / Set.php
index 88ff0aa1d6036c49e3280332650d3eccc7f97891..accc307829e5ccee5429a27dca3c0d31e7a489fe 100644 (file)
@@ -62,50 +62,50 @@ class CRM_Price_Page_Set extends CRM_Core_Page {
       // helper variable for nicer formatting
       $deleteExtra = ts('Are you sure you want to delete this price set?');
       $copyExtra = ts('Are you sure you want to make a copy of this price set?');
-      self::$_actionLinks = array(
-        CRM_Core_Action::BROWSE => array(
+      self::$_actionLinks = [
+        CRM_Core_Action::BROWSE => [
           'name' => ts('View and Edit Price Fields'),
           'url' => 'civicrm/admin/price/field',
           'qs' => 'reset=1&action=browse&sid=%%sid%%',
           'title' => ts('View and Edit Price Fields'),
-        ),
-        CRM_Core_Action::PREVIEW => array(
+        ],
+        CRM_Core_Action::PREVIEW => [
           'name' => ts('Preview'),
           'url' => 'civicrm/admin/price',
           'qs' => 'action=preview&reset=1&sid=%%sid%%',
           'title' => ts('Preview Price Set'),
-        ),
-        CRM_Core_Action::UPDATE => array(
+        ],
+        CRM_Core_Action::UPDATE => [
           'name' => ts('Settings'),
           'url' => 'civicrm/admin/price',
           'qs' => 'action=update&reset=1&sid=%%sid%%',
           'title' => ts('Edit Price Set'),
-        ),
-        CRM_Core_Action::DISABLE => array(
+        ],
+        CRM_Core_Action::DISABLE => [
           'name' => ts('Disable'),
           'ref' => 'crm-enable-disable',
           'title' => ts('Disable Price Set'),
-        ),
-        CRM_Core_Action::ENABLE => array(
+        ],
+        CRM_Core_Action::ENABLE => [
           'name' => ts('Enable'),
           'ref' => 'crm-enable-disable',
           'title' => ts('Enable Price Set'),
-        ),
-        CRM_Core_Action::DELETE => array(
+        ],
+        CRM_Core_Action::DELETE => [
           'name' => ts('Delete'),
           'url' => 'civicrm/admin/price',
           'qs' => 'action=delete&reset=1&sid=%%sid%%',
           'title' => ts('Delete Price Set'),
           'extra' => 'onclick = "return confirm(\'' . $deleteExtra . '\');"',
-        ),
-        CRM_Core_Action::COPY => array(
+        ],
+        CRM_Core_Action::COPY => [
           'name' => ts('Copy Price Set'),
           'url' => CRM_Utils_System::currentPath(),
           'qs' => 'action=copy&sid=%%sid%%',
           'title' => ts('Make a Copy of Price Set'),
           'extra' => 'onclick = "return confirm(\'' . $copyExtra . '\');"',
-        ),
-      );
+        ],
+      ];
     }
     return self::$_actionLinks;
   }
@@ -168,12 +168,12 @@ class CRM_Price_Page_Set extends CRM_Core_Page {
           $this->assign('usedPriceSetTitle', CRM_Price_BAO_PriceSet::getTitle($sid));
           $this->assign('usedBy', $usedBy);
 
-          $comps = array(
+          $comps = [
             'Event' => 'civicrm_event',
             'Contribution' => 'civicrm_contribution_page',
             'EventTemplate' => 'civicrm_event_template',
-          );
-          $priceSetContexts = array();
+          ];
+          $priceSetContexts = [];
           foreach ($comps as $name => $table) {
             if (array_key_exists($table, $usedBy)) {
               $priceSetContexts[] = $name;
@@ -247,12 +247,12 @@ class CRM_Price_Page_Set extends CRM_Core_Page {
    */
   public function browse($action = NULL) {
     // get all price sets
-    $priceSet = array();
-    $comps = array(
+    $priceSet = [];
+    $comps = [
       'CiviEvent' => ts('Event'),
       'CiviContribute' => ts('Contribution'),
       'CiviMember' => ts('Membership'),
-    );
+    ];
 
     $dao = new CRM_Price_DAO_PriceSet();
     if (CRM_Price_BAO_PriceSet::eventPriceSetDomainID()) {
@@ -261,13 +261,13 @@ class CRM_Price_Page_Set extends CRM_Core_Page {
     $dao->is_quick_config = 0;
     $dao->find();
     while ($dao->fetch()) {
-      $priceSet[$dao->id] = array();
+      $priceSet[$dao->id] = [];
       CRM_Core_DAO::storeValues($dao, $priceSet[$dao->id]);
 
       $compIds = explode(CRM_Core_DAO::VALUE_SEPARATOR,
         CRM_Utils_Array::value('extends', $priceSet[$dao->id])
       );
-      $extends = array();
+      $extends = [];
       //CRM-10225
       foreach ($compIds as $compId) {
         if (!empty($comps[CRM_Core_Component::getComponentName($compId)])) {
@@ -297,7 +297,7 @@ class CRM_Price_Page_Set extends CRM_Core_Page {
         $actionLinks[CRM_Core_Action::BROWSE]['name'] = ts('View Price Fields');
       }
       $priceSet[$dao->id]['action'] = CRM_Core_Action::formLink($actionLinks, $action,
-        array('sid' => $dao->id),
+        ['sid' => $dao->id],
         ts('more'),
         FALSE,
         'priceSet.row.actions',